Package org.apache.jena.graph
Class NodeFactory
java.lang.Object
org.apache.jena.graph.NodeFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Node
Make a fresh blank nodestatic Node
createBlankNode
(String string) make a blank node with the specified labelstatic Node
make a blank node with the specified labelstatic Node
make an extension node based on a string.static Node
createGraphNode
(Graph graph) Create a graph node.static Node
createLiteral
(String value) static Node
createLiteral
(String lex, String lang) Make a literal with specified language.static Node
createLiteral
(String lex, String lang, boolean isXml) make a literal with specified language and XMLishness.static Node
createLiteral
(String lex, String lang, RDFDatatype dtype) Build a literal node from its lexical form.static Node
createLiteral
(String lex, RDFDatatype dtype) Build a typed literal node from its lexical form.static Node
make a literal node with the specified literal valuestatic Node
createLiteralByValue
(Object value, String lang, RDFDatatype dtype) Create a Node based on the value If the value is a string we assume this is intended to be a lexical form after all.static Node
createLiteralByValue
(Object value, RDFDatatype dtype) Create a Node based on the value If the value is a string we assume this is intended to be a lexical form after all.static Node
createTripleNode
(Node s, Node p, Node o) Create a triple node (RDF-star)static Node
createTripleNode
(Triple triple) Create a triple node (RDF-star)static Node
make a URI node with the specified URIref stringstatic Node
createVariable
(String name) make a variable node with a given namestatic RDFDatatype
-
Constructor Details
-
NodeFactory
public NodeFactory()
-
-
Method Details
-
getType
-
createBlankNode
Make a fresh blank node -
createBlankNode
make a blank node with the specified label -
createBlankNode
make a blank node with the specified label -
createLiteral
make a literal node with the specified literal value -
createURI
make a URI node with the specified URIref string -
createVariable
make a variable node with a given name -
createExt
make an extension node based on a string. -
createLiteral
-
createLiteral
make a literal with specified language and XMLishness. lexical form must not be null.- Parameters:
lex
-lang
-isXml
- If true then lit is exclusive canonical XML of type rdf:XMLLiteral, and no checking will be invoked.
-
createLiteral
Make a literal with specified language. lexical form must not be null.- Parameters:
lex
- the lexical form of the literallang
- the optional language tag
-
createLiteral
public static Node createLiteral(String lex, String lang, RDFDatatype dtype) throws DatatypeFormatException Build a literal node from its lexical form. The lexical form will be parsed now and the value stored. If the form is not legal this will throw an exception.- Parameters:
lex
- the lexical form of the literallang
- the optional language tagdtype
- the type of the literal- Throws:
DatatypeFormatException
- if lex is not a legal form of dtype
-
createLiteral
Build a typed literal node from its lexical form. The lexical form will be parsed now and the value stored. If the form is not legal this will throw an exception.- Parameters:
lex
- the lexical form of the literaldtype
- the type of the literal- Throws:
DatatypeFormatException
- if lex is not a legal form of dtype
-
createLiteralByValue
public static Node createLiteralByValue(Object value, RDFDatatype dtype) throws DatatypeFormatException Create a Node based on the value If the value is a string we assume this is intended to be a lexical form after all.- Parameters:
value
- The value, mapped according to registered types.dtype
- RDF Datatype.- Returns:
- Node
- Throws:
DatatypeFormatException
-
createLiteralByValue
public static Node createLiteralByValue(Object value, String lang, RDFDatatype dtype) throws DatatypeFormatException Create a Node based on the value If the value is a string we assume this is intended to be a lexical form after all.- Parameters:
value
- The value, mapped according to registered types.lang
- (optional) Language tag, if a string.dtype
- RDF Datatype.- Returns:
- Node
- Throws:
DatatypeFormatException
-
createTripleNode
Create a triple node (RDF-star) -
createTripleNode
Create a triple node (RDF-star) -
createGraphNode
Create a graph node. This is an N3-formula; it is not a named graph (see "quad")
-