|
||||||||||
| 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.
WeakValueCache on this factory to avoid duplicate
values., Consider a WeakValueCache to shortcut recently used statements?| Field Summary | |
|---|---|
static String |
NAMESPACE_XSD
|
static String |
xsd
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final transient String NAMESPACE_XSD
public static final transient String xsd
| Method Detail |
|---|
public String getNamespace()
BigdataValueFactory
getNamespace 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 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 ValueFactory
public BigdataLiteralImpl createLiteral(byte arg0,
boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(short arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactory
public BigdataLiteralImpl createLiteral(short arg0,
boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(int arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactory
public BigdataLiteralImpl createLiteral(int arg0,
boolean unsigned)
createLiteral in interface BigdataValueFactorypublic BigdataLiteralImpl createLiteral(long arg0)
createLiteral in interface BigdataValueFactorycreateLiteral in interface ValueFactory
public BigdataLiteralImpl createLiteral(long arg0,
boolean unsigned)
createLiteral in interface BigdataValueFactorypublic 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 BigdataStatementImpl createStatement(Resource s,
URI p,
Value o,
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(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(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 | |||||||||