java.lang.Object
org.apache.jena.sparql.core.DatasetGraphBase
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable
,DatasetGraph
,Transactional
- Direct Known Subclasses:
DatasetGraphBaseFind
,DatasetGraphQuads
DatasetGraph framework : readonly dataset need only provide find(g,s,p,o), getGraph() and getDefaultGraph() although it may wish to override other operations and do better.
Implementations include:
DatasetGraphBase
that adds an implementation of find based on default / named graphs.DatasetGraphInMemory
provides full transactions for an in-memoryDatasetGraph
.DatasetGraphTriplesQuads
that adds mutating quad operations.DatasetGraphMap
provides for operations working over a collection of in-memory graphs.DatasetGraphMapLink
provides for operations working over a collection of graphs provided by the application.DatasetGraphCollection
that provides for operations working over a collection of graphs.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a quadvoid
Add a quadabstract void
Add the given graph to the dataset.void
clear()
Remove everything - remove all named graphs, clear the default graphvoid
close()
Close the datasetboolean
Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or nullboolean
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or nullboolean
containsGraph
(Node graphNode) Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation.void
Delete a quadvoid
Delete a quadvoid
Delete any quads matching the patternstatic void
find()
Iterate over all quads in the dataset graphFind matching quads in the dataset - may include wildcards, Node.ANY or nullGet the context associated with this object - may be nullabstract Graph
Get the default graph as a Jena Graphabstract Graph
Get the graph named by graphNode : returns null when there is no such graph.getLock()
Return a lock for the dataset to help with concurrency controlReturn aGraph
that is the union of all named graphs in this dataset.boolean
isEmpty()
Test whether the dataset is emptyabstract void
removeGraph
(Node graphName) Remove all data associated with the named graph.void
Deprecated.long
size()
Get the size (number of named graphs) - may be -1 for unknowntoString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.jena.sparql.core.DatasetGraph
addAll, find, findNG, listGraphNodes, prefixes, stream, stream, supportsTransactionAbort, supportsTransactions
Methods inherited from interface org.apache.jena.sparql.core.Transactional
abort, begin, begin, begin, calc, calculate, calculateRead, calculateWrite, commit, end, exec, execute, executeRead, executeWrite, isInTransaction, promote, promote, transactionMode, transactionType
-
Method Details
-
containsGraph
Description copied from interface:DatasetGraph
Does the DatasetGraph contain a specific named graph? Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples and this returns true always.- Specified by:
containsGraph
in interfaceDatasetGraph
- Returns:
- boolean
-
getDefaultGraph
Description copied from interface:DatasetGraph
Get the default graph as a Jena Graph- Specified by:
getDefaultGraph
in interfaceDatasetGraph
-
getUnionGraph
Description copied from interface:DatasetGraph
Return aGraph
that is the union of all named graphs in this dataset. This union graph is read-only (its prefix mapping in the current JVM may be changed but that may not persist).- Specified by:
getUnionGraph
in interfaceDatasetGraph
-
getGraph
Description copied from interface:DatasetGraph
Get the graph named by graphNode : returns null when there is no such graph. NB Whether a dataset contains a graph if there are no triples is not defined - see the specific implementation. Some datasets are "open" - they have all graphs even if no triples.- Specified by:
getGraph
in interfaceDatasetGraph
-
addGraph
Description copied from interface:DatasetGraph
Add the given graph to the dataset. Replaces any existing data for the named graph; to add data, get the graph and add triples to it, or add quads to the dataset. Do not assume that the same Java object is returned byDatasetGraph.getGraph(org.apache.jena.graph.Node)
- Specified by:
addGraph
in interfaceDatasetGraph
-
removeGraph
Description copied from interface:DatasetGraph
Remove all data associated with the named graph. This will include prefixes associated with the graph.- Specified by:
removeGraph
in interfaceDatasetGraph
-
setDefaultGraph
Deprecated.Description copied from interface:DatasetGraph
Set the default graph. This replaces the contents default graph, not merge data into it. Do not assume that the same object is returned byDatasetGraph.getDefaultGraph()
- Specified by:
setDefaultGraph
in interfaceDatasetGraph
-
add
Description copied from interface:DatasetGraph
Add a quad- Specified by:
add
in interfaceDatasetGraph
-
delete
Description copied from interface:DatasetGraph
Delete a quad- Specified by:
delete
in interfaceDatasetGraph
-
add
Description copied from interface:DatasetGraph
Add a quad- Specified by:
add
in interfaceDatasetGraph
-
delete
Description copied from interface:DatasetGraph
Delete a quad- Specified by:
delete
in interfaceDatasetGraph
-
deleteAny
Description copied from interface:DatasetGraph
Delete any quads matching the pattern- Specified by:
deleteAny
in interfaceDatasetGraph
-
deleteAny
-
find
Description copied from interface:DatasetGraph
Iterate over all quads in the dataset graph- Specified by:
find
in interfaceDatasetGraph
-
find
Description copied from interface:DatasetGraph
Find matching quads in the dataset - may include wildcards, Node.ANY or null- Specified by:
find
in interfaceDatasetGraph
- See Also:
-
contains
Description copied from interface:DatasetGraph
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null- Specified by:
contains
in interfaceDatasetGraph
-
contains
Description copied from interface:DatasetGraph
Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null- Specified by:
contains
in interfaceDatasetGraph
-
clear
public void clear()Description copied from interface:DatasetGraph
Remove everything - remove all named graphs, clear the default graph- Specified by:
clear
in interfaceDatasetGraph
-
isEmpty
public boolean isEmpty()Description copied from interface:DatasetGraph
Test whether the dataset is empty- Specified by:
isEmpty
in interfaceDatasetGraph
-
size
public long size()Description copied from interface:DatasetGraph
Get the size (number of named graphs) - may be -1 for unknown- Specified by:
size
in interfaceDatasetGraph
-
getLock
Description copied from interface:DatasetGraph
Return a lock for the dataset to help with concurrency control- Specified by:
getLock
in interfaceDatasetGraph
- See Also:
-
getContext
Description copied from interface:DatasetGraph
Get the context associated with this object - may be null- Specified by:
getContext
in interfaceDatasetGraph
-
close
public void close()Description copied from interface:DatasetGraph
Close the dataset- Specified by:
close
in interfaceorg.apache.jena.atlas.lib.Closeable
- Specified by:
close
in interfaceDatasetGraph
-
toString
-