Package org.apache.jena.graph.compose
Class CompositionBase
- java.lang.Object
-
- org.apache.jena.graph.impl.GraphBase
-
- org.apache.jena.graph.compose.CompositionBase
-
- All Implemented Interfaces:
Graph
,GraphWithPerform
public abstract class CompositionBase extends GraphBase
Base class for graphs that are composed of multiple sub-graphs. This is to provide a home for shared functionality that was previously in
Dyadic
before refactoring.
-
-
Field Summary
-
Fields inherited from class org.apache.jena.graph.impl.GraphBase
TOSTRING_TRIPLE_BASE, TOSTRING_TRIPLE_LIMIT
-
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
-
Constructor Summary
Constructors Constructor Description CompositionBase()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ClosableIterator<T>
butNot(ClosableIterator<T> a, ClosableIterator<? extends T> b)
Answer an iterator over the elements of iterator a that are not members of iterator b.static java.util.function.Predicate<Triple>
ifIn(Graph g)
Answer aPredicate
that will accept any triple that is an edge of graph g.static <T> java.util.function.Predicate<T>
ifIn(ClosableIterator<T> i)
Answer aPredicate
that will accept any object that is an element of iterator i.static <T> ExtendedIterator<T>
recording(ClosableIterator<T> i, java.util.Set<T> seen)
Answer an iterator that will record every element delived bynext()
in the setseen
.static <T> java.util.function.Predicate<T>
reject(ClosableIterator<? extends T> i)
Answer aPredicate
that will reject any element that is a member of iterator i.static ExtendedIterator<Triple>
rejecting(ExtendedIterator<Triple> i, java.util.Set<Triple> seen)
Answer an iterator over the elements of iterator i that are not in the setseen
.static ExtendedIterator<Triple>
rejecting(ExtendedIterator<Triple> i, Graph seen)
Answer an iterator over the elements ofi
that are not in the graphseen
.-
Methods inherited from class org.apache.jena.graph.impl.GraphBase
add, clear, close, contains, contains, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getCapabilities, getEventManager, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, performAdd, performDelete, remove, size, toString, toString
-
-
-
-
Method Detail
-
reject
public static <T> java.util.function.Predicate<T> reject(ClosableIterator<? extends T> i)
Answer a
Predicate
that will reject any element that is a member of iterator i. As a side-effect, i will be closed.- Parameters:
i
- A closable iterator- Returns:
- A Predicate that will accept any object not a member of i.
-
butNot
public static <T> ClosableIterator<T> butNot(ClosableIterator<T> a, ClosableIterator<? extends T> b)
Answer an iterator over the elements of iterator a that are not members of iterator b. As a side-effect, iterator b will be closed.
- Parameters:
a
- An iterator that will be filtered by rejecting the elements of bb
- A closable iterator- Returns:
- The iteration of elements in a but not in b.
-
recording
public static <T> ExtendedIterator<T> recording(ClosableIterator<T> i, java.util.Set<T> seen)
Answer an iterator that will record every element delived by
next()
in the setseen
.- Parameters:
i
- A closable iteratorseen
- A set that will record each element of i in turn- Returns:
- An iterator that records the elements of i.
-
rejecting
public static ExtendedIterator<Triple> rejecting(ExtendedIterator<Triple> i, java.util.Set<Triple> seen)
Answer an iterator over the elements of iterator i that are not in the set
seen
.- Parameters:
i
- An extended iteratorseen
- A set of objects- Returns:
- An iterator over the elements of i that are not in the set
seen
.
-
rejecting
public static ExtendedIterator<Triple> rejecting(ExtendedIterator<Triple> i, Graph seen)
Answer an iterator over the elements ofi
that are not in the graphseen
.
-
ifIn
public static <T> java.util.function.Predicate<T> ifIn(ClosableIterator<T> i)
Answer a
Predicate
that will accept any object that is an element of iterator i. As a side-effect, i will be evaluated and closed.- Parameters:
i
- A closable iterator- Returns:
- A Predicate that will accept any object in iterator i.
-
-