public interface ITripleStore
Note: This API does NOT implement a Truth Maintenance (TM) strategy and by itself only supports "explicit" triples. If the knowledge base is NOT to store any entailments then the application MAY directly use this API to read and write explicit statements on the knowledge base. However, if the knowledge base is to directly store any entailments, then the application MUST NOT invoke operations on this API that add statements to, or remove statements from, the knowledge base as the entailments will not be updated properly.
When entailments are stored in the knowledge base, a TM strategy MUST be used
to made those entailments based on the explicit triples asserted or retracted
by the application. When an application requests that statements are added to
a knowledge base that maintains entailments, the TM strategy MAY need to add
additional entailments to the knowledge base. When an application requests
that statement(s) are removed from the knowledge base, the TM strategy needs
to consider the state of the knowledge base. In general, a statement should
be removed IFF it was StatementEnum.Explicit
AND the statement is no
longer entailed by the model theory and the remaining statements in the
knowledge base.
IRawTripleStore
,
AbstractTripleStore
Modifier and Type | Method and Description |
---|---|
void |
abort()
Discard the write set.
|
void |
addStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
void |
addStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Add a single
StatementEnum.Explicit statement by lookup and/or
insert into the various indices (non-batch api). |
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(org.openrdf.model.Value value)
Converts a
BigdataValue to a Sesame Value object. |
void |
close()
Close the connection to the
ITripleStore . |
long |
commit()
Commit changes on the database.
|
void |
destroy()
Deletes all data for the
ITripleStore . |
IAccessPath<ISPO> |
getAccessPath(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
IAccessPath<ISPO> |
getAccessPath(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.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.
|
BigdataStatement |
getStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
BigdataStatement |
getStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Return the statement from the database matching the fully bound query.
|
long |
getStatementCount()
Deprecated.
|
long |
getStatementCount(boolean exact)
Deprecated.
|
long |
getStatementCount(org.openrdf.model.Resource c)
Deprecated.
|
long |
getStatementCount(org.openrdf.model.Resource c,
boolean exact)
The #of triples in the named graph or in the database if no context is
specified.
|
BigdataStatementIterator |
getStatements(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
BigdataStatementIterator |
getStatements(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Return an iterator that will visit all
BigdataStatement s in the
database matching the triple pattern. |
long |
getTermCount()
The #of RDF
Value s in the lexicon (this is not specific to any
named graph). |
long |
getURICount()
The #of URIs in the lexicon (this is not specific to any named graph).
|
boolean |
hasStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
boolean |
hasStatement(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.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(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Deprecated.
|
long |
removeStatements(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Unconditionally removes statement(s) matching the triple pattern (NO
truth maintenance).
|
long getNamedGraphCount()
UnsupportedOperationException
- unless this is a quad store.long getStatementCount(org.openrdf.model.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(org.openrdf.model.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()
Value
s in the lexicon (this is not specific to any
named graph).
This may be an estimate when using partitioned indices.
Many RDF Value
s are inlined into the statement indices. Inlined
values are not be reported by this method.
long getURICount()
This may be an estimate when using partitioned indices.
Many RDF Value
s are inlined into the statement indices. Inlined
values are not be reported by this method.
long getLiteralCount()
This may be an estimate when using partitioned indices.
Many RDF Value
s are inlined into the statement indices. Inlined
values are not be reported by this method.
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.
Many RDF Value
s are inlined into the statement indices. Inlined
values are not be reported by this method.
void addStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.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(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
addStatement(Resource, URI, Value, Resource)
boolean hasStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.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(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
hasStatement(Resource, URI, Value, Resource)
BigdataStatement getStatement(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
Note: If the parameters are from an AbstractTripleStore
using a
different lexicon then you MUST either
BigdataValue.clearInternalValue()
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(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
getStatement(Resource, URI, Value, Resource)
BigdataStatementIterator getStatements(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
BigdataStatement
s 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(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
getStatements(Resource, URI, Value, Resource)
BigdataValue asValue(org.openrdf.model.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(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
s
- The subject (optional).p
- The predicate (optional).o
- The object (optional).c
- The context (optional).long removeStatements(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
removeStatements(Resource, URI, Value, Resource)
IAccessPath<ISPO> getAccessPath(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
IAccessPath
matching the triple pattern.s
- The subject (optional).p
- The predicate (optional).o
- The object (optional).c
- The context (optional).Value
s is not known to the
database this method will return an EmptyAccessPath
.IAccessPath
,
asStatementIterator(IChunkedOrderedIterator)
IAccessPath<ISPO> getAccessPath(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
getAccessPath(Resource, URI, Value, Resource)
BigdataStatementIterator asStatementIterator(IChunkedOrderedIterator<ISPO> src)
IChunkedOrderedIterator
as a
BigdataStatementIterator
.
Note: The object visited will be BigdataStatementImpl
s.
src
- An IChunkedOrderedIterator
visiting SPO
sBigdataStatementIterator
.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.Options
InferenceEngine 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.Options
void 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).
long 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.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.