Package org.apache.jena.graph.impl
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 java.lang.Object implements GraphWithPerform
A wrapper class which simply defers all operations to its base.
-
-
Field Summary
-
Fields inherited from interface org.apache.jena.graph.Graph
emptyGraph
-
-
Constructor Summary
Constructors Constructor Description WrappedGraph(Graph base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Triple t)
Add the triple t (if possible) to the set belonging to this graphvoid
clear()
Remove all the statements from this graph.void
close()
Free all resources, any further use of this Graph is an error.boolean
contains(Node s, Node p, Node o)
Answer true iff the graph contains a triple matching (s, p, o).boolean
contains(Triple t)
Answer true iff the graph contains a triple that t matches; t may be fluid.void
delete(Triple t)
Delete the triple t (if possible) from the set belonging to this graphboolean
dependsOn(Graph other)
true if this graph's content depends on the other graph.ExtendedIterator<Triple>
find(Node s, Node p, Node o)
Returns an iterator over Triples matching a pattern.ExtendedIterator<Triple>
find(Triple m)
Returns an iterator over all the Triples that match the triple pattern.Capabilities
getCapabilities()
returns this Graph's capabilitiesGraphEventManager
getEventManager()
Answer this Graph's event manager.PrefixMapping
getPrefixMapping()
returns this Graph's prefix mapping.TransactionHandler
getTransactionHandler()
returns this Graph's transaction handlerGraph
getWrapped()
boolean
isClosed()
Answer true iff .close() has been called on this Graph.boolean
isEmpty()
Answer true iff this graph is empty.boolean
isIsomorphicWith(Graph g)
Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#section-Graph-syntaxvoid
performAdd(Triple t)
addt
to this graph, but do not generate any eventvoid
performDelete(Triple t)
removet
from this graph, but do not generate any eventvoid
remove(Node s, Node p, Node o)
Remove all triples that match by find(s, p, o)int
size()
For a concrete graph this returns the number of triples in the graph.
-
-
-
Constructor Detail
-
WrappedGraph
public WrappedGraph(Graph base)
-
-
Method Detail
-
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.
-
getTransactionHandler
public TransactionHandler getTransactionHandler()
Description copied from interface:Graph
returns this Graph's transaction handler- Specified by:
getTransactionHandler
in interfaceGraph
-
getCapabilities
public Capabilities getCapabilities()
Description copied from interface:Graph
returns this Graph's capabilities- Specified by:
getCapabilities
in interfaceGraph
-
getEventManager
public GraphEventManager getEventManager()
Description copied from interface:Graph
Answer this Graph's event manager.- Specified by:
getEventManager
in interfaceGraph
-
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 interfaceGraph
-
add
public void add(Triple t)
Description copied from interface:Graph
Add the triple t (if possible) to the set belonging to this 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
-
clear
public void clear()
Description copied from interface:Graph
Remove all the statements from this 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)
-
find
public ExtendedIterator<Triple> find(Triple m)
Description copied from interface:Graph
Returns an iterator over all the Triples that match the triple pattern.
-
find
public ExtendedIterator<Triple> find(Node s, Node p, Node o)
Description copied from interface:Graph
Returns an iterator over Triples matching a 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- Specified by:
isIsomorphicWith
in interfaceGraph
- 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.
-
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.
-
close
public void close()
Description copied from interface:Graph
Free all resources, any further use of this Graph is an error.
-
isClosed
public boolean isClosed()
Description copied from interface:Graph
Answer true iff .close() has been called on this 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.
-
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.
-
performAdd
public void performAdd(Triple t)
Description copied from interface:GraphWithPerform
addt
to this graph, but do not generate any event- Specified by:
performAdd
in interfaceGraphWithPerform
-
performDelete
public void performDelete(Triple t)
Description copied from interface:GraphWithPerform
removet
from this graph, but do not generate any event- Specified by:
performDelete
in interfaceGraphWithPerform
-
-