Class Literal

java.lang.Object
cz.cvut.kbss.ontodriver.model.Literal
All Implemented Interfaces:
Serializable

public class Literal extends Object implements Serializable
Represents an RDF literal consisting of a lexical form and datatype IRI.

To represent language-tagged string values, use LangString.

See Also:
  • Constructor Details

    • Literal

      public Literal(String lexicalForm, String datatype)
  • Method Details

    • getLexicalForm

      public String getLexicalForm()
      Gets the lexical form of this literal.
      Returns:
      String containing the lexical form
    • getDatatype

      public String getDatatype()
      Gets the datatype identifier.
      Returns:
      String containing the datatype IRI
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • from

      public static Literal from(String lexicalForm, String datatype)
      Creates a literal instance from the specified lexical form and datatype.

      Convenience factory method alternative to constructor.

      Parameters:
      lexicalForm - Lexical form of the literal
      datatype - Datatype of the literal
      Returns:
      Literal instance