public class DatasetImpl extends Object implements Dataset
| Constructor and Description |
|---|
DatasetImpl(Dataset ds)
Deprecated.
|
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
|
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 default graph.
|
boolean |
supportsTransactionAbort()
Declare whether
Dataset.abort() is supported. |
boolean |
supportsTransactions()
Does this dataset support transactions? Supporting transactions means that
the dataset implementation provides
Dataset.begin(org.apache.jena.query.ReadWrite), Dataset.commit(),
Dataset.end() which otherwise may throw
UnsupportedOperationException. |
static Dataset |
wrap(DatasetGraph datasetGraph)
Wrap an existing DatasetGraph
|
public DatasetImpl(Model model)
@Deprecated public DatasetImpl(Dataset ds)
public static Dataset wrap(DatasetGraph datasetGraph)
public Model getDefaultModel()
DatasetgetDefaultModel in interface Datasetpublic Lock getLock()
Datasetpublic Context getContext()
DatasetgetContext in interface Datasetpublic boolean supportsTransactions()
DatasetDataset.begin(org.apache.jena.query.ReadWrite), Dataset.commit(),
Dataset.end() which otherwise may throw
UnsupportedOperationException.
See Dataset.supportsTransactionAbort() for Dataset.abort().
A Dataset that provides functionality across independent systems
can not provide all features strong guarantees. For example, they may use MRSW
locking and some isolation control. Specifically, they do not necessarily
provide Dataset.abort().
In addition, check details of a specific implementation.
supportsTransactions in interface Datasetpublic boolean supportsTransactionAbort()
DatasetDataset.abort() is supported.
This goes along with clearing up after exceptions inside application transaction code.supportsTransactionAbort in interface Datasetpublic void begin(ReadWrite mode)
Datasetbegin in interface Datasetbegin in interface Transactionalpublic boolean isInTransaction()
isInTransaction in interface DatasetisInTransaction in interface Transactionalpublic void commit()
Datasetcommit in interface Datasetcommit in interface Transactionalpublic void abort()
Datasetabort in interface Datasetabort in interface Transactionalpublic void end()
Datasetend in interface Datasetend in interface Transactionalpublic DatasetGraph asDatasetGraph()
DatasetasDatasetGraph in interface Datasetpublic Model getNamedModel(String uri)
DatasetgetNamedModel in interface Datasetpublic void addNamedModel(String uri, Model model)
DatasetaddNamedModel in interface Datasetpublic void removeNamedModel(String uri)
DatasetremoveNamedModel in interface Datasetpublic void replaceNamedModel(String uri, Model model)
DatasetreplaceNamedModel in interface Datasetpublic void setDefaultModel(Model model)
DatasetsetDefaultModel in interface Datasetpublic boolean containsNamedModel(String uri)
DatasetcontainsNamedModel in interface Datasetpublic Iterator<String> listNames()
DatasetLicenced under the Apache License, Version 2.0