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 boolean
equals(Object o)
Compares this literal to another object.CoreDatatype
getCoreDatatype()
CoreDatatype is an interface for natively supported datatypes in RDF4J.IRI
getDatatype()
Gets the datatype for this literal.long
getInternalID()
Gets the ID that is used in the lmdb store for this Value.String
getLabel()
Gets the label (the lexical value) of this literal.Optional<String>
getLanguage()
Gets the language tag for this literal, normalized to lower case.ValueStoreRevision
getValueStoreRevision()
Gets the revision of the value store that created this value.int
hashCode()
Computes the hash code of this literal.protected void
init()
void
setDatatype(CoreDatatype coreDatatype)
void
setDatatype(IRI datatype)
void
setInternalID(long internalID, ValueStoreRevision revision)
Sets the ID that is used for this value in a specific revision of the value store.void
setLabel(String label)
void
setLanguage(String language)
String
toString()
protected Object
writeReplace()
-
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:LmdbValue
Sets the ID that is used for this value in a specific revision of the value store.- Specified by:
setInternalID
in interfaceLmdbValue
-
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 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:LmdbValue
Gets the ID that is used in the lmdb store for this Value.- Specified by:
getInternalID
in interfaceLmdbValue
- 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 returnrdf:langString
. If no datatype was assigned to this literal by the creator, then this method must returnxsd:string
.- Specified by:
getDatatype
in interfaceLiteral
- 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 {@link CoreDatatype#NONE)} is used to represent a datatype that is not one of the supported core datatypes.- Specified by:
getCoreDatatype
in 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:Literal
Gets the label (the lexical value) of this literal.
-
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 interfaceLiteral
- 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 interfaceLiteral
- Overrides:
equals
in classAbstractLiteral
- Parameters:
o
- the object to compare this literal to- Returns:
true
, if the other object is an instance ofLiteral
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 interfaceLiteral
- Overrides:
hashCode
in classAbstractLiteral
- Returns:
- a hash code for this literal computed as
Literal.getLabel()
.hashCode()
-
toString
public String toString()
- Overrides:
toString
in classAbstractLiteral
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
-