Class LmdbLiteral

java.lang.Object
org.eclipse.rdf4j.model.base.AbstractLiteral
org.eclipse.rdf4j.sail.lmdb.model.LmdbLiteral
All Implemented Interfaces:
Serializable, Literal, Value, LmdbValue

public class LmdbLiteral extends AbstractLiteral implements LmdbValue
See Also:
  • Constructor Details

  • Method Details

    • setInternalID

      public void setInternalID(long internalID, ValueStoreRevision revision)
      Description copied from interface: LmdbValue
      Sets the ID that is used for this value in a specific revision of the value store.
      Specified by:
      setInternalID in interface LmdbValue
    • getValueStoreRevision

      public ValueStoreRevision getValueStoreRevision()
      Description copied from interface: LmdbValue
      Gets the revision of the value store that created this value. The value's internal ID is only valid when it's value store revision is equal to the value store's current revision.
      Specified by:
      getValueStoreRevision in interface LmdbValue
      Returns:
      The revision of the value store that created this value at the time it last set the value's internal ID.
    • getInternalID

      public long getInternalID()
      Description copied from interface: LmdbValue
      Gets the ID that is used in the lmdb store for this Value.
      Specified by:
      getInternalID in interface LmdbValue
      Returns:
      The value's ID, or LmdbValue.UNKNOWN_ID if not yet set.
    • getDatatype

      public IRI getDatatype()
      Description copied from interface: Literal
      Gets the datatype for this literal.

      If Literal.getLanguage() returns a non-empty value than this must return rdf:langString. If no datatype was assigned to this literal by the creator, then this method must return xsd:string.

      Specified by:
      getDatatype in interface Literal
      Returns:
      The datatype for this literal.
    • getCoreDatatype

      public CoreDatatype getCoreDatatype()
      Description copied from interface: Literal
      CoreDatatype is an interface for natively supported datatypes in RDF4J. This includes, among others, the XML Schema datatypes and rdf:langString. CoreDatatypes are implemented as enums and more performant and convenient to work with than IRI-based datatypes. The constant
      invalid @link
      {@link CoreDatatype#NONE)
      } is used to represent a datatype that is not one of the supported core datatypes.
      Specified by:
      getCoreDatatype in interface Literal
      Returns:
      The CoreDatatype or
      invalid @link
      {@link CoreDatatype#NONE)
      } if the datatype matches none of the core datatypes. This method will not return null.
    • setDatatype

      public void setDatatype(IRI datatype)
    • setDatatype

      public void setDatatype(CoreDatatype coreDatatype)
    • getLabel

      public String getLabel()
      Description copied from interface: Literal
      Gets the label (the lexical value) of this literal.
      Specified by:
      getLabel in interface Literal
      Returns:
      The literal's label.
    • setLabel

      public void setLabel(String label)
    • getLanguage

      public Optional<String> getLanguage()
      Description copied from interface: Literal
      Gets the language tag for this literal, normalized to lower case.
      Specified by:
      getLanguage in interface Literal
      Returns:
      The language tag for this literal, or Optional.empty() if it doesn't have one.
    • setLanguage

      public void setLanguage(String language)
    • init

      protected void init()
    • equals

      public boolean equals(Object o)
      Description copied from interface: Literal
      Compares this literal to another object.
      Specified by:
      equals in interface Literal
      Overrides:
      equals in class AbstractLiteral
      Parameters:
      o - the object to compare this literal to
      Returns:
      true, if the other object is an instance of Literal and if their labels, language tags and datatypes are equal
    • hashCode

      public int hashCode()
      Description copied from interface: Literal
      Computes the hash code of this literal.
      Specified by:
      hashCode in interface Literal
      Overrides:
      hashCode in class AbstractLiteral
      Returns:
      a hash code for this literal computed as Literal.getLabel().hashCode()
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLiteral
    • writeReplace

      protected Object writeReplace() throws ObjectStreamException
      Throws:
      ObjectStreamException