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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.eclipse.rdf4j.sail.lmdb.model.LmdbValue
UNKNOWN_ID
-
-
Constructor Summary
Constructors Constructor Description LmdbLiteral(ValueStoreRevision revision, long internalID)LmdbLiteral(ValueStoreRevision revision, String label, long internalID)LmdbLiteral(ValueStoreRevision revision, String label, String lang)LmdbLiteral(ValueStoreRevision revision, String label, String lang, long internalID)LmdbLiteral(ValueStoreRevision revision, String label, CoreDatatype datatype)LmdbLiteral(ValueStoreRevision revision, String label, CoreDatatype coreDatatype, long internalID)LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype)LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, long internalID)LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, CoreDatatype coreDatatype)LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, CoreDatatype coreDatatype, long internalID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Compares this literal to another object.CoreDatatypegetCoreDatatype()CoreDatatype is an interface for natively supported datatypes in RDF4J.IRIgetDatatype()Gets the datatype for this literal.longgetInternalID()Gets the ID that is used in the lmdb store for this Value.StringgetLabel()Gets the label (the lexical value) of this literal.Optional<String>getLanguage()Gets the language tag for this literal, normalized to lower case.ValueStoreRevisiongetValueStoreRevision()Gets the revision of the value store that created this value.inthashCode()Computes the hash code of this literal.voidinit()Initializes this value if it was a lazy value (ID-only value) before.voidsetDatatype(CoreDatatype coreDatatype)voidsetDatatype(IRI datatype)voidsetInternalID(long internalID, ValueStoreRevision revision)Sets the ID that is used for this value in a specific revision of the value store.voidsetLabel(String label)voidsetLanguage(String language)StringtoString()protected ObjectwriteReplace()-
Methods inherited from class org.eclipse.rdf4j.model.base.AbstractLiteral
booleanValue, byteValue, calendarValue, decimalValue, doubleValue, floatValue, integerValue, intValue, longValue, shortValue, stringValue, temporalAccessorValue, temporalAmountValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isResource, isTriple, stringValue
-
-
-
-
Constructor Detail
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, long internalID)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, long internalID)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, String lang)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, String lang, long internalID)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, CoreDatatype coreDatatype)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, CoreDatatype datatype)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, long internalID)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, IRI datatype, CoreDatatype coreDatatype, long internalID)
-
LmdbLiteral
public LmdbLiteral(ValueStoreRevision revision, String label, CoreDatatype coreDatatype, long internalID)
-
-
Method Detail
-
setInternalID
public void setInternalID(long internalID, ValueStoreRevision revision)Description copied from interface:LmdbValueSets the ID that is used for this value in a specific revision of the value store.- Specified by:
setInternalIDin interfaceLmdbValue
-
getValueStoreRevision
public ValueStoreRevision getValueStoreRevision()
Description copied from interface:LmdbValueGets 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:
getValueStoreRevisionin interfaceLmdbValue- 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:LmdbValueGets the ID that is used in the lmdb store for this Value.- Specified by:
getInternalIDin interfaceLmdbValue- Returns:
- The value's ID, or
LmdbValue.UNKNOWN_IDif not yet set.
-
getDatatype
public IRI getDatatype()
Description copied from interface:LiteralGets the datatype for this literal.If
Literal.getLanguage()returns a non-empty value than this must returnrdf:langString. If no datatype was assigned to this literal by the creator, then this method must returnxsd:string.- Specified by:
getDatatypein interfaceLiteral- Returns:
- The datatype for this literal.
-
getCoreDatatype
public CoreDatatype getCoreDatatype()
Description copied from interface:LiteralCoreDatatype 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 {@link CoreDatatype#NONE)} is used to represent a datatype that is not one of the supported core datatypes.- Specified by:
getCoreDatatypein interfaceLiteral- Returns:
- The CoreDatatype or {@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:LiteralGets the label (the lexical value) of this literal.
-
setLabel
public void setLabel(String label)
-
getLanguage
public Optional<String> getLanguage()
Description copied from interface:LiteralGets the language tag for this literal, normalized to lower case.- Specified by:
getLanguagein interfaceLiteral- Returns:
- The language tag for this literal, or
Optional.empty()if it doesn't have one.
-
setLanguage
public void setLanguage(String language)
-
init
public void init()
Description copied from interface:LmdbValueInitializes this value if it was a lazy value (ID-only value) before.
-
equals
public boolean equals(Object o)
Description copied from interface:LiteralCompares this literal to another object.- Specified by:
equalsin interfaceLiteral- Overrides:
equalsin classAbstractLiteral- Parameters:
o- the object to compare this literal to- Returns:
true, if the other object is an instance ofLiteraland if their labels, language tags and datatypes are equal
-
hashCode
public int hashCode()
Description copied from interface:LiteralComputes the hash code of this literal.- Specified by:
hashCodein interfaceLiteral- Overrides:
hashCodein classAbstractLiteral- Returns:
- a hash code for this literal computed as
Literal.getLabel().hashCode()
-
toString
public String toString()
- Overrides:
toStringin classAbstractLiteral
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
-