Class JsonLdLiteralImpl
- All Implemented Interfaces:
Literal, RDFTerm, JsonLdLiteral, JsonLdTerm
-
Field Summary
Fields inherited from class JsonLdTermImpl
node -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck it this RDFTerm is equal to another RDFTerm.The IRI identifying the datatype that determines how the lexical form maps to a literal value.If and only if the datatype IRI is http://www.w3.org/1999/02/22-rdf-syntax-ns#langString, the language tag for this Literal is a non-empty language tag as defined by BCP47.
If the datatype IRI is not http://www.w3.org/1999/02/22-rdf-syntax-ns#langString, this method must returnOptional.empty().The lexical form of this literal, represented by a Unicode string.inthashCode()Calculate a hash code for this RDFTerm.private static StringReturn the term serialised as specified by the RDF-1.1 N-Triples Canonical form.Methods inherited from class JsonLdTermImpl
asJsonLdNode, toStringMethods inherited from interface JsonLdTerm
asJsonLdNode
-
Constructor Details
-
JsonLdLiteralImpl
JsonLdLiteralImpl(com.github.jsonldjava.core.RDFDataset.Node node)
-
-
Method Details
-
lowerCase
-
ntriplesString
Description copied from interface:RDFTermReturn the term serialised as specified by the RDF-1.1 N-Triples Canonical form.- Specified by:
ntriplesStringin interfaceRDFTerm- Returns:
- The term serialised as RDF-1.1 N-Triples.
- See Also:
-
getLexicalForm
Description copied from interface:LiteralThe lexical form of this literal, represented by a Unicode string.- Specified by:
getLexicalFormin interfaceLiteral- Returns:
- The lexical form of this literal.
- See Also:
-
getDatatype
Description copied from interface:LiteralThe IRI identifying the datatype that determines how the lexical form maps to a literal value. If the datatype IRI is http://www.w3.org/1999/02/22-rdf-syntax-ns#langString,Literal.getLanguageTag()must not returnOptional.empty(), and it must return a valid BCP47 language tag.- Specified by:
getDatatypein interfaceLiteral- Returns:
- The datatype IRI for this literal.
- See Also:
-
getLanguageTag
Description copied from interface:LiteralIf and only if the datatype IRI is http://www.w3.org/1999/02/22-rdf-syntax-ns#langString, the language tag for this Literal is a non-empty language tag as defined by BCP47.
If the datatype IRI is not http://www.w3.org/1999/02/22-rdf-syntax-ns#langString, this method must returnOptional.empty().The value space of language tags is always in lower case; although RDF implementations MAY convert all language tags to lower case, safe comparisons of language tags should be done using
String.toLowerCase(Locale)with the localeLocale.ROOT.Implementation note: If your application requires
Serializableobjects, it is best not to store anOptionalin a field. It is recommended to useOptional.ofNullable(Object)to create the return value for this method.- Specified by:
getLanguageTagin interfaceLiteral- Returns:
- The
Optionallanguage tag for this literal. IfOptional.isPresent()returns true, the value returned byOptional.get()must be a non-empty language tag string conforming to BCP47. - See Also:
-
hashCode
public int hashCode()Description copied from interface:RDFTermCalculate a hash code for this RDFTerm.As an
RDFTermis immutable, this method will always return the same hashCode over the lifetime of this object.This method MUST be implemented in conjunction with
RDFTerm.equals(Object)so that two equal RDFTerm produce the same hash code. -
equals
Description copied from interface:RDFTermCheck it this RDFTerm is equal to another RDFTerm.If this object is an
IRI, equality is checked usingIRI.equals(Object), or if this object is aBlankNode, equality is checked usingBlankNode.equals(Object), or if this object is aLiteral, equality is checked usingLiteral.equals(Object).Implementations MUST also override
RDFTerm.hashCode()so that two equal Literals produce the same hash code.
-