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(org.apache.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()
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.abort(), Dataset.end()
which otherwise may throw UnsupportedOperationExceptionsupportsTransactions 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) throws LabelExistsException
DatasetaddNamedModel in interface DatasetLabelExistsExceptionpublic 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