Package org.apache.jena.sparql.core
Class DatasetOne
- java.lang.Object
-
- org.apache.jena.sparql.core.DatasetImpl
-
- org.apache.jena.sparql.core.DatasetOne
-
- All Implemented Interfaces:
Dataset,Transactional
public class DatasetOne extends DatasetImpl
A dataset that just hold a single model as the default graph. It is particularly appropriate for use with inference models.- API Note:
- This class makes the use of DatasetImpl with one fixed model clearer. It may become useful to have a separate implementation altogether at some time.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
-
Constructor Summary
Constructors Constructor Description DatasetOne(Model model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DatasetaddNamedModel(java.lang.String uri, Model model)Set a named graph.booleancontainsNamedModel(java.lang.String uri)Does the dataset contain a model with the name supplied?static Datasetcreate(Model model)ModelgetDefaultModel()Get the default graph as a Jena ModelModelgetNamedModel(java.lang.String uri)Get a graph by name as a Jena ModelDatasetremoveNamedModel(java.lang.String uri)Remove a named graph.DatasetreplaceNamedModel(java.lang.String uri, Model model)Change a named graph for another using the same nameDatasetsetDefaultModel(Model model)Set the default graph.-
Methods inherited from class org.apache.jena.sparql.core.DatasetImpl
abort, asDatasetGraph, begin, begin, begin, close, commit, end, getContext, getLock, getUnionModel, isEmpty, isInTransaction, listNames, promote, supportsTransactionAbort, supportsTransactions, transactionMode, transactionType, wrap
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jena.query.Dataset
getPrefixMapping
-
Methods inherited from interface org.apache.jena.sparql.core.Transactional
calc, calculate, calculateRead, calculateWrite, exec, execute, executeRead, executeWrite, promote
-
-
-
-
Constructor Detail
-
DatasetOne
public DatasetOne(Model model)
-
-
Method Detail
-
getDefaultModel
public Model getDefaultModel()
Description copied from interface:DatasetGet the default graph as a Jena Model- Specified by:
getDefaultModelin interfaceDataset- Overrides:
getDefaultModelin classDatasetImpl
-
setDefaultModel
public Dataset setDefaultModel(Model model)
Description copied from interface:DatasetSet the default graph. Can be set to null for none.- Specified by:
setDefaultModelin interfaceDataset- Overrides:
setDefaultModelin classDatasetImpl- Parameters:
model- the default graph to set- Returns:
- this
Datasetfor continued usage
-
getNamedModel
public Model getNamedModel(java.lang.String uri)
Description copied from interface:DatasetGet a graph by name as a Jena Model- Specified by:
getNamedModelin interfaceDataset- Overrides:
getNamedModelin classDatasetImpl
-
addNamedModel
public Dataset addNamedModel(java.lang.String uri, Model model)
Description copied from interface:DatasetSet a named graph.- Specified by:
addNamedModelin interfaceDataset- Overrides:
addNamedModelin classDatasetImpl- Parameters:
uri- the name of the graph to setmodel- the graph to set- Returns:
- this
Datasetfor continued usage
-
removeNamedModel
public Dataset removeNamedModel(java.lang.String uri)
Description copied from interface:DatasetRemove a named graph.- Specified by:
removeNamedModelin interfaceDataset- Overrides:
removeNamedModelin classDatasetImpl- Parameters:
uri- the name of the gaph to remove- Returns:
- this
Datasetfor continued usage
-
replaceNamedModel
public Dataset replaceNamedModel(java.lang.String uri, Model model)
Description copied from interface:DatasetChange a named graph for another using the same name- Specified by:
replaceNamedModelin interfaceDataset- Overrides:
replaceNamedModelin classDatasetImpl- Parameters:
uri- the name of the graph to replacemodel- the graph with which to replace it- Returns:
- this
Datasetfor continued usage
-
containsNamedModel
public boolean containsNamedModel(java.lang.String uri)
Description copied from interface:DatasetDoes the dataset contain a model with the name supplied?- Specified by:
containsNamedModelin interfaceDataset- Overrides:
containsNamedModelin classDatasetImpl
-
-