- All Superinterfaces:
Transactional
- All Known Implementing Classes:
DatasetImpl
Query is over a Dataset, a collection of named graphs
and a default graph (also called the unnamed graph).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)addNamedModel(String uri, org.apache.jena.rdf.model.Model model) Add a named graph.addNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model) Add a named graph.Get the dataset in graph formvoidStart either a READ or WRITE transactionvoidclose()Close the dataset, potentially releasing any associated resources.voidcommit()Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)booleancontainsNamedModel(String uri) Does the dataset contain a model with the name supplied?booleancontainsNamedModel(org.apache.jena.rdf.model.Resource uri) Does the dataset contain a model named by the resource supplied?voidend()Finish the transaction - if a write transaction and commit() has not been called, then abortGet the context associated with this datasetorg.apache.jena.rdf.model.ModelGet the default graph as a Jena Modelorg.apache.jena.shared.LockgetLock()Get the lock for this datasetorg.apache.jena.rdf.model.ModelgetNamedModel(String uri) Get a graph by name as a Jena Modelorg.apache.jena.rdf.model.ModelgetNamedModel(org.apache.jena.rdf.model.Resource uri) Get a graph by resource as a Jena Modeldefault org.apache.jena.shared.PrefixMappingGet thePrefixMappingthis dataset.org.apache.jena.rdf.model.ModelGet the graph which is the union of all named graphs as a Jena ModelbooleanisEmpty()booleanSay whether a transaction is activeIterator<org.apache.jena.rdf.model.Resource>List the namesList the namesremoveNamedModel(String uri) Remove a named graph.removeNamedModel(org.apache.jena.rdf.model.Resource resource) Remove a named graph.replaceNamedModel(String uri, org.apache.jena.rdf.model.Model model) Change a named graph for another using the same namereplaceNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model) Change a named graph for another using the same namesetDefaultModel(org.apache.jena.rdf.model.Model model) Set the default graph.booleanDeclare whetherabort()is supported.booleanDoes this dataset support transactions?Methods inherited from interface org.apache.jena.sparql.core.Transactional
begin, begin, calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote, promote, transactionMode, transactionType
-
Method Details
-
getDefaultModel
org.apache.jena.rdf.model.Model getDefaultModel()Get the default graph as a Jena Model -
getUnionModel
org.apache.jena.rdf.model.Model getUnionModel()Get the graph which is the union of all named graphs as a Jena Model -
setDefaultModel
Set the default graph. This operation copies the statements from the model into the default graph of the dataset.- Parameters:
model- the default graph to set- Returns:
- this
Datasetfor continued usage
-
getNamedModel
Get a graph by name as a Jena Model -
getNamedModel
org.apache.jena.rdf.model.Model getNamedModel(org.apache.jena.rdf.model.Resource uri) Get a graph by resource as a Jena Model -
containsNamedModel
Does the dataset contain a model with the name supplied? -
containsNamedModel
boolean containsNamedModel(org.apache.jena.rdf.model.Resource uri) Does the dataset contain a model named by the resource supplied? -
addNamedModel
Add a named graph.- Parameters:
uri- the name of the graph to setmodel- the graph to set- Returns:
- this
Datasetfor continued usage
-
addNamedModel
Dataset addNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model) Add a named graph.- Parameters:
resource- the name of the graph to setmodel- the graph to set- Returns:
- this
Datasetfor continued usage
-
removeNamedModel
Remove a named graph.- Parameters:
uri- the name of the graph to remove- Returns:
- this
Datasetfor continued usage
-
removeNamedModel
Remove a named graph.- Parameters:
resource- the name of the graph to remove- Returns:
- this
Datasetfor continued usage
-
replaceNamedModel
Change a named graph for another using the same name- Parameters:
uri- the name of the graph to replacemodel- the graph with which to replace it- Returns:
- this
Datasetfor continued usage
-
replaceNamedModel
Dataset replaceNamedModel(org.apache.jena.rdf.model.Resource resource, org.apache.jena.rdf.model.Model model) Change a named graph for another using the same name- Parameters:
resource- the name of the graph to replacemodel- the graph with which to replace it- Returns:
- this
Datasetfor continued usage
-
listNames
List the names -
listModelNames
Iterator<org.apache.jena.rdf.model.Resource> listModelNames()List the names -
getLock
org.apache.jena.shared.Lock getLock()Get the lock for this dataset -
getContext
Context getContext()Get the context associated with this dataset -
supportsTransactions
boolean supportsTransactions()Does this dataset support transactions? Supporting transactions means that the dataset implementation providesbegin(org.apache.jena.query.ReadWrite),commit(),end()which otherwise may throwUnsupportedOperationException.See
supportsTransactionAbort()forabort(). ADatasetthat 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 provideabort().In addition, check details of a specific implementation.
-
supportsTransactionAbort
boolean supportsTransactionAbort()Declare whetherabort()is supported. This goes along with clearing up after exceptions inside application transaction code. -
begin
Start either a READ or WRITE transaction- Specified by:
beginin interfaceTransactional
-
commit
void commit()Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction)- Specified by:
commitin interfaceTransactional
-
abort
void abort()Abort a transaction - finish the transaction and undo any changes (if a "write" transaction)- Specified by:
abortin interfaceTransactional
-
isInTransaction
boolean isInTransaction()Say whether a transaction is active- Specified by:
isInTransactionin interfaceTransactional
-
end
void end()Finish the transaction - if a write transaction and commit() has not been called, then abort- Specified by:
endin interfaceTransactional
-
asDatasetGraph
DatasetGraph asDatasetGraph()Get the dataset in graph form -
getPrefixMapping
default org.apache.jena.shared.PrefixMapping getPrefixMapping()Get thePrefixMappingthis dataset.This is an optional operation.
-
close
void close()Close the dataset, potentially releasing any associated resources. The dataset can not be used for query after this call. -
isEmpty
boolean isEmpty()- Returns:
- Whether this
Datasetis empty of triples, whether in the default graph or in any named graph.
-