public class KiWiValueFactory extends Object implements org.openrdf.model.ValueFactory
Constructor and Description |
---|
KiWiValueFactory(KiWiStore store,
String defaultContext) |
Modifier and Type | Method and Description |
---|---|
protected KiWiConnection |
aqcuireConnection() |
void |
close() |
KiWiResource |
convert(org.openrdf.model.Resource r) |
KiWiUriResource |
convert(org.openrdf.model.URI r) |
KiWiNode |
convert(org.openrdf.model.Value value) |
org.openrdf.model.BNode |
createBNode()
Creates a new bNode.
|
org.openrdf.model.BNode |
createBNode(String nodeID)
Creates a new blank node with the given node identifier.
|
org.openrdf.model.Literal |
createLiteral(boolean value)
Creates a new xsd:boolean-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(byte value)
Creates a new xsd:byte-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(Date date)
Creates a new literal representing the specified date that is typed using
the appropriate XML Schema date/time datatype.
|
org.openrdf.model.Literal |
createLiteral(double value)
Creates a new xsd:double-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(float value)
Creates a new xsd:float-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(int value)
Creates a new xsd:int-typed literal representing the specified
value.
|
org.openrdf.model.Literal |
createLiteral(long value)
Creates a new xsd:long-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(Object object)
Creates a typed
Literal out of the supplied object, mapping the
runtime type of the object to the appropriate XML Schema type. |
org.openrdf.model.Literal |
createLiteral(short value)
Creates a new xsd:short-typed literal representing the
specified value.
|
org.openrdf.model.Literal |
createLiteral(String label)
Creates a new literal with the supplied label.
|
org.openrdf.model.Literal |
createLiteral(String label,
String language)
Creates a new literal with the supplied label and language attribute.
|
org.openrdf.model.Literal |
createLiteral(String label,
org.openrdf.model.URI datatype)
Creates a new literal with the supplied label and datatype.
|
org.openrdf.model.Literal |
createLiteral(XMLGregorianCalendar calendar)
Creates a new literal representing the specified calendar that is typed
using the appropriate XML Schema date/time datatype.
|
org.openrdf.model.Statement |
createStatement(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object)
Creates a new statement with the supplied subject, predicate and object.
|
org.openrdf.model.Statement |
createStatement(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.openrdf.model.Resource context)
Creates a new statement with the supplied subject, predicate and object
and associated context.
|
org.openrdf.model.Statement |
createStatement(org.openrdf.model.Resource subject,
org.openrdf.model.URI predicate,
org.openrdf.model.Value object,
org.openrdf.model.Resource context,
KiWiConnection connection)
Creates a new statement with the supplied subject, predicate and object and associated context.
|
org.openrdf.model.URI |
createURI(String uri)
Creates a new URI from the supplied string-representation.
|
org.openrdf.model.URI |
createURI(String namespace,
String localName)
Creates a new URI from the supplied namespace and local name.
|
protected void |
releaseConnection(KiWiConnection con) |
protected void |
releaseRegistry(KiWiConnection connection) |
protected void |
removeStatement(KiWiTriple triple)
Remove a statement from the triple registry.
|
protected KiWiConnection aqcuireConnection()
protected void releaseConnection(KiWiConnection con)
public org.openrdf.model.BNode createBNode()
createBNode
in interface org.openrdf.model.ValueFactory
public org.openrdf.model.URI createURI(String uri)
createURI
in interface org.openrdf.model.ValueFactory
uri
- A string-representation of a URI.public org.openrdf.model.URI createURI(String namespace, String localName)
createURI(namespace+localName)
, but allows the
ValueFactory to reuse supplied namespace and local name strings whenever
possible. Note that the values returned by URI.getNamespace()
and
URI.getLocalName()
are not necessarily the same as the values that
are supplied to this method.createURI
in interface org.openrdf.model.ValueFactory
namespace
- The URI's namespace.localName
- The URI's local name.IllegalArgumentException
- If the supplied namespace and localname do not resolve to a legal
(absolute) URI.public org.openrdf.model.BNode createBNode(String nodeID)
createBNode
in interface org.openrdf.model.ValueFactory
nodeID
- The blank node identifier.public org.openrdf.model.Literal createLiteral(Date date)
createLiteral
in interface org.openrdf.model.ValueFactory
public org.openrdf.model.Literal createLiteral(Object object)
Literal
out of the supplied object, mapping the
runtime type of the object to the appropriate XML Schema type. If no
mapping is available, the method returns a literal with the string
representation of the supplied object as the value, and
XMLSchema.STRING
as the datatype. Recognized types are
Boolean
, Byte
, Double
, Float
,
Integer
, Long
, Short
, XMLGregorianCalendar
, and Date
.object
- an object to be converted to a typed literal.public org.openrdf.model.Literal createLiteral(String label)
createLiteral
in interface org.openrdf.model.ValueFactory
label
- The literal's label.public org.openrdf.model.Literal createLiteral(String label, String language)
createLiteral
in interface org.openrdf.model.ValueFactory
label
- The literal's label.language
- The literal's language attribute, or null if the literal
doesn't have a language.public org.openrdf.model.Literal createLiteral(String label, org.openrdf.model.URI datatype)
createLiteral
in interface org.openrdf.model.ValueFactory
label
- The literal's label.datatype
- The literal's datatype, or null if the literal doesn't
have a datatype.public org.openrdf.model.Literal createLiteral(boolean value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(byte value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(short value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(int value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(long value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(float value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(double value)
createLiteral
in interface org.openrdf.model.ValueFactory
value
- The value for the literal.public org.openrdf.model.Literal createLiteral(XMLGregorianCalendar calendar)
createLiteral
in interface org.openrdf.model.ValueFactory
calendar
- The value for the literal.public org.openrdf.model.Statement createStatement(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object)
createStatement
in interface org.openrdf.model.ValueFactory
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.public org.openrdf.model.Statement createStatement(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource context)
createStatement
in interface org.openrdf.model.ValueFactory
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.context
- The statement's context.public org.openrdf.model.Statement createStatement(org.openrdf.model.Resource subject, org.openrdf.model.URI predicate, org.openrdf.model.Value object, org.openrdf.model.Resource context, KiWiConnection connection)
subject
- The statement's subject.predicate
- The statement's predicate.object
- The statement's object.context
- The statement's context.protected void removeStatement(KiWiTriple triple)
triple
- protected void releaseRegistry(KiWiConnection connection)
public KiWiResource convert(org.openrdf.model.Resource r)
public KiWiUriResource convert(org.openrdf.model.URI r)
public KiWiNode convert(org.openrdf.model.Value value)
public void close()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.