|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.model.BigdataValueFactoryImpl
public class BigdataValueFactoryImpl
An implementation using 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.
BigdataValue ctors that can cause people problems. The
public ctors are evil since they do not specify a value factory which
causes a new BigdataValue be allocated once you try to write on
the DB., Consider a WeakValueCache on this factory to avoid duplicate
values., Consider a WeakValueCache to shortcut recently used statements?| Field Summary | |
|---|---|
protected long |
NULL
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final long NULL
IRawTripleStore.NULL,
Constant Field Values| Method Detail |
|---|
public static BigdataValueFactoryImpl 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 BigdataValues
is performed by the LexiconRelation itself and is globally
consistent for a given lexicon.
namespace - The namespace of the LexiconRelation.public static void remove(String namespace)
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.
namespace - The namespace of the LexiconRelation.public BNodeContextFactory newBNodeContext()
BigdataValueFactoryBigdataValues are
actually created by this factory, it is only the semantics of
blank node ID generation that are overriden.
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 ValueFactorynewBNodeContext()protected String nextID()
UUID.
public BigdataBNodeImpl createBNode(String id)
createBNode in interface BigdataValueFactorycreateBNode in interface ValueFactorypublic BigdataLiteralImpl createLiteral(String label)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(boolean arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(byte arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(short arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(int arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(long arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(float arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(double arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataLiteralImpl createLiteral(XMLGregorianCalendar arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactory
public BigdataLiteralImpl createLiteral(String label,
String language)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactory
public BigdataLiteralImpl createLiteral(String label,
URI datatype)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactorypublic BigdataURIImpl createURI(String uriString)
createURI in interface BigdataValueFactorycreateURI in interface ValueFactory
public BigdataURIImpl createURI(String namespace,
String localName)
createURI in interface BigdataValueFactorycreateURI in interface ValueFactory
public BigdataStatementImpl createStatement(Resource s,
URI p,
Value o)
BigdataValueFactoryStatementEnum is NOT specified.
createStatement in interface BigdataValueFactorycreateStatement in interface ValueFactory
public BigdataStatementImpl createStatement(Resource s,
URI p,
Value o,
Resource c)
BigdataValueFactoryStatementEnum is NOT specified.
createStatement in interface BigdataValueFactorycreateStatement in interface ValueFactory
public BigdataStatementImpl createStatement(Resource s,
URI p,
Value o,
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 final BigdataValue asValue(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 interchangably). 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(Resource v)
BigdataValueFactoryResources.
asValue in interface BigdataValueFactorypublic BigdataURI asValue(URI v)
BigdataValueFactoryURIs.
asValue in interface BigdataValueFactorypublic BigdataLiteral asValue(Literal v)
BigdataValueFactoryLiterals.
asValue in interface BigdataValueFactorypublic BigdataBNode asValue(BNode v)
BigdataValueFactoryBNodes.
asValue in interface BigdataValueFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||