Interface LiteralProvider

All Superinterfaces:
DatatypeProvider, Serializable
All Known Subinterfaces:
AnnotationAssertionProvider, ClassAssertionProvider, DataAssertionProvider, DatatypeExpressionProvider, IndividualAssertionProvider, ObjectAssertionProvider, OWLDataFactory

public interface LiteralProvider extends DatatypeProvider
Provider for OWLLiteral construction.
  • Method Details

    • getOWLLiteral

      OWLLiteral getOWLLiteral(String lexicalValue, OWLDatatype datatype)
      Gets an OWLLiteral, which has the specified lexical value, and is typed with the specified datatype.
      Parameters:
      lexicalValue - The lexical value.
      datatype - The datatype.
      Returns:
      An OWLLiteral with the specified lexical value and specified datatype. If the datatype is rdf:PlainLiteral, and the lexical value contains a language tag then the language tag will be parsed out of the lexical value. For example, "abc@en"^^rdf:PlainLiteral would be parsed into a lexical value of "abc" and a language tag of "en".
    • getOWLLiteral

      default OWLLiteral getOWLLiteral(String lexicalValue, OWL2Datatype datatype)
      Gets an OWLLiteral, which has the specified lexical value, and is typed with the specified datatype.
      Parameters:
      lexicalValue - The lexical value.
      datatype - The datatype.
      Returns:
      An OWLLiteral with the specified lexical value and specified datatype. If the datatype is rdf:PlainLiteral, and the lexical value contains a language tag then the language tag will be parsed out of the lexical value. For example, "abc@en"^^rdf:PlainLiteral would be parsed into a lexical value of "abc" and a language tag of "en".
    • getOWLLiteral

      OWLLiteral getOWLLiteral(int value)
      Convenience method that obtains a literal typed as an integer.
      Parameters:
      value - The value of the literal
      Returns:
      An OWLLiteral whose literal is the lexical value of the integer, and whose data type is xsd:integer.
    • getOWLLiteral

      OWLLiteral getOWLLiteral(double value)
      Convenience method that obtains a literal typed as a double.
      Parameters:
      value - The value of the literal
      Returns:
      An OWLLiteral whose literal is the lexical value of the double, and whose data type is xsd:double.
    • getOWLLiteral

      OWLLiteral getOWLLiteral(boolean value)
      Convenience method that obtains a literal typed as a boolean.
      Parameters:
      value - The value of the literal
      Returns:
      An OWLLiteral whose literal is the lexical value of the boolean, and whose data type is xsd:boolean.
    • getOWLLiteral

      OWLLiteral getOWLLiteral(float value)
      Convenience method that obtains a literal typed as a float.
      Parameters:
      value - The value of the literal
      Returns:
      An OWLLiteral whose literal is the lexical value of the float, and whose data type is xsd:float.
    • getOWLLiteral

      OWLLiteral getOWLLiteral(String value)
      Gets a literal that has the specified lexical value, and has the datatype xsd:string. The literal will not have a language tag.
      Parameters:
      value - The lexical value of the literal.
      Returns:
      A literal (without a language tag) that has a datatype of xsd:string.
    • getOWLLiteral

      OWLLiteral getOWLLiteral(String literal, @Nullable String lang)
      Gets an OWLLiteral with a language tag. The datatype of this literal will have an IRI of rdf:PlainLiteral ( OWLRDFVocabulary.RDF_PLAIN_LITERAL).
      Parameters:
      literal - The string literal.
      lang - The language tag. The empty string may be specified to indicate an empty language tag. Leading and trailing white space will be removed from the tag and the tag will be normalised to LOWER CASE. If lang is null then lang will be converted to the empty string (for backwards compatibility). If not empty, the tag is formed according to BCP47 but the OWL API will not check that the tag conforms to this specification - it is up to the caller to ensure this.
      Returns:
      The OWLLiteral that represents the string literal with a (possibly empty) language tag.