- All Superinterfaces:
org.apache.jena.atlas.lib.Closeable,Transactional
- All Known Subinterfaces:
DatasetGraphBuffering,DatasetGraphWrapperView
- All Known Implementing Classes:
BufferingDatasetGraph,DatasetGraphBase,DatasetGraphBaseFind,DatasetGraphCollection,DatasetGraphFilteredView,DatasetGraphInMemory,DatasetGraphMap,DatasetGraphMapLink,DatasetGraphMonitor,DatasetGraphNull,DatasetGraphOne,DatasetGraphQuads,DatasetGraphRDFS,DatasetGraphReadOnly,DatasetGraphSink,DatasetGraphTriplesQuads,DatasetGraphWrapper,DatasetGraphZero,DifferenceDatasetGraph,DyadicDatasetGraph,DynamicDatasets.DynamicDatasetGraph,IntersectionDatasetGraph,UnionDatasetGraph
DatasetGraph: The graph representation of an RDF Dataset. See
Dataset
for the Model level of an RDF dataset.
Whether a dataset contains a graph if there are no triples is not defined; see the specific implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a quadvoidAdd a quaddefault voidaddAll(DatasetGraph src) Add thesrcDatasetGraph to this one.voidAdd the given graph to the dataset.voidclear()Remove everything - remove all named graphs, clear the default graphvoidclose()Close the datasetbooleanTest whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or nullbooleanTest whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or nullbooleancontainsGraph(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.voidDelete a quadvoidDelete a quadvoidDelete any quads matching the patternfind()Iterate over all quads in the dataset graphFind matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or nullFind matching quads in the dataset - may include wildcards, Node.ANY or nullFind matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or nullGet the context associated with this object - may be nullGet the default graph as a Jena GraphGet 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 aGraphthat is the union of all named graphs in this dataset.booleanisEmpty()Test whether the dataset is emptyIterate over all names of named graphsprefixes()Prefixes for this DatasetGraphvoidremoveGraph(Node graphName) Remove all data associated with the named graph.voidDeprecated.Do not use.longsize()Get the size (number of named graphs) - may be -1 for unknownstream()default booleanDeclare whetherTransactional.abort()is supported.booleanADatasetGraphsupports transactions if it providesTransactional.begin()/Transactional.commit()/Transactional.end().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
-
getDefaultGraph
Graph getDefaultGraph()Get the default graph as a Jena Graph -
getGraph
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. -
getUnionGraph
Graph getUnionGraph()Return aGraphthat 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). -
containsGraph
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.- Parameters:
graphNode-- Returns:
- boolean
-
setDefaultGraph
Deprecated.Do not use. To be removed.Set the default graph. This replaces the contents default graph, not merge data into it. Do not assume that the same object is returned bygetDefaultGraph() -
addGraph
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 bygetGraph(org.apache.jena.graph.Node) -
removeGraph
Remove all data associated with the named graph. This will include prefixes associated with the graph. -
listGraphNodes
Iterate over all names of named graphs -
add
Add a quad -
delete
Delete a quad -
add
Add a quad -
addAll
Add thesrcDatasetGraph to this one. -
delete
Delete a quad -
deleteAny
Delete any quads matching the pattern -
find
Iterate over all quads in the dataset graph -
find
Find matching quads in the dataset - may include wildcards, Node.ANY or null- See Also:
-
find
Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null- See Also:
-
findNG
Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null- See Also:
-
stream
- Returns:
- a stream of quads in this dataset matching the pattern.
-
stream
- Returns:
- a stream of quads in this dataset.
-
contains
Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null -
contains
Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null -
clear
void clear()Remove everything - remove all named graphs, clear the default graph -
isEmpty
boolean isEmpty()Test whether the dataset is empty -
getLock
Lock getLock()Return a lock for the dataset to help with concurrency control- See Also:
-
getContext
Context getContext()Get the context associated with this object - may be null -
size
long size()Get the size (number of named graphs) - may be -1 for unknown -
close
void close()Close the dataset- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable
-
prefixes
PrefixMap prefixes()Prefixes for this DatasetGraph -
supportsTransactions
boolean supportsTransactions()ADatasetGraphsupports transactions if it providesTransactional.begin()/Transactional.commit()/Transactional.end(). The core storageDatasetGraphs provide fully serialized transactions. ADatasetGraphthat provides functionality across independent systems can not provide such strong guarantees. For example, it may use MRSW locking and some isolation control. Specifically, it would not necessarily provideTransactional.abort().See
supportsTransactionAbort()forTransactional.abort(). In addition, check details of a specific implementation. -
supportsTransactionAbort
default boolean supportsTransactionAbort()Declare whetherTransactional.abort()is supported. This goes along with clearing up after exceptions inside application transaction code.
-