S
- F
- protected class AsynchronousStatementBufferFactory.AsynchronousStatementBufferImpl extends Object implements IStatementBuffer<S>
Modifier | Constructor and Description |
---|---|
protected |
AsynchronousStatementBufferFactory.AsynchronousStatementBufferImpl(R resource) |
Modifier and Type | Method and Description |
---|---|
void |
add(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o)
Add an "explicit" statement to the buffer (flushes on overflow, no
context).
|
void |
add(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c)
Add an "explicit" statement to the buffer (flushes on overflow).
|
void |
add(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.Resource c,
StatementEnum type)
Add a statement to the buffer (core impl).
|
void |
add(S e)
Add a statement to the buffer.
|
long |
flush()
Note: this implementation always returns ZERO (0).
|
AbstractTripleStore |
getDatabase()
The database that will be used to resolve terms.
|
R |
getDocumentIdentifier()
Return the identifier for the document.
|
AbstractTripleStore |
getStatementStore()
Returns
null . |
boolean |
isEmpty()
True iff there are no elements in the buffer.
|
void |
reset()
Clears all buffered data, including the canonicalizing mapping for
blank nodes and deferred provenance statements.
|
void |
setBNodeMap(Map<String,BigdataBNode> bnodes)
Set the canonicalizing map for blank nodes based on their ID.
|
int |
size()
The #of elements currently in the buffer.
|
protected AsynchronousStatementBufferFactory.AsynchronousStatementBufferImpl(R resource)
resource
- The document identifier.public final AbstractTripleStore getDatabase()
IStatementBuffer
IStatementBuffer.getStatementStore()
is null
, statements will be
written into this store as well.getDatabase
in interface IStatementBuffer<S extends BigdataStatement>
public AbstractTripleStore getStatementStore()
null
.
Note: This implementation does not support the concept of a focusStore so it can not be used for truth maintenance.
getStatementStore
in interface IStatementBuffer<S extends BigdataStatement>
public boolean isEmpty()
IBuffer
isEmpty
in interface IBuffer<S extends BigdataStatement>
public int size()
IBuffer
size
in interface IBuffer<S extends BigdataStatement>
public R getDocumentIdentifier()
public long flush()
flush
in interface IBuffer<S extends BigdataStatement>
IRelation
.
See IMutableRelation
AsynchronousStatementBufferFactory.ParserTask
public void reset()
reset
in interface IBuffer<S extends BigdataStatement>
public void setBNodeMap(Map<String,BigdataBNode> bnodes)
IStatementBuffer
IStatementBuffer
instances. For example, the BigdataSail
does this so that the
same bnode map is used throughout the life of a SailConnection
.
While RIO provides blank node correlation within a given source, it does
NOT provide blank node correlation across sources. You need to use this
method to do that.
Note: It is reasonable to expect that the bnodes map is used by
concurrent threads. For this reason, the map SHOULD be thread-safe. This
can be accomplished either using Collections.synchronizedMap(Map)
or a ConcurrentHashMap
. However, implementations MUST still be
synchronized on the map reference across operations which conditionally
insert into the map in order to make that update atomic and thread-safe.
Otherwise a race condition exists for the conditional insert and
different threads could get incoherent answers.
setBNodeMap
in interface IStatementBuffer<S extends BigdataStatement>
bnodes
- The blank nodes map.public void add(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o)
add
in interface IStatementBuffer<S extends BigdataStatement>
s
- p
- o
- public void add(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c)
add
in interface IStatementBuffer<S extends BigdataStatement>
s
- p
- o
- c
- public void add(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.Resource c, StatementEnum type)
add
in interface IStatementBuffer<S extends BigdataStatement>
s
- The subject.p
- The predicate.o
- The object.c
- The context (optional).type
- The statement type (optional).public void add(S e)
IStatementBuffer
add
in interface IStatementBuffer<S extends BigdataStatement>
add
in interface IBuffer<S extends BigdataStatement>
e
- The statement. If stmt implements
BigdataStatement
then the StatementEnum
will
be used (this makes it possible to load axioms into the
database as axioms) but the term identifiers on the stmt's
values will be ignored.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.