Package org.eclipse.rdf4j.model.base
Class AbstractValueFactory
- java.lang.Object
-
- org.eclipse.rdf4j.model.base.AbstractValueFactory
-
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
MemValueFactory,SimpleValueFactory
public abstract class AbstractValueFactory extends Object implements ValueFactory
Base class forValueFactory, offering common functionality.- Since:
- 3.5.0
- Author:
- Alessandro Bollini
-
-
Constructor Summary
Constructors Constructor Description AbstractValueFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BNodecreateBNode()Creates a new bNode.BNodecreateBNode(String nodeID)Creates a new blank node with the given node identifier.IRIcreateIRI(String iri)Creates a new IRI from the supplied string-representation.IRIcreateIRI(String namespace, String localName)Creates a new IRI from the supplied namespace and local name.LiteralcreateLiteral(boolean value)Creates a new xsd:boolean-typed literal representing the specified value.LiteralcreateLiteral(byte value)Creates a new xsd:byte-typed literal representing the specified value.LiteralcreateLiteral(double value)Creates a new xsd:double-typed literal representing the specified value.LiteralcreateLiteral(float value)Creates a new xsd:float-typed literal representing the specified value.LiteralcreateLiteral(int value)Creates a new xsd:int-typed literal representing the specified value.LiteralcreateLiteral(long value)Creates a new xsd:long-typed literal representing the specified value.LiteralcreateLiteral(short value)Creates a new xsd:short-typed literal representing the specified value.LiteralcreateLiteral(String label)Creates a new literal with the supplied label.LiteralcreateLiteral(String label, String language)Creates a new literal with the supplied label and language attribute.LiteralcreateLiteral(String label, CoreDatatype datatype)Creates a new literal with the supplied label and datatype.LiteralcreateLiteral(String label, IRI datatype)Creates a new literal with the supplied label and datatype.LiteralcreateLiteral(String label, IRI datatype, CoreDatatype coreDatatype)Creates a new literal with the supplied label and datatype.LiteralcreateLiteral(BigDecimal bigDecimal)Creates a new literal representing the specified bigDecimal that is typed as an xsd:decimal.LiteralcreateLiteral(BigInteger bigInteger)Creates a new literal representing the specified bigInteger that is typed as an xsd:integer.LiteralcreateLiteral(TemporalAccessor value)Creates a new literal representing a temporal accessor value.LiteralcreateLiteral(TemporalAmount value)Creates a new literal representing a temporal amount value.LiteralcreateLiteral(Date date)Creates a new literal representing the specified date that is typed using the appropriate XML Schema date/time datatype.LiteralcreateLiteral(XMLGregorianCalendar calendar)Creates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.StatementcreateStatement(Resource subject, IRI predicate, Value object)Creates a new statement with the supplied subject, predicate and object.StatementcreateStatement(Resource subject, IRI predicate, Value object, Resource context)Creates a new statement with the supplied subject, predicate and object and associated context.TriplecreateTriple(Resource subject, IRI predicate, Value object)Creates a new RDF-star triple with the supplied subject, predicate and object.
-
-
-
Method Detail
-
createBNode
public BNode createBNode()
Description copied from interface:ValueFactoryCreates a new bNode.- Specified by:
createBNodein interfaceValueFactory- Returns:
- An object representing the bNode.
-
createBNode
public BNode createBNode(String nodeID)
Description copied from interface:ValueFactoryCreates a new blank node with the given node identifier.- Specified by:
createBNodein interfaceValueFactory- Parameters:
nodeID- The blank node identifier.- Returns:
- An object representing the blank node.
-
createIRI
public IRI createIRI(String iri)
Description copied from interface:ValueFactoryCreates a new IRI from the supplied string-representation.- Specified by:
createIRIin interfaceValueFactory- Parameters:
iri- A string-representation of a IRI.- Returns:
- An object representing the IRI.
-
createIRI
public IRI createIRI(String namespace, String localName)
Description copied from interface:ValueFactoryCreates 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:
createIRIin interfaceValueFactory- Parameters:
namespace- The IRI's namespace.localName- The IRI's local name.
-
createLiteral
public Literal createLiteral(String label)
Description copied from interface:ValueFactoryCreates a new literal with the supplied label. The return value ofLiteral.getDatatype()for the returned object must bexsd:string.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
label- The literal's label, must not be null.- Returns:
- A literal for the specified value.
-
createLiteral
public Literal createLiteral(String label, IRI datatype)
Description copied from interface:ValueFactoryCreates a new literal with the supplied label and datatype.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
label- The literal's label, must not be null.datatype- The literal's datatype. If it is null, the datatypexsd:stringwill be assigned to this literal.- Returns:
- A literal for the specified value and type.
-
createLiteral
public Literal createLiteral(String label, CoreDatatype datatype)
Description copied from interface:ValueFactoryCreates a new literal with the supplied label and datatype.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
label- The literal's label, must not be null.datatype- The literal's datatype. It may not be null.
-
createLiteral
public Literal createLiteral(String label, IRI datatype, CoreDatatype coreDatatype)
Description copied from interface:ValueFactoryCreates a new literal with the supplied label and datatype.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
label- The literal's label, must not be null.datatype- The literal's datatype. If it is null, the datatypexsd:stringwill be assigned to this literal.
-
createLiteral
public Literal createLiteral(String label, String language)
Description copied from interface:ValueFactoryCreates a new literal with the supplied label and language attribute. The return value ofLiteral.getDatatype()for the returned object must berdf:langString.- Specified by:
createLiteralin 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.
-
createLiteral
public Literal createLiteral(boolean value)
Description copied from interface:ValueFactoryCreates a new xsd:boolean-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:boolean-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(byte value)
Description copied from interface:ValueFactoryCreates a new xsd:byte-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:byte-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(short value)
Description copied from interface:ValueFactoryCreates a new xsd:short-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:short-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(int value)
Description copied from interface:ValueFactoryCreates a new xsd:int-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:int-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(long value)
Description copied from interface:ValueFactoryCreates a new xsd:long-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:long-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(float value)
Description copied from interface:ValueFactoryCreates a new xsd:float-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:float-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(double value)
Description copied from interface:ValueFactoryCreates a new xsd:double-typed literal representing the specified value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- The value for the literal.- Returns:
- An xsd:double-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(BigInteger bigInteger)
Description copied from interface:ValueFactoryCreates a new literal representing the specified bigInteger that is typed as an xsd:integer.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
bigInteger- The value for the literal.- Returns:
- An xsd:integer-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(BigDecimal bigDecimal)
Description copied from interface:ValueFactoryCreates a new literal representing the specified bigDecimal that is typed as an xsd:decimal.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
bigDecimal- The value for the literal.- Returns:
- An xsd:decimal-typed literal for the specified value.
-
createLiteral
public Literal createLiteral(TemporalAccessor value)
Description copied from interface:ValueFactoryCreates a new literal representing a temporal accessor value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- the temporal accessor value for the literal- Returns:
- a literal representing the specified temporal accessor
valuewith the appropriate XML Schema date/time datatype
-
createLiteral
public Literal createLiteral(TemporalAmount value)
Description copied from interface:ValueFactoryCreates a new literal representing a temporal amount value.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
value- the temporal amount value for the literal- Returns:
- a literal representing the specified temporal amount
valuewith the appropriate XML Schema duration datatype
-
createLiteral
public Literal createLiteral(XMLGregorianCalendar calendar)
Description copied from interface:ValueFactoryCreates a new literal representing the specified calendar that is typed using the appropriate XML Schema date/time datatype.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
calendar- The value for the literal.- Returns:
- A typed literal for the specified calendar.
-
createLiteral
public Literal createLiteral(Date date)
Description copied from interface:ValueFactoryCreates a new literal representing the specified date that is typed using the appropriate XML Schema date/time datatype.- Specified by:
createLiteralin interfaceValueFactory- Parameters:
date- The value for the literal.- Returns:
- A typed literal for the specified date.
-
createTriple
public Triple createTriple(Resource subject, IRI predicate, Value object)
Description copied from interface:ValueFactoryCreates a new RDF-star triple with the supplied subject, predicate and object.- Specified by:
createTriplein interfaceValueFactory- Parameters:
subject- The statement's subject.predicate- The statement's predicate.object- The statement's object.- Returns:
- The created triple.
-
createStatement
public Statement createStatement(Resource subject, IRI predicate, Value object)
Description copied from interface:ValueFactoryCreates a new statement with the supplied subject, predicate and object.- Specified by:
createStatementin interfaceValueFactory- Parameters:
subject- The statement's subject.predicate- The statement's predicate.object- The statement's object.- Returns:
- The created statement.
-
createStatement
public Statement createStatement(Resource subject, IRI predicate, Value object, Resource context)
Description copied from interface:ValueFactoryCreates a new statement with the supplied subject, predicate and object and associated context.- Specified by:
createStatementin 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.
-
-