org.openanzo.model.impl
Class QuadStore

java.lang.Object
  extended by org.openanzo.model.impl.QuadStore
Direct Known Subclasses:
NamedGraphContainer

public class QuadStore
extends java.lang.Object

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

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
QuadStore()
          Initialize quadstore'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, org.openrdf.model.Resource... contexts)
          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, org.openrdf.model.Resource... contexts)
          Find set of statements that match provided parameters
 java.util.Collection<org.openrdf.model.Statement> getAllStatements()
          Return all statements in the store
 java.util.Set<org.openrdf.model.URI> getContexts()
          Return the set of contexts contained within store
 boolean isEmpty()
          Return if store is empty
 boolean isEmpty(org.openrdf.model.Resource... contexts)
          Return if store is empty for given contexts
 int size()
          Return the number of statements in the store
 int size(org.openrdf.model.Resource... contexts)
          Return the number of statements in the store for given contexts
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadStore

public QuadStore()
Initialize quadstore'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
Throws:
AnzoRuntimeException - if the context of a statement is null

delete

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

Parameters:
statements - Statements to delete
Throws:
AnzoRuntimeException - if the context of a statement is null

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,
                                                                        org.openrdf.model.Resource... contexts)
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
contexts - Context 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 indicate 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,
                        org.openrdf.model.Resource... contexts)
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
contexts - Context value to match, or wildcard if null
Returns:
boolean result to indicate 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

isEmpty

public boolean isEmpty(org.openrdf.model.Resource... contexts)
Return if store is empty for given contexts

Parameters:
contexts - to check for any contents
Returns:
if store is empty for given contexts

size

public int size(org.openrdf.model.Resource... contexts)
Return the number of statements in the store for given contexts

Parameters:
contexts - to determine size of in container
Returns:
the number of statements in the store for given contexts

getContexts

public java.util.Set<org.openrdf.model.URI> getContexts()
Return the set of contexts contained within store

Returns:
collection of contexts contained within store


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