public class BigdataValueFactoryImpl extends Object implements BigdataValueFactory
BigdataValues and BigdataStatements.
Values constructed using this factory do NOT have term identifiers assigned.
Statements constructed using this factory do NOT have statement identifiers
assigned. Those metadata can be resolved against the various indices and then
set on the returned values and statements.| Modifier and Type | Field and Description |
|---|---|
static String |
NAMESPACE_XSD |
static String |
xsd |
| Constructor and Description |
|---|
BigdataValueFactoryImpl()
WARNING: Use
getInstance(String) NOT this constructor. |
| Modifier and Type | Method and Description |
|---|---|
BigdataBNode |
asValue(org.openrdf.model.BNode v)
Strongly typed for
BNodes. |
BigdataLiteral |
asValue(org.openrdf.model.Literal v)
Strongly typed for
Literals. |
BigdataResource |
asValue(org.openrdf.model.Resource v)
Strongly typed for
Resources. |
BigdataURI |
asValue(org.openrdf.model.URI v)
Strongly typed for
URIs. |
BigdataValue |
asValue(org.openrdf.model.Value v)
Converts a
Value into a BigdataValue. |
BigdataBNodeImpl |
createBNode()
Returns a new blank node with a globally unique blank node ID based on a
UUID. |
BigdataBNodeImpl |
createBNode(BigdataStatement stmt) |
BigdataBNodeImpl |
createBNode(String id) |
BigdataLiteralImpl |
createLiteral(boolean arg0) |
BigdataLiteralImpl |
createLiteral(byte arg0) |
BigdataLiteralImpl |
createLiteral(byte arg0,
boolean unsigned) |
BigdataLiteralImpl |
createLiteral(Date date) |
BigdataLiteralImpl |
createLiteral(double arg0) |
BigdataLiteralImpl |
createLiteral(float arg0) |
BigdataLiteralImpl |
createLiteral(int arg0) |
BigdataLiteralImpl |
createLiteral(int arg0,
boolean unsigned) |
BigdataLiteralImpl |
createLiteral(long arg0) |
BigdataLiteralImpl |
createLiteral(long arg0,
boolean unsigned) |
BigdataLiteralImpl |
createLiteral(short arg0) |
BigdataLiteralImpl |
createLiteral(short arg0,
boolean unsigned) |
BigdataLiteralImpl |
createLiteral(String label) |
BigdataLiteralImpl |
createLiteral(String label,
String language) |
BigdataLiteralImpl |
createLiteral(String label,
org.openrdf.model.URI datatype) |
BigdataLiteralImpl |
createLiteral(String label,
org.openrdf.model.URI datatype,
String language) |
BigdataLiteralImpl |
createLiteral(XMLGregorianCalendar arg0) |
BigdataStatementImpl |
createStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Create a statement whose
StatementEnum is NOT specified. |
BigdataStatementImpl |
createStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Create a statement whose
StatementEnum is NOT specified. |
BigdataStatementImpl |
createStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c,
StatementEnum type)
Create a statement (core impl).
|
BigdataStatementImpl |
createStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c,
StatementEnum type,
boolean userFlag)
Create a statement (core impl).
|
BigdataURIImpl |
createURI(String uriString) |
BigdataURIImpl |
createURI(String namespace,
String localName) |
BigdataLiteralImpl |
createXSDDateTime(long timestamp) |
static BigdataValueFactory |
getInstance(String namespace)
Return the instance associated with the namespace.
|
String |
getNamespace()
The namespace of the KB instance associated with the value factory.
|
BigdataValueSerializer<BigdataValue> |
getValueSerializer()
An object that can efficiently (de-)serialize
Values using this
ValueFactory. |
BNodeContextFactory |
newBNodeContext()
Returns a factory that will assign its blank node IDs within a globally
unique namespace.
|
protected String |
nextID()
Returns a blank node identifier (ID) based on a random
UUID. |
void |
remove()
Remove a
BigdataValueFactoryImpl from the canonicalizing mapping. |
String |
toString() |
public static final transient String NAMESPACE_XSD
public static final transient String xsd
public BigdataValueFactoryImpl()
getInstance(String) NOT this constructor.
WARNING: This constructor provides 'headless' (not associated with any
namespace) instance of the BigdataValueFactory, which is used for
query/update parsing. It SHOULD NOT be used in code working with
triple-store.
(remove "headless" BigdataValueFactory impl class),
(SPARQL Query/Update parser should not use db connection)public String getNamespace()
BigdataValueFactorygetNamespace in interface BigdataValueFactorypublic static BigdataValueFactory getInstance(String namespace)
Note: This canonicalizing mapping for BigdataValueFactoryImpls is
based on the namespace of the LexiconRelation. This makes the
instances canonical within a JVM instance, which is all that we care
about. The actual assignments of term identifiers to BigdataValue
s is performed by the LexiconRelation itself and is globally
consistent for a given lexicon.
namespace - The namespace of the LexiconRelation.
TODO This method introduces the possibility that two journals
in the same JVM would share the same
BigdataValueFactory for a kb with the same namespace.
This is doubtless not desired. A workaround is to use the
UUID of the Journal as part of the namespace of the
KB, which would serve to make sure that all KB instances have
distinct namespaces.public void remove()
BigdataValueFactoryImpl from the canonicalizing mapping.
Entries in this canonicalizing mapping for a LexiconRelation MUST
be #remove(String)ed if the LexiconRelation is destroyed
in case a distinct lexicon is subsequently creating with the same
namespace. There is no need to discard an entry during abort processing.
remove in interface BigdataValueFactorypublic BNodeContextFactory newBNodeContext()
BigdataValueFactoryBigdataValues are
actually created by this factory, it is only the semantics of
blank node ID generation that are overridden.newBNodeContext in interface BigdataValueFactoryBNodeContextFactorypublic BigdataBNodeImpl createBNode()
UUID.
Note: Since the blank node IDs are random, they tend to be uniformly
distributed across the index partition(s). More efficient ordered writes
may be realized using newBNodeContext() to obtain a derived
BigdataValueFactory instance that is specific to a document that
is being loaded into the RDF DB.
createBNode in interface BigdataValueFactorycreateBNode in interface org.openrdf.model.ValueFactorynewBNodeContext()public BigdataBNodeImpl createBNode(String id)
createBNode in interface BigdataValueFactorycreateBNode in interface org.openrdf.model.ValueFactorypublic BigdataBNodeImpl createBNode(BigdataStatement stmt)
createBNode in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(String label)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(boolean arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(byte arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(byte arg0, boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(short arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(short arg0, boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(int arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(int arg0, boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(long arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(long arg0, boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(float arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(double arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(Date date)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(XMLGregorianCalendar arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createXSDDateTime(long timestamp)
createXSDDateTime in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(String label, String language)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(String label, org.openrdf.model.URI datatype)
createLiteral in interface BigdataValueFactorycreateLiteral in interface org.openrdf.model.ValueFactorypublic BigdataLiteralImpl createLiteral(String label, org.openrdf.model.URI datatype, String language)
createLiteral in interface BigdataValueFactorypublic BigdataURIImpl createURI(String uriString)
createURI in interface BigdataValueFactorycreateURI in interface org.openrdf.model.ValueFactorypublic BigdataURIImpl createURI(String namespace, String localName)
createURI in interface BigdataValueFactorycreateURI in interface org.openrdf.model.ValueFactorypublic BigdataStatementImpl createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
BigdataValueFactoryStatementEnum is NOT specified.createStatement in interface BigdataValueFactorycreateStatement in interface org.openrdf.model.ValueFactorypublic BigdataStatementImpl createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
BigdataValueFactoryStatementEnum is NOT specified.createStatement in interface BigdataValueFactorycreateStatement in interface org.openrdf.model.ValueFactorypublic BigdataStatementImpl createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c, StatementEnum type)
BigdataValueFactoryBigdataValueFactory using
BigdataValueFactory.asValue(Value).createStatement in interface BigdataValueFactorys - The subject.p - The predicate.o - The object.c - The context (optional). Note: When non-null
and statement identifiers are enabled, then this will be a
blank node whose term identifier is the statement identifier.type - The statement type (optional).public BigdataStatementImpl createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c, StatementEnum type, boolean userFlag)
BigdataValueFactoryBigdataValueFactory using
BigdataValueFactory.asValue(Value).createStatement in interface BigdataValueFactorys - The subject.p - The predicate.o - The object.c - The context (optional). Note: When non-null
and statement identifiers are enabled, then this will be a
blank node whose term identifier is the statement identifier.type - The statement type (optional).userFlag - The user flagpublic final BigdataValue asValue(org.openrdf.model.Value v)
BigdataValueFactoryValue into a BigdataValue. If the value is
already a BigdataValue and it was allocated by this
BigdataValueFactoryImpl then it is returned unchanged. Otherwise a
new BigdataValue will be creating using the same data as the
given value and the term identifier on the new BigdataValue will
be initialized to IRawTripleStore#NULL.
All BigdataValues created by a BigdataValueFactoryImpl
internally store a transient reference to the BigdataValueFactoryImpl.
This reference is used to decide if a BigdataValue MIGHT have
been created by a different lexicon (term identifiers generated by
different lexicons CAN NOT be used interchangeably). This has the effect
of protecting against incorrect use of the term identifier with a
database backed by a different lexicon while allowing reuse of the
BigdataValues when possible.
asValue in interface BigdataValueFactoryv - The value.BigdataValue with the same data. If the value is
null then null is returned.public BigdataValueSerializer<BigdataValue> getValueSerializer()
BigdataValueFactoryValues using this
ValueFactory. When the values are de-serialized they will have a
reference to this BigdataValueFactoryImpl. That reference can be
used to identify when two BigdataValues MIGHT be from different
lexicons.getValueSerializer in interface BigdataValueFactorypublic BigdataResource asValue(org.openrdf.model.Resource v)
BigdataValueFactoryResources.asValue in interface BigdataValueFactorypublic BigdataURI asValue(org.openrdf.model.URI v)
BigdataValueFactoryURIs.asValue in interface BigdataValueFactorypublic BigdataLiteral asValue(org.openrdf.model.Literal v)
BigdataValueFactoryLiterals.asValue in interface BigdataValueFactorypublic BigdataBNode asValue(org.openrdf.model.BNode v)
BigdataValueFactoryBNodes.asValue in interface BigdataValueFactoryCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.