com.hp.hpl.jena.sparql.core
Class DataSourceImpl

java.lang.Object
  extended by com.hp.hpl.jena.sparql.core.DataSourceImpl
All Implemented Interfaces:
Dataset, DataSource

public class DataSourceImpl
extends java.lang.Object
implements DataSource

A implementation of a DataSource, which is a mutable Dataset, a set of a single unnamed graph and a number (zero or more) named graphs with graphs as Models.


Constructor Summary
DataSourceImpl(Dataset ds)
           
DataSourceImpl(com.hp.hpl.jena.rdf.model.Model model)
           
 
Method Summary
 void addNamedModel(java.lang.String uri, com.hp.hpl.jena.rdf.model.Model model)
          Set a named graph.
 DatasetGraph asDatasetGraph()
          Get the dataset in graph form
static DataSource cloneStructure(DatasetGraph datasetGraph)
           
 void close()
          Close the dataset, potentially releasing any associated resources.
 boolean containsNamedModel(java.lang.String uri)
          Does the dataset contain a model with the name supplied?
static DataSource createMem()
           
 com.hp.hpl.jena.rdf.model.Model getDefaultModel()
          Get the default graph as a Jena Model
 com.hp.hpl.jena.shared.Lock getLock()
          Get the lock for this dataset
 com.hp.hpl.jena.rdf.model.Model getNamedModel(java.lang.String uri)
          Get a graph by name as a Jena Model
 java.util.Iterator<java.lang.String> listNames()
          List the names
 void removeNamedModel(java.lang.String uri)
          Remove a named graph.
 void replaceNamedModel(java.lang.String uri, com.hp.hpl.jena.rdf.model.Model model)
          Change a named graph for another using the same name
 void setDefaultModel(com.hp.hpl.jena.rdf.model.Model model)
          Set the background graph.
static DataSource wrap(DatasetGraph datasetGraph)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceImpl

public DataSourceImpl(com.hp.hpl.jena.rdf.model.Model model)

DataSourceImpl

public DataSourceImpl(Dataset ds)
Method Detail

createMem

public static DataSource createMem()

wrap

public static DataSource wrap(DatasetGraph datasetGraph)

cloneStructure

public static DataSource cloneStructure(DatasetGraph datasetGraph)

getDefaultModel

public com.hp.hpl.jena.rdf.model.Model getDefaultModel()
Description copied from interface: Dataset
Get the default graph as a Jena Model

Specified by:
getDefaultModel in interface Dataset

getLock

public com.hp.hpl.jena.shared.Lock getLock()
Description copied from interface: Dataset
Get the lock for this dataset

Specified by:
getLock in interface Dataset

asDatasetGraph

public DatasetGraph asDatasetGraph()
Description copied from interface: Dataset
Get the dataset in graph form

Specified by:
asDatasetGraph in interface Dataset

getNamedModel

public com.hp.hpl.jena.rdf.model.Model getNamedModel(java.lang.String uri)
Description copied from interface: Dataset
Get a graph by name as a Jena Model

Specified by:
getNamedModel in interface Dataset

addNamedModel

public void addNamedModel(java.lang.String uri,
                          com.hp.hpl.jena.rdf.model.Model model)
                   throws LabelExistsException
Description copied from interface: DataSource
Set a named graph.

Specified by:
addNamedModel in interface DataSource
Throws:
LabelExistsException

removeNamedModel

public void removeNamedModel(java.lang.String uri)
Description copied from interface: DataSource
Remove a named graph.

Specified by:
removeNamedModel in interface DataSource

replaceNamedModel

public void replaceNamedModel(java.lang.String uri,
                              com.hp.hpl.jena.rdf.model.Model model)
Description copied from interface: DataSource
Change a named graph for another using the same name

Specified by:
replaceNamedModel in interface DataSource

setDefaultModel

public void setDefaultModel(com.hp.hpl.jena.rdf.model.Model model)
Description copied from interface: DataSource
Set the background graph. Can be set to null for none.

Specified by:
setDefaultModel in interface DataSource

containsNamedModel

public boolean containsNamedModel(java.lang.String uri)
Description copied from interface: Dataset
Does the dataset contain a model with the name supplied?

Specified by:
containsNamedModel in interface Dataset

listNames

public java.util.Iterator<java.lang.String> listNames()
Description copied from interface: Dataset
List the names

Specified by:
listNames in interface Dataset

close

public void close()
Description copied from interface: Dataset
Close the dataset, potentially releasing any associated resources. The dataset can not be used for query after this call.

Specified by:
close in interface Dataset


Copyright ? 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP Copyright ? 2010 Talis Systems Ltd. Copyright ? 2010, 2011 Epimorphics Ltd.