|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRawTripleStore
Low-level API directly using long term identifiers rather than an RDF Value object model.
| Field Summary | |
|---|---|
static long |
NULL
Value used for a "NULL" term identifier. |
static String |
NULLSTR
The constant NULL. |
| Fields inherited from interface com.bigdata.rdf.lexicon.ITermIdCodes |
|---|
TERMID_CODE_BNODE, TERMID_CODE_LITERAL, TERMID_CODE_MASK, TERMID_CODE_MASK_BITS, TERMID_CODE_STATEMENT, TERMID_CODE_URI |
| Method Summary | |
|---|---|
void |
abort()
Discard the write set. |
void |
addStatement(Resource s,
URI p,
Value o)
Deprecated. by addStatement(Resource, URI, Value, Resource) |
void |
addStatement(Resource s,
URI p,
Value o,
Resource c)
Add a single StatementEnum.Explicit statement by lookup and/or
insert into the various indices (non-batch api). |
long |
addStatements(IChunkedOrderedIterator<ISPO> itr,
IElementFilter<ISPO> filter)
Deprecated. by SPORelation.insert(IChunkedOrderedIterator) |
long |
addStatements(ISPO[] stmts,
int numStmts)
Writes the statements onto the statements indices (batch, parallel, NO truth maintenance). |
long |
addStatements(ISPO[] stmts,
int numStmts,
IElementFilter<ISPO> filter)
Writes the statements onto the statement indices (batch, parallel, NO truth maintenance). |
long |
addTerm(Value value)
Add a term into the term:id index and the id:term index, returning the assigned term identifier (non-batch API). |
void |
addTerms(BigdataValue[] terms)
Batch insert of terms into the database. |
BigdataStatement |
asStatement(ISPO spo)
Convert an internal ISPO into a Sesame Statement. |
BigdataStatementIterator |
asStatementIterator(IChunkedOrderedIterator<ISPO> src)
Wraps an IChunkedOrderedIterator as a
BigdataStatementIterator. |
BigdataValue |
asValue(Value value)
Converts a BigdataValue to a Sesame Value object. |
IChunkedOrderedIterator<ISPO> |
bulkCompleteStatements(IChunkedOrderedIterator<ISPO> itr)
This method fills out the statement metadata (type and sid) for ISPOs that are present in the database. |
IChunkedOrderedIterator<ISPO> |
bulkFilterStatements(IChunkedOrderedIterator<ISPO> itr,
boolean present)
Efficiently filter the supplied set of SPO objects for whether
they are "present" or "not present" in the database, depending on the
value of the supplied boolean variable (batch api). |
IChunkedOrderedIterator<ISPO> |
bulkFilterStatements(ISPO[] stmts,
int numStmts,
boolean present)
Filter the supplied set of ISPO objects for whether they are
"present" or "not present" in the database, depending on the value of the
supplied boolean variable (batch API). |
void |
close()
Close the connection to the ITripleStore. |
void |
commit()
Commit changes on the database. |
void |
destroy()
Deletes all data for the ITripleStore. |
IAccessPath<ISPO> |
getAccessPath(IKeyOrder<ISPO> keyOrder)
Deprecated. by SPORelation#getAccessPath(SPOKeyOrder, com.bigdata.relation.rule.IPredicate) |
IAccessPath<ISPO> |
getAccessPath(long s,
long p,
long o)
Deprecated. by SPORelation.getAccessPath(long, long, long) |
IAccessPath<ISPO> |
getAccessPath(Resource s,
URI p,
Value o)
Deprecated. by getAccessPath(Resource, URI, Value, Resource) |
IAccessPath<ISPO> |
getAccessPath(Resource s,
URI p,
Value o,
Resource c)
Returns an IAccessPath matching the triple pattern. |
long |
getBNodeCount()
The #of BNodes in the lexicon (this is not specific to any named graph). |
DataLoader |
getDataLoader()
Return a DataLoader singleton configured using the properties
that were used to configure the database. |
InferenceEngine |
getInferenceEngine()
Return an InferenceEngine singleton configured using the
properties that were used to configure the database. |
long |
getLiteralCount()
The #of Literals in the lexicon (this is not specific to any named graph). |
long |
getNamedGraphCount()
The #of named graphs. |
ISPO |
getStatement(long s,
long p,
long o)
Deprecated. does not support quads. |
ISPO |
getStatement(long s,
long p,
long o,
long c)
Return the statement from the database (fully bound s:p:o only). |
BigdataStatement |
getStatement(Resource s,
URI p,
Value o)
Deprecated. by getStatement(Resource, URI, Value, Resource) |
BigdataStatement |
getStatement(Resource s,
URI p,
Value o,
Resource c)
Return the statement from the database matching the fully bound query. |
long |
getStatementCount()
Deprecated. by getStatementCount(Resource, boolean) |
long |
getStatementCount(boolean exact)
Deprecated. by getStatementCount(Resource, boolean) |
long |
getStatementCount(Resource c)
Deprecated. by getStatementCount(Resource, boolean) |
long |
getStatementCount(Resource c,
boolean exact)
The #of triples in the named graph or in the database if no context is specified. |
BigdataStatementIterator |
getStatements(Resource s,
URI p,
Value o)
Deprecated. by getStatements(Resource, URI, Value, Resource) |
BigdataStatementIterator |
getStatements(Resource s,
URI p,
Value o,
Resource c)
Return an iterator that will visit all BigdataStatements in the
database matching the triple pattern. |
Value |
getTerm(long id)
Return the RDF Value given a term identifier (non-batch api). |
long |
getTermCount()
The #of terms in the lexicon (this is not specific to any named graph). |
long |
getTermId(Value value)
Return the pre-assigned termId for the value (non-batch API). |
long |
getURICount()
The #of URIs in the lexicon (this is not specific to any named graph). |
boolean |
hasStatement(Resource s,
URI p,
Value o)
Deprecated. by hasStatement(Resource, URI, Value, Resource) |
boolean |
hasStatement(Resource s,
URI p,
Value o,
Resource c)
Return true if the triple pattern matches any statements in the store (non-batch API). |
boolean |
isQuads()
Return true iff this is a quad store. |
boolean |
isReadOnly()
True iff the database view is read-only. |
long |
removeStatements(IChunkedOrderedIterator<ISPO> itr)
Removes the statements from the statement indices (batch, parallel, NO truth maintenance). |
long |
removeStatements(ISPO[] stmts,
int numStmts)
Removes the statements from the statement indices (batch, parallel, NO truth maintenance). |
long |
removeStatements(Resource s,
URI p,
Value o)
Deprecated. by removeStatements(Resource, URI, Value, Resource) |
long |
removeStatements(Resource s,
URI p,
Value o,
Resource c)
Unconditionally removes statement(s) matching the triple pattern (NO truth maintenance). |
String |
toString(long termId)
Externalizes a term using an abbreviated syntax. |
String |
toString(long s,
long p,
long o)
Deprecated. by toString(long, long, long, long) |
String |
toString(long s,
long p,
long o,
long c)
Externalizes a quad or a triple with a statement identifier using an abbreviated syntax. |
| Field Detail |
|---|
static final long NULL
static final String NULLSTR
NULL.
| Method Detail |
|---|
long addTerm(Value value)
value - The term.
void addTerms(BigdataValue[] terms)
terms - An array to be inserted.LexiconRelation.addTerms(BigdataValue[], int, boolean)Value getTerm(long id)
Value given a term identifier (non-batch api).
null if there is no term with
that identifier in the index.long getTermId(Value value)
value - Any Value reference (MAY be null).
NULL iff the term is not
known to the database.
IAccessPath<ISPO> getAccessPath(long s,
long p,
long o)
SPORelation.getAccessPath(long, long, long)
IAccessPath for the given triple
pattern.
s - The term identifier for the subject -or-
NULL.p - The term identifier for the predicate -or-
NULL.o - The term identifier for the object -or-
NULL.IAccessPath<ISPO> getAccessPath(IKeyOrder<ISPO> keyOrder)
SPORelation#getAccessPath(SPOKeyOrder, com.bigdata.relation.rule.IPredicate)
IAccessPath for the specified IKeyOrder and a
fully unbound triple pattern. This is generally used only when you want
to perform a IAccessPath#distinctTermScan().
ISPO getStatement(long s,
long p,
long o,
long c)
Note: This may be used to examine the StatementEnum.
s - The term identifier for the subject.p - The term identifier for the predicate.o - The term identifier for the object.c - The term identifier for the context (required for quads and
ignored for triples).
SPO for that statement, including its
StatementEnum -or- null iff the statement is
not in the database.
IllegalArgumentException - if the s, p, or o is NULL.
IllegalArgumentException - if the c is NULL and isQuads() would
return true.
ISPO getStatement(long s,
long p,
long o)
long addStatements(ISPO[] stmts,
int numStmts)
stmts - The statements (sorted into IKeyOrder#SPO order as a
side-effect).numStmts - The #of entries in stmts that are valid.
long addStatements(ISPO[] stmts,
int numStmts,
IElementFilter<ISPO> filter)
stmts - The statements.numStmts - The #of entries in stmts that are valid.filter - Optional statement filter. Statements matching the filter are
NOT added to the database.
long addStatements(IChunkedOrderedIterator<ISPO> itr,
IElementFilter<ISPO> filter)
SPORelation.insert(IChunkedOrderedIterator)
itr - An iterator visiting the statements to be added.filter - Optional statement filter. Statements matching the filter are
NOT added to the database. The iterator is closed by this
operation.
long removeStatements(ISPO[] stmts,
int numStmts)
Note: The StatementEnum on the SPOs is ignored by this
method. It will delete all statements having the same bindings regardless
of whether they are inferred, explicit, or axioms.
itr - The iterator
long removeStatements(IChunkedOrderedIterator<ISPO> itr)
Note: The StatementEnum on the SPOs is ignored by this
method. It will delete all statements having the same bindings regardless
of whether they are inferred, explicit, or axioms.
itr - The iterator
IChunkedOrderedIterator<ISPO> bulkFilterStatements(ISPO[] stmts,
int numStmts,
boolean present)
ISPO objects for whether they are
"present" or "not present" in the database, depending on the value of the
supplied boolean variable (batch API).
stmts - the statements to testnumStmts - the number of statements to testpresent - if true, filter for statements that exist in the db, otherwise
filter for statements that do not exist
IChunkedOrderedIterator<ISPO> bulkFilterStatements(IChunkedOrderedIterator<ISPO> itr,
boolean present)
SPO objects for whether
they are "present" or "not present" in the database, depending on the
value of the supplied boolean variable (batch api).
itr - an iterator over the set of statements to testpresent - if true, filter for statements that exist in the db, otherwise
filter for statements that do not exist
IChunkedOrderedIterator<ISPO> bulkCompleteStatements(IChunkedOrderedIterator<ISPO> itr)
ISPOs that are present in the database. ISPOs not present
in the database are left as-is.
ISPOs. Any
ISPOs that were not found will be present but their
statement metadata (type and sid) will be unchanged.
String toString(long s,
long p,
long o,
long c)
String toString(long s,
long p,
long o)
toString(long, long, long, long)
String toString(long termId)
termId - The term identifier.
long getNamedGraphCount()
UnsupportedOperationException - unless this is a quad store.long getStatementCount(Resource c)
getStatementCount(Resource, boolean)
c - The context (optional).
long getStatementCount()
getStatementCount(Resource, boolean)
getStatementCount(boolean)long getStatementCount(boolean exact)
getStatementCount(Resource, boolean)
exact - When true the result will be an exact count,
which may require a full key-range scan of one of the
statement indices.
false and either transactions or key-range
partitioned indices are being used, then this will be an upper
bound.
long getStatementCount(Resource c,
boolean exact)
c - The context (optional).exact - When true the result will be an exact count,
which may require a full key-range scan of one of the
statement indices.
null. When exact is
false and either transactions or key-range
partitioned indices are being used, then this will be an upper
bound.long getTermCount()
This may be an estimate when using partitioned indices.
long getURICount()
This may be an estimate when using partitioned indices.
long getLiteralCount()
This may be an estimate when using partitioned indices.
long getBNodeCount()
This may be an estimate when using partitioned indices.
This will always return ZERO (0) if
AbstractTripleStore.Options.STORE_BLANK_NODES is
false since there will not be any blank nodes in the
lexicon.
void addStatement(Resource s,
URI p,
Value o,
Resource c)
StatementEnum.Explicit statement by lookup and/or
insert into the various indices (non-batch api).
Note: The non-batch API is horridly inefficient and can not be used to
co-reference blank nodes. The batch load API for Sesame Value
objects is:
StatementBuffer buffer = new StatementBuffer(store, ...); buffer.add( s, p, o ); ... buffer.flush();
s - The subject (required).p - The predicate (required).o - The object (required).c - The context (required IFF a quad store and otherwise ignored).
void addStatement(Resource s,
URI p,
Value o)
addStatement(Resource, URI, Value, Resource)
boolean hasStatement(Resource s,
URI p,
Value o,
Resource c)
Note: This does not verify whether or not the statement is explicit.
s - The subject (optional).p - The predicate (optional).o - The object (optional).c - The context (optional and ignored unless a quad store).
boolean hasStatement(Resource s,
URI p,
Value o)
hasStatement(Resource, URI, Value, Resource)
BigdataStatement getStatement(Resource s,
URI p,
Value o,
Resource c)
Note: If the parameters are from an AbstractTripleStore using a
different lexicon then you MUST either BigdataValue.clearTermId()
or create a new Value object which either is not aware of the
term identifier or does not have its term identifier set in order to
avoid lookup using the term identifier rather than indirecting through
the lexicon.
s - The subject (required).p - The predicate (required).o - The object (required).c - The context (required iff a quad store and otherwise ignored).
null iff the triple is not
defined in the database.asValue(Value)
BigdataStatement getStatement(Resource s,
URI p,
Value o)
getStatement(Resource, URI, Value, Resource)
BigdataStatementIterator getStatements(Resource s,
URI p,
Value o,
Resource c)
BigdataStatements in the
database matching the triple pattern.
s - The subject (optional).p - The predicate (optional).o - The object (optional).c - The context (optional and ignored unless a quad store).
BigdataStatementIterator getStatements(Resource s,
URI p,
Value o)
getStatements(Resource, URI, Value, Resource)
BigdataValue asValue(Value value)
BigdataValue to a Sesame Value object.
value - Either a BigdataValue, a Sesame Value
object, or null.
Value object -or-
null iff value is null.
long removeStatements(Resource s,
URI p,
Value o,
Resource c)
s - The subject (optional).p - The predicate (optional).o - The object (optional).c - The context (optional).
long removeStatements(Resource s,
URI p,
Value o)
removeStatements(Resource, URI, Value, Resource)
IAccessPath<ISPO> getAccessPath(Resource s,
URI p,
Value o,
Resource c)
IAccessPath matching the triple pattern.
s - The subject (optional).p - The predicate (optional).o - The object (optional).c - The context (optional).
Values is not known to the
database this method will return an EmptyAccessPath.IAccessPath,
asStatementIterator(IChunkedOrderedIterator)
IAccessPath<ISPO> getAccessPath(Resource s,
URI p,
Value o)
getAccessPath(Resource, URI, Value, Resource)
BigdataStatementIterator asStatementIterator(IChunkedOrderedIterator<ISPO> src)
IChunkedOrderedIterator as a
BigdataStatementIterator.
Note: The object visited will be BigdataStatementImpls.
src - An IChunkedOrderedIterator visiting SPOs
BigdataStatementIterator.IAccessPath,
getAccessPath(Resource, URI, Value)BigdataStatement asStatement(ISPO spo)
ISPO into a Sesame Statement.
Note: The object returned will be a BigdataStatement
spo - The ISPO.
Statement -or- null.DataLoader getDataLoader()
DataLoader singleton configured using the properties
that were used to configure the database.
DataLoader.OptionsInferenceEngine getInferenceEngine()
InferenceEngine singleton configured using the
properties that were used to configure the database.
Note: The first time this object is requested it will attempt to write the axioms on the database.
DataLoader.Optionsvoid abort()
Note: The semantics of this operation depend on whether the database is embedded (discards the write set), temporary (ignored since the store is not restart safe), or a federation (ignored since unisolated writes on the federation are atomic and auto-committed).
void commit()
Note: The semantics of this operation depend on whether the database is embedded (does a commit), temporary (ignored), or a federation (ignored since unisolated writes on the federation are atomic and auto-committed).
void destroy()
ITripleStore.
void close()
ITripleStore.
boolean isReadOnly()
boolean isQuads()
true iff this is a quad store.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||