public class BNodeContextFactory extends Object implements BigdataValueFactory
UUID
, which is how we ensure that blank nodes generated for different
sources are understood as distinct blank nodes by the database (this is
required).
Note: All BigdataValue
instances are in fact created by the delegate
instances created by this class and by the delegate will appear to have been
created by the same factory. This is intentional - it makes the instances
reusable by the base factory.
Note: nextID()
is NOT thread-safe, but different documents that are
being passed concurrently will have a distinct instance of this factory and
processing a single document is generally single-threaded.
Constructor and Description |
---|
BNodeContextFactory(BigdataValueFactory valueFactory) |
Modifier and Type | Method and Description |
---|---|
BigdataBNode |
asValue(org.openrdf.model.BNode v)
Strongly typed for
BNode s. |
BigdataLiteral |
asValue(org.openrdf.model.Literal v)
Strongly typed for
Literal s. |
BigdataResource |
asValue(org.openrdf.model.Resource v)
Strongly typed for
Resource s. |
BigdataURI |
asValue(org.openrdf.model.URI v)
Strongly typed for
URI s. |
BigdataValue |
asValue(org.openrdf.model.Value v)
Converts a
Value into a BigdataValue . |
BigdataBNode |
createBNode() |
BigdataBNode |
createBNode(BigdataStatement stmt) |
BigdataBNode |
createBNode(String id) |
BigdataLiteral |
createLiteral(boolean arg0) |
BigdataLiteral |
createLiteral(byte arg0) |
BigdataLiteral |
createLiteral(byte arg0,
boolean unsigned) |
BigdataLiteral |
createLiteral(Date arg0) |
BigdataLiteral |
createLiteral(double arg0) |
BigdataLiteral |
createLiteral(float arg0) |
BigdataLiteral |
createLiteral(int arg0) |
BigdataLiteral |
createLiteral(int arg0,
boolean unsigned) |
BigdataLiteral |
createLiteral(long arg0) |
BigdataLiteral |
createLiteral(long arg0,
boolean unsigned) |
BigdataLiteral |
createLiteral(short arg0) |
BigdataLiteral |
createLiteral(short arg0,
boolean unsigned) |
BigdataLiteral |
createLiteral(String label) |
BigdataLiteral |
createLiteral(String label,
String language) |
BigdataLiteral |
createLiteral(String label,
org.openrdf.model.URI datatype) |
BigdataLiteral |
createLiteral(String label,
org.openrdf.model.URI datatype,
String language) |
BigdataLiteral |
createLiteral(XMLGregorianCalendar arg0) |
BigdataStatement |
createStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Create a statement whose
StatementEnum is NOT specified. |
BigdataStatement |
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. |
BigdataStatement |
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).
|
BigdataStatement |
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).
|
BigdataURI |
createURI(String uriString) |
BigdataURI |
createURI(String namespace,
String localName) |
BigdataLiteral |
createXSDDateTime(long timestamp) |
String |
getNamespace()
The namespace of the KB instance associated with the value factory.
|
BigdataValueSerializer<BigdataValue> |
getValueSerializer()
An object that can efficiently (de-)serialize
Value s using this
ValueFactory . |
BigdataValueFactory |
newBNodeContext()
Recursive contexts are not available (should not be necessary, right?)
|
protected String |
nextID()
A globally unique blank node identifier (ID) created with prefix shared
by all blank nodes whose identifers are generated by this class.
|
void |
remove()
Remove instance of valueFactory from static cache
|
public BNodeContextFactory(BigdataValueFactory valueFactory)
public String getNamespace()
BigdataValueFactory
getNamespace
in interface BigdataValueFactory
public void remove()
BigdataValueFactory
remove
in interface BigdataValueFactory
protected String nextID()
public BigdataBNode createBNode()
createBNode
in interface BigdataValueFactory
createBNode
in interface org.openrdf.model.ValueFactory
public BigdataValue asValue(org.openrdf.model.Value v)
BigdataValueFactory
Value
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 BigdataValue
s 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
BigdataValue
s when possible.
asValue
in interface BigdataValueFactory
v
- The value.BigdataValue
with the same data. If the value is
null
then null
is returned.public BigdataBNode createBNode(String id)
createBNode
in interface BigdataValueFactory
createBNode
in interface org.openrdf.model.ValueFactory
public BigdataBNode createBNode(BigdataStatement stmt)
createBNode
in interface BigdataValueFactory
public BigdataLiteral createLiteral(boolean arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(byte arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(double arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(float arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(int arg0, boolean unsigned)
createLiteral
in interface BigdataValueFactory
public BigdataLiteral createLiteral(long arg0, boolean unsigned)
createLiteral
in interface BigdataValueFactory
public BigdataLiteral createLiteral(short arg0, boolean unsigned)
createLiteral
in interface BigdataValueFactory
public BigdataLiteral createLiteral(byte arg0, boolean unsigned)
createLiteral
in interface BigdataValueFactory
public BigdataLiteral createLiteral(int arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(long arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(short arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(String label, String language)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(String label, org.openrdf.model.URI datatype)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(String label, org.openrdf.model.URI datatype, String language)
createLiteral
in interface BigdataValueFactory
public BigdataLiteral createLiteral(String label)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(XMLGregorianCalendar arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataLiteral createLiteral(Date arg0)
createLiteral
in interface BigdataValueFactory
createLiteral
in interface org.openrdf.model.ValueFactory
public BigdataStatement createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
BigdataValueFactory
StatementEnum
is NOT specified.createStatement
in interface BigdataValueFactory
createStatement
in interface org.openrdf.model.ValueFactory
public BigdataStatement createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
BigdataValueFactory
StatementEnum
is NOT specified.createStatement
in interface BigdataValueFactory
createStatement
in interface org.openrdf.model.ValueFactory
public BigdataStatement createStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c, StatementEnum type)
BigdataValueFactory
BigdataValueFactory
using
BigdataValueFactory.asValue(Value)
.createStatement
in interface BigdataValueFactory
s
- 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 BigdataStatement 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)
BigdataValueFactory
BigdataValueFactory
using
BigdataValueFactory.asValue(Value)
.createStatement
in interface BigdataValueFactory
s
- 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 BigdataURI createURI(String namespace, String localName)
createURI
in interface BigdataValueFactory
createURI
in interface org.openrdf.model.ValueFactory
public BigdataURI createURI(String uriString)
createURI
in interface BigdataValueFactory
createURI
in interface org.openrdf.model.ValueFactory
public BigdataValueSerializer<BigdataValue> getValueSerializer()
BigdataValueFactory
Value
s 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 BigdataValue
s MIGHT be from different
lexicons.getValueSerializer
in interface BigdataValueFactory
public BigdataValueFactory newBNodeContext()
newBNodeContext
in interface BigdataValueFactory
BNodeContextFactory
public BigdataResource asValue(org.openrdf.model.Resource v)
BigdataValueFactory
Resource
s.asValue
in interface BigdataValueFactory
public BigdataURI asValue(org.openrdf.model.URI v)
BigdataValueFactory
URI
s.asValue
in interface BigdataValueFactory
public BigdataLiteral asValue(org.openrdf.model.Literal v)
BigdataValueFactory
Literal
s.asValue
in interface BigdataValueFactory
public BigdataBNode asValue(org.openrdf.model.BNode v)
BigdataValueFactory
BNode
s.asValue
in interface BigdataValueFactory
public BigdataLiteral createXSDDateTime(long timestamp)
createXSDDateTime
in interface BigdataValueFactory
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.