org.openanzo.model
Interface IDataset

All Superinterfaces:
IContainer
All Known Implementing Classes:
ADataset, ClosableDatasetServiceDataset, ContainerDataset, Dataset, DynamicDataset, ReplicaDataset, StoredDatasetProxy, StoredDatasetserviceDatasetProxy

public interface IDataset
extends IContainer

IDataset is an extension of IContainer that exposes methods needed for Dataset operations. These methods are mainly related to managing the NamedGraphs which are stored within the Dataset.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Method Summary
 void addDefaultGraphUri(org.openrdf.model.URI uri)
          Add the URI of an INamedGraph to include within this dataset's default model
 void addDefaultNamedGraph(org.openrdf.model.URI uri, INamedGraph namedGraph)
          Add an INamedGraph with its URI to this dataset's default model
 void addNamedGraph(org.openrdf.model.URI uri, INamedGraph namedGraph)
          Add an INamedGraph with its URI to this dataset
 void addNamedGraphUri(org.openrdf.model.URI uri)
          Add the URI of an INamedGraph to include within this dataset
 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.lang.String query)
          Execute a SPARQL query against the data within this dataset, using the dataset's DefaultGraph and NameGraph sets
 info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> findAll(org.openrdf.model.Resource subj, org.openrdf.model.URI prop, org.openrdf.model.Value obj, org.openrdf.model.Resource... contexts)
          Return an iterator of all statements that match the pattern of subj,prop,obj Difference between find, and findall, is that with findAll, if contexts are provided, they are used to sort results, but not limit results, ie the results contains all statements that match the subj,prop,obj, with matching statements within the given contexts earlier in the iterator than statements not in the provided contexts.
 int getDefaulNamedGraphsSize()
          Return number of INamedGraphs within this dataset's default set
 INamedGraph getDefaultNamedGraph(org.openrdf.model.URI uri)
          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
 INamedGraph getNamedGraph(org.openrdf.model.URI uri)
          Get the INamedGraph for the given URI if it is within this dataset
 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
 void removeDefaultGraphUri(org.openrdf.model.URI uri)
          Remove the URI of an INamedGraph to include within this dataset's default model
 void removeNamedGraphUri(org.openrdf.model.URI uri)
          Remove the URI of an INamedGraph to include within this dataset
 
Methods inherited from interface org.openanzo.model.IContainer
add, add, add, clear, clear, close, connect, contains, contains, delete, delete, delete, executeQuery, find, getContexts, getEventManager, getStatements, getTransactionManager, getURI, isClosed, isConnected, isEmpty, isEmpty, setEventManager, setTransactionManager, size, size
 

Method Detail

getNamedGraph

INamedGraph getNamedGraph(org.openrdf.model.URI uri)
Get the INamedGraph for the given URI if it is within this dataset

Parameters:
uri - URI of INamedGraph
Returns:
the INamedGraph for the given URI if it is within this dataset

containsNamedGraph

boolean containsNamedGraph(org.openrdf.model.URI uri)
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

getNamedGraphs

java.lang.Iterable<org.openrdf.model.URI> getNamedGraphs()
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

addNamedGraphUri

void addNamedGraphUri(org.openrdf.model.URI uri)
Add the URI of an INamedGraph to include within this dataset

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

removeNamedGraphUri

void removeNamedGraphUri(org.openrdf.model.URI uri)
Remove the URI of an INamedGraph to include within this dataset

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

getNamedGraphsSize

int getNamedGraphsSize()
Return number of INamedGraphs within this dataset

Returns:
number of INamedGraphs within this dataset

addNamedGraph

void addNamedGraph(org.openrdf.model.URI uri,
                   INamedGraph namedGraph)
Add an INamedGraph with its URI to this dataset

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

containsDefaultNamedGraph

boolean containsDefaultNamedGraph(org.openrdf.model.URI uri)
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

getDefaultNamedGraphs

java.lang.Iterable<org.openrdf.model.URI> getDefaultNamedGraphs()
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

addDefaultGraphUri

void addDefaultGraphUri(org.openrdf.model.URI uri)
Add the URI of an INamedGraph to include within this dataset's default model

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

removeDefaultGraphUri

void removeDefaultGraphUri(org.openrdf.model.URI uri)
Remove the URI of an INamedGraph to include within this dataset's default model

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

getDefaultNamedGraph

INamedGraph getDefaultNamedGraph(org.openrdf.model.URI uri)
Get the INamedGraph for the given URI if it is within this dataset's default model

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

getDefaulNamedGraphsSize

int getDefaulNamedGraphsSize()
Return number of INamedGraphs within this dataset's default set

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

addDefaultNamedGraph

void addDefaultNamedGraph(org.openrdf.model.URI uri,
                          INamedGraph namedGraph)
Add an INamedGraph with its URI to this dataset's default model

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

findAll

info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> findAll(org.openrdf.model.Resource subj,
                                                                                        org.openrdf.model.URI prop,
                                                                                        org.openrdf.model.Value obj,
                                                                                        org.openrdf.model.Resource... contexts)
Return an iterator of all statements that match the pattern of subj,prop,obj Difference between find, and findall, is that with findAll, if contexts are provided, they are used to sort results, but not limit results, ie the results contains all statements that match the subj,prop,obj, with matching statements within the given contexts earlier in the iterator than statements not in the provided contexts.

Parameters:
subj - Subject resource to match, or null for any
prop - Predicate uri to match, or null for any
obj - Object value to match, or null for any
contexts - Set of contexts to search first, before searching the rest of the dataset
Returns:
an iterator of all statements that match the pattern of subj,prop,obj

executeQuery

QueryResult executeQuery(java.lang.String query)
                         throws AnzoException
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


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