org.openanzo.model.impl
Class NamedGraphContainer

java.lang.Object
  extended by org.openanzo.model.impl.QuadStore
      extended by org.openanzo.model.impl.NamedGraphContainer
All Implemented Interfaces:
IContainer

public class NamedGraphContainer
extends QuadStore
implements IContainer

Container that stores data in a QuadStore

Author:
Stephen Evanchik, Joe Betz, Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
NamedGraphContainer(org.openrdf.model.URI uri)
          Create new Container with given URI
 
Method Summary
 void add(java.util.Iterator<org.openrdf.model.Statement> statements)
          Add a set of statements from container
 void add(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource context)
          Add a new statement with given subj,pred,obj,context
 void add(org.openrdf.model.Statement... statements)
          Add statements to store and index them
 void clear(org.openrdf.model.Resource... context)
          Delete all statements in container for given contexts
 void close()
          Disconnect container from its source and close the container Note: Once a container is closed, it is based on the source of the container's data whether or not subsequent calls to connect will return the same data
 void connect()
          Connect container to its source
 void delete(java.util.Iterator<org.openrdf.model.Statement> statements)
          Delete a set of statements from container
 void delete(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.Resource context)
          Delete a statement from container
 void delete(org.openrdf.model.Statement... statements)
          Delete statements from store and remove indexes
 QueryResult executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn, java.util.Set<org.openrdf.model.URI> namedGraphsIn, java.lang.String query)
          Execute a SPARQL query against the data within this container
 info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> find(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts)
          Return an iterator over all statements that match the pattern of subj,prop,obj
 java.util.Set<org.openrdf.model.URI> getContexts()
          Return the set of contexts contained within store
 INamedGraphEventManager getEventManager()
          Return INamedGraphEventManager for this container
 info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> getStatements()
          Get an iterator over all statements within this container
 ITransactionManager getTransactionManager()
          Return ITransactionManager for this container
 org.openrdf.model.URI getURI()
          Get URI of IContainer
 boolean isClosed()
          Return if container is closed
 boolean isConnected()
          Return if the container is connected to its source
 void setEventManager(INamedGraphEventManager eventManager)
          Set INamedGraphEventManager for this container
 void setTransactionManager(ITransactionManager transactionManager)
          Set ITransactionManager for this container
 
Methods inherited from class org.openanzo.model.impl.QuadStore
clear, contains, contains, findStatements, getAllStatements, isEmpty, isEmpty, size, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openanzo.model.IContainer
clear, contains, contains, isEmpty, isEmpty, size, size
 

Constructor Detail

NamedGraphContainer

public NamedGraphContainer(org.openrdf.model.URI uri)
Create new Container with given URI

Parameters:
uri - uri of container
Method Detail

getURI

public org.openrdf.model.URI getURI()
Description copied from interface: IContainer
Get URI of IContainer

Specified by:
getURI in interface IContainer
Returns:
URI for this container

find

public info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> find(org.openrdf.model.Resource subj,
                                                                                            org.openrdf.model.URI prop,
                                                                                            org.openrdf.model.Value obj,
                                                                                            org.openrdf.model.Resource... contexts)
Description copied from interface: IContainer
Return an iterator over all statements that match the pattern of subj,prop,obj

Specified by:
find in interface IContainer
Parameters:
subj - Subject resource to match, or wildcard if null
prop - Predicate uri to match, or wildcard if null
obj - Object value to match, or wildcard if null
contexts - Context values to match, or wildcard if null
Returns:
an iterator of all statements that match the pattern of subj,prop,obj,context

add

public void add(org.openrdf.model.Statement... statements)
Description copied from class: QuadStore
Add statements to store and index them

Specified by:
add in interface IContainer
Overrides:
add in class QuadStore
Parameters:
statements - Statements to add

delete

public void delete(org.openrdf.model.Statement... statements)
Description copied from class: QuadStore
Delete statements from store and remove indexes

Specified by:
delete in interface IContainer
Overrides:
delete in class QuadStore
Parameters:
statements - Statements to delete

add

public void add(java.util.Iterator<org.openrdf.model.Statement> statements)
Description copied from interface: IContainer
Add a set of statements from container

Specified by:
add in interface IContainer
Parameters:
statements - statements to add to container

delete

public void delete(java.util.Iterator<org.openrdf.model.Statement> statements)
Description copied from interface: IContainer
Delete a set of statements from container

Specified by:
delete in interface IContainer
Parameters:
statements - statements to delete from container

add

public void add(org.openrdf.model.Resource subj,
                org.openrdf.model.URI pred,
                org.openrdf.model.Value obj,
                org.openrdf.model.Resource context)
Description copied from interface: IContainer
Add a new statement with given subj,pred,obj,context

Specified by:
add in interface IContainer
Parameters:
subj - Subject of statement
pred - Predicate of statement
obj - Object of statement
context - Context of statement

getStatements

public info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> getStatements()
Description copied from interface: IContainer
Get an iterator over all statements within this container

Specified by:
getStatements in interface IContainer
Returns:
CloseableIterator of all statements within this container

isClosed

public boolean isClosed()
Description copied from interface: IContainer
Return if container is closed

Specified by:
isClosed in interface IContainer
Returns:
true if container is closed

getEventManager

public INamedGraphEventManager getEventManager()
Description copied from interface: IContainer
Return INamedGraphEventManager for this container

Specified by:
getEventManager in interface IContainer
Returns:
INamedGraphEventManager for this container

getTransactionManager

public ITransactionManager getTransactionManager()
Description copied from interface: IContainer
Return ITransactionManager for this container

Specified by:
getTransactionManager in interface IContainer
Returns:
ITransactionManager for this container

setEventManager

public void setEventManager(INamedGraphEventManager eventManager)
Description copied from interface: IContainer
Set INamedGraphEventManager for this container

Specified by:
setEventManager in interface IContainer
Parameters:
eventManager - set the Containers eventManaget

setTransactionManager

public void setTransactionManager(ITransactionManager transactionManager)
Description copied from interface: IContainer
Set ITransactionManager for this container

Specified by:
setTransactionManager in interface IContainer
Parameters:
transactionManager - set ITransactionManager for this container

close

public void close()
Description copied from interface: IContainer
Disconnect container from its source and close the container Note: Once a container is closed, it is based on the source of the container's data whether or not subsequent calls to connect will return the same data

Specified by:
close in interface IContainer

clear

public void clear(org.openrdf.model.Resource... context)
Description copied from interface: IContainer
Delete all statements in container for given contexts

Specified by:
clear in interface IContainer
Parameters:
context - Contexts to clear from container

delete

public void delete(org.openrdf.model.Resource subj,
                   org.openrdf.model.URI pred,
                   org.openrdf.model.Value obj,
                   org.openrdf.model.Resource context)
Description copied from interface: IContainer
Delete a statement from container

Specified by:
delete in interface IContainer
Parameters:
subj - Subject resource to match, or wildcard if null
pred - Predicate uri to match, or wildcard if null
obj - Object value to match, or wildcard if null
context - Context values to match, or wildcard if null

connect

public void connect()
Description copied from interface: IContainer
Connect container to its source

Specified by:
connect in interface IContainer

isConnected

public boolean isConnected()
Description copied from interface: IContainer
Return if the container is connected to its source

Specified by:
isConnected in interface IContainer
Returns:
if the container is connected to its source

executeQuery

public QueryResult executeQuery(java.util.Set<org.openrdf.model.URI> defaultNamedGraphsIn,
                                java.util.Set<org.openrdf.model.URI> namedGraphsIn,
                                java.lang.String query)
                         throws AnzoException
Description copied from interface: IContainer
Execute a SPARQL query against the data within this container

Specified by:
executeQuery in interface IContainer
Parameters:
defaultNamedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the default graph for this query
namedGraphsIn - Set<URI> of URIs for NamedGraphs that will make up the NamedGraphs for this query
query - SPARQL query string
Returns:
Results of running query
Throws:
AnzoException

getContexts

public java.util.Set<org.openrdf.model.URI> getContexts()
Description copied from class: QuadStore
Return the set of contexts contained within store

Specified by:
getContexts in interface IContainer
Overrides:
getContexts in class QuadStore
Returns:
collection of contexts contained within store


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