org.openanzo.model.delta
Class DeltaGraph

java.lang.Object
  extended by org.openanzo.model.proxy.ProxyGraph
      extended by org.openanzo.model.delta.DeltaGraph
All Implemented Interfaces:
INamedGraph, IProxyGraph

public class DeltaGraph
extends ProxyGraph

Graph implementation that keeps track of additions and deletions to a graph inside of a Transaction Queue. Additions and deletions are not applied to the underlying graph until the transaction is commited.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
DeltaGraph(INamedGraph base)
          Create a new DeltaGraph on top of the base graph
DeltaGraph(INamedGraph base, java.util.Collection<org.openrdf.model.Statement> additions, java.util.Collection<org.openrdf.model.Statement> deletions)
          Create a new DeltaGraph on top of the base graph, and use the supplied additions and deletions in the overlay.
 
Method Summary
 void add(info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> statements)
          Add a set of statements from graph
 void add(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj)
          Add a new statement with given subj,pred,obj
 void add(org.openrdf.model.Statement... statements)
          Add one or more statements to graph
 void delete(info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> statements)
          Delete a set of statements from graph
 void delete(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj)
          Delete a statement from graph
 void delete(org.openrdf.model.Statement... statements)
          Delete a set of statements from graph
 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)
          Return an iterator of all statements that match the pattern of subj,prop,obj
 INamedGraphEventManager getEventManager()
          Return INamedGraphEventManager for this graph
 org.openrdf.model.URI getNamedGraphUri()
          Get NamedGraph's URI
 INamedGraph getParentGraph()
          Get the graph to which this proxy is proxing information.
 boolean isClosed()
          Return if graph is closed
 void setNamedGraphUri(org.openrdf.model.URI namedGraphUri)
          Set NamedGraph's URI
 
Methods inherited from class org.openanzo.model.proxy.ProxyGraph
clear, close, contains, contains, getStatements, getTransactionManager, isEmpty, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeltaGraph

public DeltaGraph(INamedGraph base)
Create a new DeltaGraph on top of the base graph

Parameters:
base - Base graph to overlay deltas

DeltaGraph

public DeltaGraph(INamedGraph base,
                  java.util.Collection<org.openrdf.model.Statement> additions,
                  java.util.Collection<org.openrdf.model.Statement> deletions)
Create a new DeltaGraph on top of the base graph, and use the supplied additions and deletions in the overlay.

Parameters:
base - Base graph to overlay deltas
additions - Addition deltas to overlay
deletions - Deletion deltas to overlay
Method Detail

add

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

Specified by:
add in interface INamedGraph
Overrides:
add in class ProxyGraph
Parameters:
subj - Subject of statement
pred - Predicate of statement
obj - Object of statement

delete

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

Specified by:
delete in interface INamedGraph
Overrides:
delete in class ProxyGraph
Parameters:
subj - Subject of statement
pred - Predicate of statement
obj - Object of statement

add

public void add(org.openrdf.model.Statement... statements)
Description copied from interface: INamedGraph
Add one or more statements to graph

Specified by:
add in interface INamedGraph
Overrides:
add in class ProxyGraph
Parameters:
statements - statements to add to graph

delete

public void delete(org.openrdf.model.Statement... statements)
Description copied from interface: INamedGraph
Delete a set of statements from graph

Specified by:
delete in interface INamedGraph
Overrides:
delete in class ProxyGraph
Parameters:
statements - statements to delete from graph

delete

public void delete(info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> statements)
Description copied from interface: INamedGraph
Delete a set of statements from graph

Specified by:
delete in interface INamedGraph
Overrides:
delete in class ProxyGraph
Parameters:
statements - statements to delete from graph

add

public void add(info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> statements)
Description copied from interface: INamedGraph
Add a set of statements from graph

Specified by:
add in interface INamedGraph
Overrides:
add in class ProxyGraph
Parameters:
statements - statements to delete from graph

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)
Description copied from interface: INamedGraph
Return an iterator of all statements that match the pattern of subj,prop,obj

Specified by:
find in interface INamedGraph
Overrides:
find in class ProxyGraph
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
Returns:
an iterator of all statements that match the pattern of subj,prop,obj

getParentGraph

public INamedGraph getParentGraph()
Description copied from interface: IProxyGraph
Get the graph to which this proxy is proxing information.

Specified by:
getParentGraph in interface IProxyGraph
Specified by:
getParentGraph in class ProxyGraph
Returns:
parent graph to which this proxy is proxing information

getNamedGraphUri

public org.openrdf.model.URI getNamedGraphUri()
Description copied from interface: INamedGraph
Get NamedGraph's URI

Returns:
URI for this grpah

setNamedGraphUri

public void setNamedGraphUri(org.openrdf.model.URI namedGraphUri)
Description copied from interface: INamedGraph
Set NamedGraph's URI


isClosed

public boolean isClosed()
Description copied from interface: INamedGraph
Return if graph is closed

Returns:
true if graph is closed

getEventManager

public INamedGraphEventManager getEventManager()
Description copied from interface: INamedGraph
Return INamedGraphEventManager for this graph

Specified by:
getEventManager in interface INamedGraph
Overrides:
getEventManager in class ProxyGraph
Returns:
INamedGraphEventManager for this graph


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