Package com.inrupt.rdf.wrapping.commons
Class TermMappings
java.lang.Object
com.inrupt.rdf.wrapping.commons.TermMappings
Common mappings from various values to RDF terms. For use in wrapping classes.
- Author:
- Samu Lang
-
Method Summary
Modifier and TypeMethodDescriptionstatic IRI
Maps an IRI string to an IRI term.static IRI
Maps a URI to an IRI term.static Literal
asStringLiteral
(String value, Graph graph) Maps a string to a literal term.static Literal
asTypedLiteral
(Boolean value, Graph graph) Maps a boolean value to a literal term.static Literal
asTypedLiteral
(Integer value, Graph graph) Maps a integer value to a literal term.static Literal
asTypedLiteral
(Instant value, Graph graph) Maps a point in time to a literal term.static RDFTerm
Maps a term to itself.
-
Method Details
-
asStringLiteral
Maps a string to a literal term.- Parameters:
value
- the value to mapgraph
- the graph that serves as the context for creating the term- Returns:
- an xsd:string typed literal with the string as its lexical form
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
asIri
Maps an IRI string to an IRI term.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- an IRI term with the string as its identifier
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
asIri
Maps a URI to an IRI term.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- an IRI term with the URI as its identifier
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
asTypedLiteral
Maps a point in time to a literal term.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- an xsd:dateTime typed literal term with the point in time as its lexical value
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
asTypedLiteral
Maps a boolean value to a literal term.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- an xsd:boolean typed literal node with the boolean value as its lexical value
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
asTypedLiteral
Maps a integer value to a literal term.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- an xsd:int typed literal node with the integer value as its lexical value
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-
identity
Maps a term to itself.- Parameters:
value
- the value to mapgraph
- ignored- Returns:
- the same term
- Throws:
NullPointerException
- if the value is nullNullPointerException
- if the model is null
-