org.openanzo.model.impl
Class Dataset

java.lang.Object
  extended by org.openanzo.model.impl.ADataset
      extended by org.openanzo.model.impl.Dataset
All Implemented Interfaces:
IContainer, IDataset
Direct Known Subclasses:
ContainerDataset, DynamicDataset, ReplicaDataset

public class Dataset
extends ADataset

Basic Dataset implementation that stores INamedGraphs.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
Dataset()
          Setup an empty Dataset
 
Method Summary
 void addDefaultGraphUri(org.openrdf.model.URI name)
          Add the URI of an INamedGraph to include within this dataset's default model
 void addDefaultNamedGraph(org.openrdf.model.URI uri, INamedGraph graph)
          Add an INamedGraph with its URI to this dataset's default model
 void addNamedGraph(org.openrdf.model.URI uri, INamedGraph graph)
          Add an INamedGraph with its URI to this dataset
 void addNamedGraphUri(org.openrdf.model.URI name)
          Add the URI of an INamedGraph to include within this dataset
 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
 boolean containsDefaultNamedGraph(org.openrdf.model.URI uri)
          Return if this dataset contains a INamedGraph with the given URI in the dataset's default model
 boolean containsNamedGraph(org.openrdf.model.URI uri)
          Return if this dataset contains a INamedGraph with the given URI
 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
 QueryResult executeQuery(java.lang.String query)
          Execute a SPARQL query against the data within this dataset, using the dataset's DefaultGraph and NameGraph sets
 int getDefaulNamedGraphsSize()
          Return number of INamedGraphs within this dataset's default set
 INamedGraph getDefaultNamedGraph(org.openrdf.model.URI name)
          Get the INamedGraph for the given URI if it is within this dataset's default model
 java.lang.Iterable<org.openrdf.model.URI> getDefaultNamedGraphs()
          Return an Iterable<URI> of the URIs for the INamedGraphs within this dataset's default model
 INamedGraphEventManager getEventManager()
          Return INamedGraphEventManager for this container
 INamedGraph getNamedGraph(org.openrdf.model.URI name)
          Remove named graph from set of graphs
 java.lang.Iterable<org.openrdf.model.URI> getNamedGraphs()
          Return an Iterable<URI> of the URIs for the INamedGraphs within this dataset
 int getNamedGraphsSize()
          Return number of INamedGraphs within this dataset
 ITransactionManager getTransactionManager()
          Return ITransactionManager for this container
 void removeDefaultGraphUri(org.openrdf.model.URI name)
          Remove the URI of an INamedGraph to include within this dataset's default model
 void removeDefaultNamedGraph(org.openrdf.model.URI name)
          Remove default named graph from set of graphs
 void removeNamedGraph(org.openrdf.model.URI name)
          Remove
 void removeNamedGraphUri(org.openrdf.model.URI name)
          Remove the URI of an INamedGraph to include within this dataset
 void setDefaultGraphs(java.util.Set<org.openrdf.model.URI> graphs)
          Set defaultGraphUris to provided set of graphs
 void setEventManager(INamedGraphEventManager eventManager)
          Set INamedGraphEventManager for this container
 void setNamedGraphs(java.util.Set<org.openrdf.model.URI> graphs)
          Set namedGraphsUris to provided set of graphs
 void setTransactionManager(ITransactionManager transactionManager)
          Set ITransactionManager for this container
 
Methods inherited from class org.openanzo.model.impl.ADataset
add, add, add, clear, clear, connect, contains, contains, delete, delete, delete, find, findAll, getContexts, getStatements, getURI, isClosed, isConnected, isEmpty, isEmpty, setDatasetURI, size, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dataset

public Dataset()
Setup an empty Dataset

Method Detail

addDefaultGraphUri

public void addDefaultGraphUri(org.openrdf.model.URI name)
Description copied from interface: IDataset
Add the URI of an INamedGraph to include within this dataset's default model

Parameters:
name - URI of namedgraph to add to this dataset's default model

removeDefaultGraphUri

public void removeDefaultGraphUri(org.openrdf.model.URI name)
Description copied from interface: IDataset
Remove the URI of an INamedGraph to include within this dataset's default model

Parameters:
name - URI of namedgraph to add to this dataset's default model

addNamedGraphUri

public void addNamedGraphUri(org.openrdf.model.URI name)
Description copied from interface: IDataset
Add the URI of an INamedGraph to include within this dataset

Parameters:
name - URI of namedgraph to add to this dataset

removeNamedGraphUri

public void removeNamedGraphUri(org.openrdf.model.URI name)
Description copied from interface: IDataset
Remove the URI of an INamedGraph to include within this dataset

Parameters:
name - URI of namedgraph to add to this dataset

getDefaultNamedGraph

public INamedGraph getDefaultNamedGraph(org.openrdf.model.URI name)
Description copied from interface: IDataset
Get the INamedGraph for the given URI if it is within this dataset's default model

Parameters:
name - URI of INamedGraph
Returns:
the INamedGraph for the given URI if it is within this dataset's default model

removeDefaultNamedGraph

public void removeDefaultNamedGraph(org.openrdf.model.URI name)
Remove default named graph from set of graphs

Parameters:
name - of graph to remove

getDefaultNamedGraphs

public java.lang.Iterable<org.openrdf.model.URI> getDefaultNamedGraphs()
Description copied from interface: IDataset
Return an Iterable<URI> of the URIs for the INamedGraphs within this dataset's default model

Returns:
an Iterable<URI> of the URIs for the INamedGraphs within this dataset's default model

getNamedGraph

public INamedGraph getNamedGraph(org.openrdf.model.URI name)
Remove named graph from set of graphs

Parameters:
name - of graph to remove
Returns:
the INamedGraph for the given URI if it is within this dataset

removeNamedGraph

public void removeNamedGraph(org.openrdf.model.URI name)
Remove

Parameters:
name -

getNamedGraphs

public java.lang.Iterable<org.openrdf.model.URI> getNamedGraphs()
Description copied from interface: IDataset
Return an Iterable<URI> of the URIs for the INamedGraphs within this dataset

Returns:
an Iterable<URI> of the URIs for the INamedGraphs within this dataset

setDefaultGraphs

public void setDefaultGraphs(java.util.Set<org.openrdf.model.URI> graphs)
Set defaultGraphUris to provided set of graphs

Parameters:
graphs - Set of default graphs to use

setNamedGraphs

public void setNamedGraphs(java.util.Set<org.openrdf.model.URI> graphs)
Set namedGraphsUris to provided set of graphs

Parameters:
graphs - Set of named graphs to use

addNamedGraph

public void addNamedGraph(org.openrdf.model.URI uri,
                          INamedGraph graph)
Description copied from interface: IDataset
Add an INamedGraph with its URI to this dataset

Parameters:
uri - URI of INamedGraph
graph - INamedGraph to add

addDefaultNamedGraph

public void addDefaultNamedGraph(org.openrdf.model.URI uri,
                                 INamedGraph graph)
Description copied from interface: IDataset
Add an INamedGraph with its URI to this dataset's default model

Parameters:
uri - URI of INamedGraph
graph - INamedGraph to add to this dataset's default model

containsDefaultNamedGraph

public boolean containsDefaultNamedGraph(org.openrdf.model.URI uri)
Description copied from interface: IDataset
Return if this dataset contains a INamedGraph with the given URI in the dataset's default model

Parameters:
uri - URI of INamedGraph
Returns:
true if this dataset contains a INamedGraph with the given URI in the dataset's default model

containsNamedGraph

public boolean containsNamedGraph(org.openrdf.model.URI uri)
Description copied from interface: IDataset
Return if this dataset contains a INamedGraph with the given URI

Parameters:
uri - URI of INamedGraph
Returns:
true if this dataset contains a INamedGraph with the given URI

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
Overrides:
close in class ADataset

getDefaulNamedGraphsSize

public int getDefaulNamedGraphsSize()
Description copied from interface: IDataset
Return number of INamedGraphs within this dataset's default set

Returns:
number of INamedGraphs within this dataset's default set

getNamedGraphsSize

public int getNamedGraphsSize()
Description copied from interface: IDataset
Return number of INamedGraphs within this dataset

Returns:
number of INamedGraphs within this dataset

getEventManager

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

Returns:
INamedGraphEventManager for this container

getTransactionManager

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

Returns:
ITransactionManager for this container

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

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

executeQuery

public QueryResult executeQuery(java.lang.String query)
                         throws AnzoException
Description copied from interface: IDataset
Execute a SPARQL query against the data within this dataset, using the dataset's DefaultGraph and NameGraph sets

Parameters:
query - SPARQL query string
Returns:
Results of running query
Throws:
AnzoException

setEventManager

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

Parameters:
eventManager - set the Containers eventManaget

setTransactionManager

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

Parameters:
transactionManager - set ITransactionManager for this container


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