Class WrappedGraph

java.lang.Object
org.apache.jena.graph.impl.WrappedGraph
All Implemented Interfaces:
Graph, GraphWithPerform
Direct Known Subclasses:
GraphPlain, MonitorGraph, RandomOrderGraph, SafeGraph

public class WrappedGraph extends Object implements GraphWithPerform
A wrapper class which simply defers all operations to its base.
  • Constructor Details

    • WrappedGraph

      public WrappedGraph(Graph base)
  • Method Details

    • getWrapped

      public Graph getWrapped()
    • dependsOn

      public boolean dependsOn(Graph other)
      Description copied from interface: Graph
      true if this graph's content depends on the other graph. May be pessimistic (ie return true if it's not sure). Typically true when a graph is a composition of other graphs, eg union.
      Specified by:
      dependsOn in interface Graph
      Parameters:
      other - the graph this graph may depend on
      Returns:
      false if this does not depend on other
    • getTransactionHandler

      public TransactionHandler getTransactionHandler()
      Description copied from interface: Graph
      returns this Graph's transaction handler
      Specified by:
      getTransactionHandler in interface Graph
    • getCapabilities

      public Capabilities getCapabilities()
      Description copied from interface: Graph
      returns this Graph's capabilities
      Specified by:
      getCapabilities in interface Graph
    • getEventManager

      public GraphEventManager getEventManager()
      Description copied from interface: Graph
      Answer this Graph's event manager.
      Specified by:
      getEventManager in interface Graph
    • getPrefixMapping

      public PrefixMapping getPrefixMapping()
      Description copied from interface: Graph
      returns this Graph's prefix mapping. Each call on a given Graph gets the same PrefixMapping object, which is the one used by the Graph.
      Specified by:
      getPrefixMapping in interface Graph
    • add

      public void add(Triple t)
      Description copied from interface: Graph
      Add the triple t (if possible) to the set belonging to this graph
      Specified by:
      add in interface Graph
      Parameters:
      t - the triple to add to the graph
    • delete

      public void delete(Triple t)
      Description copied from interface: Graph
      Delete the triple t (if possible) from the set belonging to this graph
      Specified by:
      delete in interface Graph
      Parameters:
      t - the triple to delete to the graph
    • clear

      public void clear()
      Description copied from interface: Graph
      Remove all the statements from this graph.
      Specified by:
      clear in interface Graph
    • remove

      public void remove(Node s, Node p, Node o)
      Description copied from interface: Graph
      Remove all triples that match by find(s, p, o)
      Specified by:
      remove in interface Graph
    • find

      public ExtendedIterator<Triple> find(Triple m)
      Description copied from interface: Graph
      Returns an iterator over all the Triples that match the triple pattern.
      Specified by:
      find in interface Graph
      Parameters:
      m - a Triple encoding the pattern to look for
      Returns:
      an iterator of all triples in this graph that match m
    • find

      public ExtendedIterator<Triple> find(Node s, Node p, Node o)
      Description copied from interface: Graph
      Returns an iterator over Triples matching a pattern.
      Specified by:
      find in interface Graph
      Returns:
      an iterator of triples in this graph matching the pattern.
    • isIsomorphicWith

      public boolean isIsomorphicWith(Graph g)
      Description copied from interface: Graph
      Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#section-Graph-syntax Note: this implementation does not handle correctly blank nodes in quoted triples (RDF-star). If you need to work with RDF-star, use the slower implementation in org.apache.jena.sparql.util.IsoMatcher.
      Specified by:
      isIsomorphicWith in interface Graph
      Parameters:
      g - Compare against this.
      Returns:
      boolean True if the two graphs are isomorphic.
    • contains

      public boolean contains(Node s, Node p, Node o)
      Description copied from interface: Graph
      Answer true iff the graph contains a triple matching (s, p, o). s/p/o may be concrete or fluid. Equivalent to find(s,p,o).hasNext, but an implementation is expected to optimise this in easy cases.
      Specified by:
      contains in interface Graph
    • contains

      public boolean contains(Triple t)
      Description copied from interface: Graph
      Answer true iff the graph contains a triple that t matches; t may be fluid.
      Specified by:
      contains in interface Graph
    • close

      public void close()
      Description copied from interface: Graph
      Free all resources, any further use of this Graph is an error.
      Specified by:
      close in interface Graph
    • isClosed

      public boolean isClosed()
      Description copied from interface: Graph
      Answer true iff .close() has been called on this Graph.
      Specified by:
      isClosed in interface Graph
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Graph
      Answer true iff this graph is empty. "Empty" means "has as few triples as it can manage", because an inference graph may have irremovable axioms and their consequences.
      Specified by:
      isEmpty in interface Graph
    • size

      public int size()
      Description copied from interface: Graph
      For a concrete graph, this returns the number of triples in the graph. For graphs which might infer additional triples it results an estimated lower bound of the number of triples. For example, an inference graph might return the number of triples in the raw data graph.
      Specified by:
      size in interface Graph
      See Also:
    • performAdd

      public void performAdd(Triple t)
      Description copied from interface: GraphWithPerform
      add t to this graph, but do not generate any event
      Specified by:
      performAdd in interface GraphWithPerform
    • performDelete

      public void performDelete(Triple t)
      Description copied from interface: GraphWithPerform
      remove t from this graph, but do not generate any event
      Specified by:
      performDelete in interface GraphWithPerform