java.lang.Object
org.apache.jena.sparql.core.DatasetGraphWrapper
org.apache.jena.sparql.core.DatasetGraphReadOnly
org.apache.jena.sparql.core.DatasetGraphFilteredView
- All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable
,org.apache.jena.atlas.lib.Sync
,DatasetGraph
,DatasetGraphWrapperView
,Transactional
public class DatasetGraphFilteredView
extends DatasetGraphReadOnly
implements DatasetGraphWrapperView
A read-only
DatasetGraph
that applies a filter testing all triples and quads
returned by accessing the data. Only quads where the filter tests for "true" are exposed.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.sparql.core.Transactional
Transactional.Promote
-
Constructor Summary
ConstructorsConstructorDescriptionDatasetGraphFilteredView
(DatasetGraph dsg, Predicate<Quad> filter, Collection<Node> visibleGraphs) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 nullfind()
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 default graph as a Jena GraphGet the graph named by graphNode : returns null when there is no such graph.Return aGraph
that is the union of all named graphs in this dataset.boolean
isEmpty()
Test whether the dataset is emptyIterate over all names of named graphslong
size()
Get the size (number of named graphs) - may be -1 for unknowntoString()
Methods inherited from class org.apache.jena.sparql.core.DatasetGraphReadOnly
begin, close
Methods inherited from class org.apache.jena.sparql.core.DatasetGraphWrapper
abort, add, add, addGraph, begin, begin, clear, commit, containsGraph, delete, delete, deleteAny, end, getBase, getBaseForQuery, getContext, getLock, getWrapped, isInTransaction, prefixes, promote, promote, removeGraph, setDefaultGraph, supportsTransactionAbort, supportsTransactions, sync, transactionMode, transactionType, unwrap
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
add, add, addAll, addGraph, clear, close, containsGraph, delete, delete, deleteAny, getContext, getLock, prefixes, removeGraph, setDefaultGraph, 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
-
Constructor Details
-
DatasetGraphFilteredView
public DatasetGraphFilteredView(DatasetGraph dsg, Predicate<Quad> filter, Collection<Node> visibleGraphs)
-
-
Method Details
-
getDefaultGraph
Description copied from interface:DatasetGraph
Get the default graph as a Jena Graph- Specified by:
getDefaultGraph
in interfaceDatasetGraph
- Overrides:
getDefaultGraph
in classDatasetGraphReadOnly
-
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
- Overrides:
getGraph
in classDatasetGraphReadOnly
-
listGraphNodes
Description copied from interface:DatasetGraph
Iterate over all names of named graphs- Specified by:
listGraphNodes
in interfaceDatasetGraph
- Overrides:
listGraphNodes
in classDatasetGraphWrapper
-
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
- Overrides:
size
in classDatasetGraphWrapper
-
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
- Overrides:
getUnionGraph
in classDatasetGraphWrapper
-
find
Description copied from interface:DatasetGraph
Iterate over all quads in the dataset graph- Specified by:
find
in interfaceDatasetGraph
- Overrides:
find
in classDatasetGraphWrapper
-
find
Description copied from interface:DatasetGraph
Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null- Specified by:
find
in interfaceDatasetGraph
- Overrides:
find
in classDatasetGraphWrapper
- See Also:
-
find
Description copied from interface:DatasetGraph
Find matching quads in the dataset - may include wildcards, Node.ANY or null- Specified by:
find
in interfaceDatasetGraph
- Overrides:
find
in classDatasetGraphWrapper
- See Also:
-
findNG
Description copied from interface:DatasetGraph
Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null- Specified by:
findNG
in interfaceDatasetGraph
- Overrides:
findNG
in classDatasetGraphWrapper
- See Also:
-
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
- Overrides:
contains
in classDatasetGraphWrapper
-
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
- Overrides:
contains
in classDatasetGraphWrapper
-
isEmpty
public boolean isEmpty()Description copied from interface:DatasetGraph
Test whether the dataset is empty- Specified by:
isEmpty
in interfaceDatasetGraph
- Overrides:
isEmpty
in classDatasetGraphWrapper
-
toString
- Overrides:
toString
in classDatasetGraphWrapper
-