public class DatasetImpl extends Object implements Dataset
Constructor and Description |
---|
DatasetImpl(Dataset ds) |
DatasetImpl(Model model)
Create a Dataset with the model as default model.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)
|
void |
addNamedModel(String uri,
Model model)
Set a named graph.
|
DatasetGraph |
asDatasetGraph()
Get the dataset in graph form
|
void |
begin(ReadWrite mode)
Start either a READ or WRITE transaction
|
static Dataset |
cloneStructure(DatasetGraph datasetGraph)
Clone the structure of a DatasetGraph.
|
void |
close()
Close the dataset, potentially releasing any associated resources.
|
void |
commit()
Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)
|
boolean |
containsNamedModel(String uri)
Does the dataset contain a model with the name supplied?
|
void |
end()
Finish the transaction - if a write transaction and commit() has not been called, then abort
|
Context |
getContext()
Get the context associated with this dataset
|
Model |
getDefaultModel()
Get the default graph as a Jena Model
|
Lock |
getLock()
Get the lock for this dataset
|
Model |
getNamedModel(String uri)
Get a graph by name as a Jena Model
|
boolean |
isInTransaction()
Say whether a transaction is active
|
Iterator<String> |
listNames()
List the names
|
void |
removeNamedModel(String uri)
Remove a named graph.
|
void |
replaceNamedModel(String uri,
Model model)
Change a named graph for another using the same name
|
void |
setDefaultModel(Model model)
Set the background graph.
|
boolean |
supportsTransactions()
Does this dataset support transactions?
Supporting transactions mean that the dataset implementation
provides
Dataset.begin(com.hp.hpl.jena.query.ReadWrite) , Dataset.commit() , Dataset.abort() , Dataset.end()
which otherwise may throw UnsupportedOperationException |
static Dataset |
wrap(DatasetGraph datasetGraph)
Wrap an existing DatasetGraph
|
public DatasetImpl(Model model)
public DatasetImpl(Dataset ds)
public static Dataset wrap(DatasetGraph datasetGraph)
public static Dataset cloneStructure(DatasetGraph datasetGraph)
public Model getDefaultModel()
Dataset
getDefaultModel
in interface Dataset
public Lock getLock()
Dataset
public Context getContext()
Dataset
getContext
in interface Dataset
public boolean supportsTransactions()
Dataset
Dataset.begin(com.hp.hpl.jena.query.ReadWrite)
, Dataset.commit()
, Dataset.abort()
, Dataset.end()
which otherwise may throw UnsupportedOperationException
supportsTransactions
in interface Dataset
public void begin(ReadWrite mode)
Dataset
public boolean isInTransaction()
isInTransaction
in interface Dataset
public void commit()
Dataset
public void abort()
Dataset
public void end()
Dataset
public DatasetGraph asDatasetGraph()
Dataset
asDatasetGraph
in interface Dataset
public Model getNamedModel(String uri)
Dataset
getNamedModel
in interface Dataset
public void addNamedModel(String uri, Model model) throws LabelExistsException
Dataset
addNamedModel
in interface Dataset
LabelExistsException
public void removeNamedModel(String uri)
Dataset
removeNamedModel
in interface Dataset
public void replaceNamedModel(String uri, Model model)
Dataset
replaceNamedModel
in interface Dataset
public void setDefaultModel(Model model)
Dataset
setDefaultModel
in interface Dataset
public boolean containsNamedModel(String uri)
Dataset
containsNamedModel
in interface Dataset
public Iterator<String> listNames()
Dataset
Licenced under the Apache License, Version 2.0