java.lang.Object
org.apache.jena.graph.impl.LiteralLabelFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LiteralLabel
Build a plain literal label from its lexical form and language tag.static LiteralLabel
Creates either a plain literal or an XMLLiteral.static LiteralLabel
create
(String lex, RDFDatatype dtype) Create a literal with a dtype.static LiteralLabel
createByValue
(Object value, String lang, RDFDatatype dtype) Build a typed literal label from its value form.static LiteralLabel
createLiteralLabel
(String lex, String lang, RDFDatatype dtype) Usingcreate(String, String)
orcreate(String, RDFDatatype)
where possible is preferred.static LiteralLabel
createTypedLiteral
(Object value) Build a typed literal label from its value form using whatever datatype is currently registered as the default representation for this java class.
-
Constructor Details
-
LiteralLabelFactory
public LiteralLabelFactory()
-
-
Method Details
-
create
Create a literal with a dtype. -
createLiteralLabel
public static LiteralLabel createLiteralLabel(String lex, String lang, RDFDatatype dtype) throws DatatypeFormatException Usingcreate(String, String)
orcreate(String, RDFDatatype)
where possible is preferred.- Throws:
DatatypeFormatException
-
create
Build a plain literal label from its lexical form and language tag.- Parameters:
lex
- the lexical form of the literallang
- the optional language tag, only relevant for plain literals
-
createByValue
public static LiteralLabel createByValue(Object value, String lang, RDFDatatype dtype) throws DatatypeFormatException Build a typed literal label from its value form. If the value is a string we assume this is intended to be a lexical form after all.- Parameters:
value
- the value of the literallang
- the optional language tag, only relevant for plain literalsdtype
- the type of the literal, null for old style "plain" literals (which become xsd:string in RDF 1.1)- Throws:
DatatypeFormatException
-
createTypedLiteral
Build a typed literal label from its value form using whatever datatype is currently registered as the default representation for this java class. No language tag is supplied. A plain string becomes an xsd:string.- Parameters:
value
- the literal value to encapsulate
-
create
Creates either a plain literal or an XMLLiteral.- Parameters:
xml
- If true then s is exclusive canonical XML of type rdf:XMLLiteral, and no checking will be invoked.
-