 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 subgraphs
collection.
A hierarchical UnionGraph may have parents, called supergraphs (superGraphs()
.
Underlying subgraphs 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.
Wellformed OWL ontology UnionGraph
is expected to contain UnionGraph
s as subgraphs,
where graphs also connected by owl:imports
relationships.

Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An enhancedJena Graph Event Manager
andUnionGraph.Listener
s.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 UnionGraph
addSubGraphIfAbsent
(org.apache.jena.graph.Graph graph) Adds the specified graph to the underlying graph collection if it is absent.default boolean
contains
(org.apache.jena.graph.Graph graph) Answerstrue
iff thisUnionGraph
contains the specified graph as a subgraph.org.apache.jena.graph.Graph
Returns the base (primary) data graph.boolean
Answerstrue
iff thisUnionGraph
has subgraphs.boolean
Answerstrue
iff 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 subgraphs.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:
getEventManager
in interfaceorg.apache.jena.graph.Graph

isDistinct
boolean isDistinct()Answerstrue
iff 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()Answerstrue
iff thisUnionGraph
has subgraphs. Returns:
 boolean

subGraphs
Stream<org.apache.jena.graph.Graph> subGraphs()Lists all subgraphs. Thebase graph
is not included in the result. Returns:
Stream
of subgraph
s

superGraphs
Stream<UnionGraph> superGraphs()Lists all parent graphs. Thebase graph
is 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) Answerstrue
iff thisUnionGraph
contains the specified graph as a subgraph. Parameters:
graph
Graph
to test Returns:
 boolean
