Package no.hasmac.rdf
Interface RdfLiteral
-
- All Superinterfaces:
RdfValue
- All Known Implementing Classes:
RdfLiteralImpl
public interface RdfLiteral extends RdfValue
TheRdfLiteral
interface describes an immutableRDF Literal
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RdfLiteral
asLiteral()
Return the RdfValue as a RdfLiteraljava.lang.String
getDatatype()
An absolute IRI denoting the datatype IRI of the literal.java.util.Optional<java.lang.String>
getLanguage()
An optional language tag.java.lang.String
getValue()
Get the lexical value of the literal.default boolean
isBlankNode()
Indicates if the value type is blank node identifier.default boolean
isIRI()
Indicates if the value type is an absolute IRI.default boolean
isLiteral()
Indicates if the value type is RDF literal.
-
-
-
Method Detail
-
getValue
java.lang.String getValue()
Get the lexical value of the literal.
-
getDatatype
java.lang.String getDatatype()
An absolute IRI denoting the datatype IRI of the literal. If the value is rdf:langString,getLanguage()
value is present.- Returns:
- an absolute IRI, never
null
-
getLanguage
java.util.Optional<java.lang.String> getLanguage()
An optional language tag. If this value is specified,getDatatype()
returns rdf:langString.- Returns:
- language tag or
Optional.empty()
if not set
-
isIRI
default boolean isIRI()
Description copied from interface:RdfValue
Indicates if the value type is an absolute IRI.
-
isBlankNode
default boolean isBlankNode()
Description copied from interface:RdfValue
Indicates if the value type is blank node identifier.- Specified by:
isBlankNode
in interfaceRdfValue
- Returns:
true
if the value type is blank node,false
otherwise.
-
asLiteral
default RdfLiteral asLiteral()
Description copied from interface:RdfValue
Return the RdfValue as a RdfLiteral
-
-