- All Superinterfaces:
org.apache.jena.graph.Graph
- All Known Implementing Classes:
UnionGraphImpl
public interface UnionGraph
extends org.apache.jena.graph.Graph
Hierarchical graph.
It consists of two parts:
a base graph and an sub-graphs collection.
A hierarchical UnionGraph may have parents, called super-graphs (superGraphs().
Underlying sub-graphs are only used for searching; modify operations are performed only on the base graph.
This graph allows building graph hierarchy which can be used to link different models.
Also, it allows recursion, that is, it can contain itself somewhere in the hierarchy.
The PrefixMapping of this graph is taken from the base graph,
and, therefore, any changes in it reflect both the base and this graph.
Well-formed OWL ontology UnionGraph is expected to contain UnionGraphs as subgraphs,
where graphs also connected by owl:imports relationships.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn enhancedJena Graph Event ManagerandUnionGraph.Listeners.static interface -
Field Summary
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph -
Method Summary
Modifier and TypeMethodDescriptionaddSubGraph(org.apache.jena.graph.Graph graph) Adds the specified graph to the underlying graph collection.default UnionGraphaddSubGraphIfAbsent(org.apache.jena.graph.Graph graph) Adds the specified graph to the underlying graph collection if it is absent.default booleancontains(org.apache.jena.graph.Graph graph) Answerstrueiff thisUnionGraphcontains the specified graph as a subgraph.org.apache.jena.graph.GraphReturns the base (primary) data graph.booleanAnswerstrueiff thisUnionGraphhas sub-graphs.booleanAnswerstrueiff this graph is distinct, which means that the methodGraph.find(Triple)does not produce duplicates.removeSubGraph(org.apache.jena.graph.Graph graph) Removes the specified graph from the underlying graph collection.Stream<org.apache.jena.graph.Graph>Lists all sub-graphs.Lists all parent graphs.Methods inherited from interface org.apache.jena.graph.Graph
add, add, clear, close, contains, contains, delete, delete, dependsOn, find, find, find, getCapabilities, getPrefixMapping, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, remove, size, sizeLong, stream, stream
-
Method Details
-
getEventManager
UnionGraph.EventManager getEventManager()- Specified by:
getEventManagerin interfaceorg.apache.jena.graph.Graph
-
isDistinct
boolean isDistinct()Answerstrueiff this graph is distinct, which means that the methodGraph.find(Triple)does not produce duplicates.- Returns:
- boolean
-
getBaseGraph
org.apache.jena.graph.Graph getBaseGraph()Returns the base (primary) data graph.- Returns:
Graph, notnull
-
hasSubGraph
boolean hasSubGraph()Answerstrueiff thisUnionGraphhas sub-graphs.- Returns:
- boolean
-
subGraphs
Stream<org.apache.jena.graph.Graph> subGraphs()Lists all sub-graphs. Thebase graphis not included in the result.- Returns:
Streamof sub-graphs
-
superGraphs
Stream<UnionGraph> superGraphs()Lists all parent graphs. Thebase graphis not included in the result. -
addSubGraph
Adds the specified graph to the underlying graph collection. If the specified graph isUnionGraph, this graph becomes a super graph (seesuperGraphs())- Parameters:
graph-Graph, notnull- Returns:
- this instance
-
removeSubGraph
Removes the specified graph from the underlying graph collection.- Parameters:
graph-Graph, notnull- Returns:
- this instance
-
addSubGraphIfAbsent
Adds the specified graph to the underlying graph collection if it is absent.- Parameters:
graph-Graph, notnull- Returns:
- this instance
-
contains
default boolean contains(org.apache.jena.graph.Graph graph) Answerstrueiff thisUnionGraphcontains the specified graph as a subgraph.- Parameters:
graph-Graphto test- Returns:
- boolean
-