Interface LiteralProvider
- All Superinterfaces:
DatatypeProvider
,Serializable
- All Known Subinterfaces:
AnnotationAssertionProvider
,ClassAssertionProvider
,DataAssertionProvider
,DatatypeExpressionProvider
,IndividualAssertionProvider
,ObjectAssertionProvider
,OWLDataFactory
Provider for OWLLiteral construction.
-
Method Summary
Modifier and TypeMethodDescriptiongetOWLLiteral
(boolean value) Convenience method that obtains a literal typed as a boolean.getOWLLiteral
(double value) Convenience method that obtains a literal typed as a double.getOWLLiteral
(float value) Convenience method that obtains a literal typed as a float.getOWLLiteral
(int value) Convenience method that obtains a literal typed as an integer.getOWLLiteral
(String value) Gets a literal that has the specified lexical value, and has the datatype xsd:string.getOWLLiteral
(String literal, String lang) Gets an OWLLiteral with a language tag.getOWLLiteral
(String lexicalValue, OWLDatatype datatype) Gets anOWLLiteral
, which has the specified lexical value, and is typed with the specified datatype.default OWLLiteral
getOWLLiteral
(String lexicalValue, OWL2Datatype datatype) Gets anOWLLiteral
, which has the specified lexical value, and is typed with the specified datatype.Methods inherited from interface org.semanticweb.owlapi.model.providers.DatatypeProvider
getOWLDatatype, getOWLDatatype, getOWLDatatype, getOWLDatatype, getOWLDatatype
-
Method Details
-
getOWLLiteral
Gets anOWLLiteral
, 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
Gets anOWLLiteral
, 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
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
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
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
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
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
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. Iflang
isnull
thenlang
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.
-