Interface UnionGraph

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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An enhanced Jena Graph Event Manager and UnionGraph.Listeners.
    static interface 
     
  • Field Summary

    Fields inherited from interface org.apache.jena.graph.Graph

    emptyGraph
  • Method Summary

    Modifier and Type
    Method
    Description
    addSubGraph(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)
    Answers true iff this UnionGraph contains the specified graph as a subgraph.
    org.apache.jena.graph.Graph
    Returns the base (primary) data graph.
     
    boolean
    Answers true iff this UnionGraph has sub-graphs.
    boolean
    Answers true iff this graph is distinct, which means that the method Graph.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:
      getEventManager in interface org.apache.jena.graph.Graph
    • isDistinct

      boolean isDistinct()
      Answers true iff this graph is distinct, which means that the method Graph.find(Triple) does not produce duplicates.
      Returns:
      boolean
    • getBaseGraph

      org.apache.jena.graph.Graph getBaseGraph()
      Returns the base (primary) data graph.
      Returns:
      Graph, not null
    • hasSubGraph

      boolean hasSubGraph()
      Answers true iff this UnionGraph has sub-graphs.
      Returns:
      boolean
    • subGraphs

      Stream<org.apache.jena.graph.Graph> subGraphs()
      Lists all sub-graphs. The base graph is not included in the result.
      Returns:
      Stream of sub-graphs
    • superGraphs

      Stream<UnionGraph> superGraphs()
      Lists all parent graphs. The base graph is not included in the result.
      Returns:
      Stream of sub-graphs
    • addSubGraph

      UnionGraph addSubGraph(org.apache.jena.graph.Graph graph)
      Adds the specified graph to the underlying graph collection. If the specified graph is UnionGraph, this graph becomes a super graph (see superGraphs())
      Parameters:
      graph - Graph, not null
      Returns:
      this instance
    • removeSubGraph

      UnionGraph removeSubGraph(org.apache.jena.graph.Graph graph)
      Removes the specified graph from the underlying graph collection.
      Parameters:
      graph - Graph, not null
      Returns:
      this instance
    • addSubGraphIfAbsent

      default UnionGraph addSubGraphIfAbsent(org.apache.jena.graph.Graph graph)
      Adds the specified graph to the underlying graph collection if it is absent.
      Parameters:
      graph - Graph, not null
      Returns:
      this instance
    • contains

      default boolean contains(org.apache.jena.graph.Graph graph)
      Answers true iff this UnionGraph contains the specified graph as a subgraph.
      Parameters:
      graph - Graph to test
      Returns:
      boolean