com.bigdata.rdf.rio
Interface IStatementBuffer<F extends Statement>

All Superinterfaces:
IBuffer<F>
All Known Implementing Classes:
AbstractStatementBuffer, AbstractStatementBuffer.StatementBuffer2, AsynchronousStatementBufferFactory.AsynchronousStatementBufferImpl, StatementBuffer, VerifyStatementBuffer

public interface IStatementBuffer<F extends Statement>
extends IBuffer<F>

Abstraction for a buffer that loads Statements into an AbstractTripleStore.

Version:
$Id: IStatementBuffer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Method Summary
 void add(F stmt)
          Add a statement to the buffer.
 void add(Resource s, URI p, Value o)
          Add an "explicit" statement to the buffer with a "null" context.
 void add(Resource s, URI p, Value o, Resource c)
          Add an "explicit" statement to the buffer.
 void add(Resource s, URI p, Value o, Resource c, StatementEnum type)
          Add a statement to the buffer.
 AbstractTripleStore getDatabase()
          The database that will be used to resolve terms.
 AbstractTripleStore getStatementStore()
          The optional store into which statements will be inserted when non-null.
 void setBNodeMap(Map<String,BigdataBNodeImpl> bnodes)
          Set the canonicalizing map for blank nodes based on their ID.
 
Methods inherited from interface com.bigdata.relation.accesspath.IBuffer
flush, isEmpty, reset, size
 

Method Detail

getStatementStore

AbstractTripleStore getStatementStore()
The optional store into which statements will be inserted when non-null.


getDatabase

AbstractTripleStore getDatabase()
The database that will be used to resolve terms. When getStatementStore() is null, statements will be written into this store as well.


add

void add(F stmt)
Add a statement to the buffer.

Specified by:
add in interface IBuffer<F extends Statement>
Parameters:
stmt - 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.

add

void add(Resource s,
         URI p,
         Value o)
Add an "explicit" statement to the buffer with a "null" context.

Parameters:
s - The subject.
p - The predicate.
o - The object.

add

void add(Resource s,
         URI p,
         Value o,
         Resource c)
Add an "explicit" statement to the buffer.

Parameters:
s - The subject.
p - The predicate.
o - The object.
c - The context (optional).

add

void add(Resource s,
         URI p,
         Value o,
         Resource c,
         StatementEnum type)
Add a statement to the buffer.

Note: The context parameter (c) is NOT used. The database at this time is either a triple store or a triple store with statement identifiers, and in neither case is the context used.

Parameters:
s - The subject.
p - The predicate.
o - The object.
c - The context (optional).
type - The statement type (optional).

setBNodeMap

void setBNodeMap(Map<String,BigdataBNodeImpl> bnodes)
Set the canonicalizing map for blank nodes based on their ID. This allows you to reuse the same map across multiple 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.

Parameters:
bnodes - The blank nodes map.
Throws:
IllegalArgumentException - if the argument is null.
IllegalStateException - if the map has already been allocated.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.