Class NodeFactory

java.lang.Object
org.apache.jena.graph.NodeFactory

public class NodeFactory extends Object
  • Method Details

    • getType

      public static RDFDatatype getType(String s)
    • createBlankNode

      public static Node createBlankNode()
      Make a fresh blank node
    • createBlankNode

      public static Node createBlankNode(String string)
      make a blank node with the specified label
    • createURI

      public static Node createURI(String uri)
      make a URI node with the specified URIref string
    • createVariable

      public static Node createVariable(String name)
      make a variable node with a given name
    • createExt

      public static Node createExt(String name)
      make an extension node based on a string.
    • createLiteral

      @Deprecated public static Node createLiteral(LiteralLabel lit)
      Deprecated.
      Making nodes directly from LiteralLabel may be removed.
      Make a literal node with the specified literal value
    • createLiteral

      @Deprecated public static Node createLiteral(String string)
    • createLiteralString

      public static Node createLiteralString(String string)
    • createLiteral

      @Deprecated public static Node createLiteral(String string, String lang)
      Make a literal with specified language. The lexical form must not be null.
      Parameters:
      string - the lexical form of the literal
      lang - the optional language tag
    • createLiteralLang

      public static Node createLiteralLang(String string, String lang)
      Make a literal with specified language. The lexical form must not be null.
      Parameters:
      string - the lexical form of the literal
      lang - the optional language tag
    • createLiteralDirLang

      public static Node createLiteralDirLang(String string, String lang, String textDir)
      Make a literal with specified language and language direction. The lexical form must not be null. The language must not be null if a non-direction is provided.
      Parameters:
      string - the lexical form of the literal
      lang - the optional language tag
      textDir - the optional language direction
    • createLiteralDirLang

      public static Node createLiteralDirLang(String string, String lang, TextDirection textDir)
    • createLiteral

      public static Node createLiteral(String lex, String lang, RDFDatatype dtype)
      Build a literal node.

      This is a convenience operation for passing in language and datatype without needing the caller to differentiate between the xsd:string, rdf:langString and other datatype cases. It calls createLiteralString(String), createLiteralDirLang(String, String, String) or createLiteral(String, RDFDatatype) as appropriate.

      Parameters:
      lex - the lexical form of the literal
      lang - the optional language tag or null or ""
      dtype - the type of the literal or null.
    • createLiteral

      public static Node createLiteral(String lex, String lang, String textDir, RDFDatatype dtype)
      Build a literal node.

      This is a convenience operation for passing in language and datatype without needing the caller to differentiate between the xsd:string, rdf:langString, and other datatype cases. It calls createLiteralString(String), createLiteralDirLang(String, String, String) or createLiteral(String, RDFDatatype) as appropriate.

      Parameters:
      lex - the lexical form of the literal
      lang - the optional language tag or null or ""
      textDir - the optional language direction or null
      dtype - the type of the literal or null.
    • createLiteral

      public static Node createLiteral(String lex, String lang, TextDirection textDir, RDFDatatype dtype)
      Build a literal node.

      This is a convenience operation for passing in language and datatype without needing the caller to differentiate between the xsd:string, rdf:langString, and other datatype cases. It calls createLiteralString(String), createLiteralDirLang(String, String, String) or createLiteral(String, RDFDatatype) as appropriate.

      Parameters:
      lex - the lexical form of the literal
      lang - the optional language tag or null or ""
      textDir - the optional language direction or null
      dtype - the type of the literal or null.
    • createLiteral

      public static Node createLiteral(String lex, RDFDatatype dtype)
      Build a typed literal node from its lexical form.
      Parameters:
      lex - the lexical form of the literal
      dtype - the type of the literal
    • createLiteralByValue

      public static Node createLiteralByValue(Object value)
      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.
      Returns:
      Node
    • createLiteralByValue

      public 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.
      Parameters:
      value - The value, mapped according to registered types.
      dtype - RDF Datatype.
      Returns:
      Node
    • createTripleNode

      public static Node createTripleNode(Node s, Node p, Node o)
      Create a triple node (RDF-star)
    • createTripleNode

      public static Node createTripleNode(Triple triple)
      Create a triple node (RDF-star)
    • createGraphNode

      public static Node createGraphNode(Graph graph)
      Create a graph node. This is an N3-formula; it is not a named graph (see "quad")