Package org.eclipse.rdf4j.model.impl
Class ValidatingValueFactory
java.lang.Object
org.eclipse.rdf4j.model.impl.ValidatingValueFactory
- All Implemented Interfaces:
ValueFactory
Validating wrapper to
ValueFactory
. Use this class in situations where a caller may be prone to errors.- Author:
- James Leigh
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new bNode.createBNode
(String nodeID) Creates a new blank node with the given node identifier.Creates a new IRI from the supplied string-representation.Creates a new IRI from the supplied namespace and local name.createLiteral
(boolean value) Creates a new xsd:boolean-typed literal representing the specified value.createLiteral
(byte value) Creates a new xsd:byte-typed literal representing the specified value.createLiteral
(double value) Creates a new xsd:double-typed literal representing the specified value.createLiteral
(float value) Creates a new xsd:float-typed literal representing the specified value.createLiteral
(int value) Creates a new xsd:int-typed literal representing the specified value.createLiteral
(long value) Creates a new xsd:long-typed literal representing the specified value.createLiteral
(short value) Creates a new xsd:short-typed literal representing the specified value.createLiteral
(String label) Creates a new literal with the supplied label.createLiteral
(String label, String language) Creates a new literal with the supplied label and language attribute.createLiteral
(String label, CoreDatatype datatype) Creates a new literal with the supplied label and datatype.createLiteral
(String label, IRI datatype) Creates a new literal with the supplied label and datatype.createLiteral
(String label, IRI datatype, CoreDatatype coreDatatype) Creates a new literal with the supplied label and datatype.createLiteral
(BigDecimal bigDecimal) Creates a new literal representing the specified bigDecimal that is typed as an xsd:decimal.createLiteral
(BigInteger bigInteger) Creates a new literal representing the specified bigInteger that is typed as an xsd:integer.createLiteral
(TemporalAccessor value) Creates a new literal representing a temporal accessor value.createLiteral
(TemporalAmount value) Creates a new literal representing a temporal amount value.createLiteral
(Date date) Creates a new literal representing the specified date that is typed using the appropriate XML Schema date/time datatype.createLiteral
(XMLGregorianCalendar calendar) Creates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.createStatement
(Resource subject, IRI predicate, Value object) Creates a new statement with the supplied subject, predicate and object.createStatement
(Resource subject, IRI predicate, Value object, Resource context) Creates a new statement with the supplied subject, predicate and object and associated context.createTriple
(Resource subject, IRI predicate, Value object) Creates a new RDF-star triple with the supplied subject, predicate and object.
-
Constructor Details
-
ValidatingValueFactory
public ValidatingValueFactory() -
ValidatingValueFactory
-
-
Method Details
-
createIRI
Description copied from interface:ValueFactory
Creates a new IRI from the supplied string-representation.- Specified by:
createIRI
in interfaceValueFactory
- Parameters:
iri
- A string-representation of a IRI.- Returns:
- An object representing the IRI.
-
createIRI
Description copied from interface:ValueFactory
Creates a new IRI from the supplied namespace and local name. Calling this method is funtionally equivalent to callingcreateIRI(namespace+localName)
, but allows the ValueFactory to reuse supplied namespace and local name strings whenever possible. Note that the values returned byIRI.getNamespace()
andIRI.getLocalName()
are not necessarily the same as the values that are supplied to this method.- Specified by:
createIRI
in interfaceValueFactory
- Parameters:
namespace
- The IRI's namespace.localName
- The IRI's local name.
-
createBNode
Description copied from interface:ValueFactory
Creates a new blank node with the given node identifier.- Specified by:
createBNode
in interfaceValueFactory
- Parameters:
nodeID
- The blank node identifier.- Returns:
- An object representing the blank node.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal with the supplied label and datatype.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
label
- The literal's label, must not be null.datatype
- The literal's datatype. If it is null, the datatypexsd:string
will be assigned to this literal.- Returns:
- A literal for the specified value and type.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal with the supplied label and datatype.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
label
- The literal's label, must not be null.datatype
- The literal's datatype. It may not be null.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal with the supplied label and datatype.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
label
- The literal's label, must not be null.datatype
- The literal's datatype. If it is null, the datatypexsd:string
will be assigned to this literal.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal with the supplied label and language attribute. The return value ofLiteral.getDatatype()
for the returned object must berdf:langString
.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
label
- The literal's label, must not be null.language
- The literal's language attribute, must not be null.- Returns:
- A literal for the specified value and language attribute.
-
createBNode
Description copied from interface:ValueFactory
Creates a new bNode.- Specified by:
createBNode
in interfaceValueFactory
- Returns:
- An object representing the bNode.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal with the supplied label. The return value ofLiteral.getDatatype()
for the returned object must bexsd:string
.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
label
- The literal's label, must not be null.- Returns:
- A literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:boolean-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:boolean-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:byte-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:byte-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:short-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:short-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:int-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:int-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:long-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:long-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:float-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:float-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new xsd:double-typed literal representing the specified value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- The value for the literal.- Returns:
- An xsd:double-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing the specified bigDecimal that is typed as an xsd:decimal.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
bigDecimal
- The value for the literal.- Returns:
- An xsd:decimal-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing the specified bigInteger that is typed as an xsd:integer.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
bigInteger
- The value for the literal.- Returns:
- An xsd:integer-typed literal for the specified value.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing a temporal accessor value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- the temporal accessor value for the literal- Returns:
- a literal representing the specified temporal accessor
value
with the appropriate XML Schema date/time datatype
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing a temporal amount value.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
value
- the temporal amount value for the literal- Returns:
- a literal representing the specified temporal amount
value
with the appropriate XML Schema duration datatype
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
calendar
- The value for the literal.- Returns:
- A typed literal for the specified calendar.
-
createLiteral
Description copied from interface:ValueFactory
Creates a new literal representing the specified date that is typed using the appropriate XML Schema date/time datatype.- Specified by:
createLiteral
in interfaceValueFactory
- Parameters:
date
- The value for the literal.- Returns:
- A typed literal for the specified date.
-
createStatement
Description copied from interface:ValueFactory
Creates a new statement with the supplied subject, predicate and object.- Specified by:
createStatement
in interfaceValueFactory
- Parameters:
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.- Returns:
- The created statement.
-
createStatement
Description copied from interface:ValueFactory
Creates a new statement with the supplied subject, predicate and object and associated context.- Specified by:
createStatement
in interfaceValueFactory
- Parameters:
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.context
- The statement's context.- Returns:
- The created statement.
-
createTriple
Description copied from interface:ValueFactory
Creates a new RDF-star triple with the supplied subject, predicate and object.- Specified by:
createTriple
in interfaceValueFactory
- Parameters:
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.- Returns:
- The created triple.
-