org.openanzo.model.impl
Class TripleStore

java.lang.Object
  extended by org.openanzo.model.impl.TripleStore

public class TripleStore
extends java.lang.Object

Core storage of triples with indexes for s,p,o, po, and sp

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
TripleStore()
          Initialize triplestore's statement set and indexes
 
Method Summary
 void add(org.openrdf.model.Statement... statements)
          Add statements to store and index them
 void clear()
          Clear statements and indexes from memory
 boolean contains(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj)
          Tests if a statement is contained in store that match provided parameters
 boolean contains(org.openrdf.model.Statement match)
          Tests if a statement is contained in the store.
 void delete(org.openrdf.model.Statement... statements)
          Delete statements from store and remove indexes
 java.util.Collection<org.openrdf.model.Statement> findStatements(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj)
          Find set of statements that match provided parameters
 java.util.Collection<org.openrdf.model.Statement> getAllStatements()
          Return all statements in the store
 boolean isEmpty()
          Return if store is empty
 int size()
          Return the number of statements in the store
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleStore

public TripleStore()
Initialize triplestore's statement set and indexes

Method Detail

add

public void add(org.openrdf.model.Statement... statements)
Add statements to store and index them

Parameters:
statements - Statements to add

delete

public void delete(org.openrdf.model.Statement... statements)
Delete statements from store and remove indexes

Parameters:
statements - Statements to delete

findStatements

public java.util.Collection<org.openrdf.model.Statement> findStatements(org.openrdf.model.Resource subj,
                                                                        org.openrdf.model.URI prop,
                                                                        org.openrdf.model.Value obj)
Find set of statements that match provided parameters

Parameters:
subj - Subject value to match, or wildcard if null
prop - Property value to match, or wildcard if null
obj - Object value to match, or wildcard if null
Returns:
Collection of matching statements

getAllStatements

public java.util.Collection<org.openrdf.model.Statement> getAllStatements()
Return all statements in the store

Returns:
Collection of statements in store

contains

public boolean contains(org.openrdf.model.Statement match)
Tests if a statement is contained in the store.

Parameters:
match - is the statement to be tested
Returns:
boolean result to indicte if the statement was contained in store

contains

public boolean contains(org.openrdf.model.Resource subj,
                        org.openrdf.model.URI prop,
                        org.openrdf.model.Value obj)
Tests if a statement is contained in store that match provided parameters

Parameters:
subj - Subject value to match, or wildcard if null
prop - Property value to match, or wildcard if null
obj - Object value to match, or wildcard if null
Returns:
boolean result to indicte if the statement was contained in store

clear

public void clear()
Clear statements and indexes from memory


size

public int size()
Return the number of statements in the store

Returns:
the number of statements in the store

isEmpty

public boolean isEmpty()
Return if store is empty

Returns:
if store is empty


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.