Package org.apache.jena.sparql.core
Class DatasetGraphFilteredView
- 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-onlyDatasetGraphthat 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
Constructors Constructor Description DatasetGraphFilteredView(DatasetGraph dsg, java.util.function.Predicate<Quad> filter, java.util.Collection<Node> visibleGraphs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Node g, Node s, Node p, Node o)Test whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or nullbooleancontains(Quad quad)Test whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or nulljava.util.Iterator<Quad>find()Iterate over all quads in the dataset graphjava.util.Iterator<Quad>find(Node g, Node s, Node p, Node o)Find matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or nulljava.util.Iterator<Quad>find(Quad quad)Find matching quads in the dataset - may include wildcards, Node.ANY or nulljava.util.Iterator<Quad>findNG(Node g, Node s, Node p, Node o)Find matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or nullGraphgetDefaultGraph()Get the default graph as a Jena GraphGraphgetGraph(Node graphNode)Get the graph named by graphNode : returns null when there is no such graph.GraphgetUnionGraph()Return aGraphthat is the union of all named graphs in this dataset.booleanisEmpty()Test whether the dataset is emptyjava.util.Iterator<Node>listGraphNodes()Iterate over all names of named graphslongsize()Get the size (number of named graphs) - may be -1 for unknownjava.lang.StringtoString()-
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, 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 Detail
-
DatasetGraphFilteredView
public DatasetGraphFilteredView(DatasetGraph dsg, java.util.function.Predicate<Quad> filter, java.util.Collection<Node> visibleGraphs)
-
-
Method Detail
-
getDefaultGraph
public Graph getDefaultGraph()
Description copied from interface:DatasetGraphGet the default graph as a Jena Graph- Specified by:
getDefaultGraphin interfaceDatasetGraph- Overrides:
getDefaultGraphin classDatasetGraphReadOnly
-
getGraph
public Graph getGraph(Node graphNode)
Description copied from interface:DatasetGraphGet 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:
getGraphin interfaceDatasetGraph- Overrides:
getGraphin classDatasetGraphReadOnly
-
listGraphNodes
public java.util.Iterator<Node> listGraphNodes()
Description copied from interface:DatasetGraphIterate over all names of named graphs- Specified by:
listGraphNodesin interfaceDatasetGraph- Overrides:
listGraphNodesin classDatasetGraphWrapper
-
size
public long size()
Description copied from interface:DatasetGraphGet the size (number of named graphs) - may be -1 for unknown- Specified by:
sizein interfaceDatasetGraph- Overrides:
sizein classDatasetGraphWrapper
-
getUnionGraph
public Graph getUnionGraph()
Description copied from interface:DatasetGraphReturn 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).- Specified by:
getUnionGraphin interfaceDatasetGraph- Overrides:
getUnionGraphin classDatasetGraphWrapper
-
find
public java.util.Iterator<Quad> find()
Description copied from interface:DatasetGraphIterate over all quads in the dataset graph- Specified by:
findin interfaceDatasetGraph- Overrides:
findin classDatasetGraphWrapper
-
find
public java.util.Iterator<Quad> find(Node g, Node s, Node p, Node o)
Description copied from interface:DatasetGraphFind matching quads in the dataset (including default graph) - may include wildcards, Node.ANY or null- Specified by:
findin interfaceDatasetGraph- Overrides:
findin classDatasetGraphWrapper- See Also:
Graph.find(Node,Node,Node)
-
find
public java.util.Iterator<Quad> find(Quad quad)
Description copied from interface:DatasetGraphFind matching quads in the dataset - may include wildcards, Node.ANY or null- Specified by:
findin interfaceDatasetGraph- Overrides:
findin classDatasetGraphWrapper- See Also:
Graph.find(Triple)
-
findNG
public java.util.Iterator<Quad> findNG(Node g, Node s, Node p, Node o)
Description copied from interface:DatasetGraphFind matching quads in the dataset in named graphs only - may include wildcards, Node.ANY or null- Specified by:
findNGin interfaceDatasetGraph- Overrides:
findNGin classDatasetGraphWrapper- See Also:
Graph.find(Node,Node,Node)
-
contains
public boolean contains(Node g, Node s, Node p, Node o)
Description copied from interface:DatasetGraphTest whether the dataset (including default graph) contains a quad - may include wildcards, Node.ANY or null- Specified by:
containsin interfaceDatasetGraph- Overrides:
containsin classDatasetGraphWrapper
-
contains
public boolean contains(Quad quad)
Description copied from interface:DatasetGraphTest whether the dataset contains a quad (including default graph)- may include wildcards, Node.ANY or null- Specified by:
containsin interfaceDatasetGraph- Overrides:
containsin classDatasetGraphWrapper
-
isEmpty
public boolean isEmpty()
Description copied from interface:DatasetGraphTest whether the dataset is empty- Specified by:
isEmptyin interfaceDatasetGraph- Overrides:
isEmptyin classDatasetGraphWrapper
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDatasetGraphWrapper
-
-