Package no.hasmac.rdf

Interface RdfLiteral

All Superinterfaces:
RdfValue
All Known Implementing Classes:
RdfLiteralImpl

public interface RdfLiteral extends RdfValue
The RdfLiteral interface describes an immutable RDF Literal.
  • Method Summary

    Modifier and Type
    Method
    Description
    default RdfLiteral
    Return the RdfValue as a RdfLiteral
    An absolute IRI denoting the datatype IRI of the literal.
    An optional language tag.
    Get the lexical value of the literal.
    default boolean
    Indicates if the value type is blank node identifier.
    default boolean
    Indicates if the value type is an absolute IRI.
    default boolean
    Indicates if the value type is RDF literal.

    Methods inherited from interface no.hasmac.rdf.RdfValue

    equals, hashCode, toString
  • Method Details

    • getValue

      String getValue()
      Get the lexical value of the literal.
      Specified by:
      getValue in interface RdfValue
      Returns:
      lexical value, never null
    • getDatatype

      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

      Optional<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.
      Specified by:
      isIRI in interface RdfValue
      Returns:
      true if the value type is IRI, false otherwise.
    • isBlankNode

      default boolean isBlankNode()
      Description copied from interface: RdfValue
      Indicates if the value type is blank node identifier.
      Specified by:
      isBlankNode in interface RdfValue
      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
      Specified by:
      asLiteral in interface RdfValue
      Returns:
      the RdfValue as a RdfLiteral
    • isLiteral

      default boolean isLiteral()
      Description copied from interface: RdfValue
      Indicates if the value type is RDF literal.
      Specified by:
      isLiteral in interface RdfValue
      Returns:
      true if the value type is literal, false otherwise.