com.hp.hpl.jena.graph
Interface Graph

All Known Subinterfaces:
InfGraph
All Known Implementing Classes:
BaseInfGraph, Delta, Difference, com.hp.hpl.jena.graph.impl.GraphBase, GraphRDB, Intersection, Union

public interface Graph

Author:
Jeremy Carroll

Field Summary
static int ADD
           
static int DELETE
           
static int ORDERED
           
static int SIZE
           
 
Method Summary
 void add(Triple t)
          Add the triple t (if possible) to the set belonging to this graph
 int capabilities()
          Returns the bitwise or of ADD, DELETE, SIZE and ORDERED, to show the capabilities of this implementation of 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)
          Remove the triple t (if possible) from the set belonging to this graph
 boolean dependsOn(Graph other)
          true if this graph's content depends on the other graph.
 ExtendedIterator find(Node s, Node p, Node o)
          Returns an iterator over Triple.
 ExtendedIterator find(TripleMatch m)
          Returns an iterator over all the Triples that match the triple pattern.
 BulkUpdateHandler getBulkUpdateHandler()
          returns this Graph's bulk-update handler
 Capabilities getCapabilities()
          returns this Graph's capabilities
 GraphEventManager getEventManager()
          Answer this Graph's event manager.
 com.hp.hpl.jena.shared.PrefixMapping getPrefixMapping()
          returns this Graph's prefix mapping.
 Reifier getReifier()
          returns this Graph's reifier.
 TransactionHandler getTransactionHandler()
          returns this Graph's transaction handler
 boolean isIsomorphicWith(Graph g)
          Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#section-Graph-syntax
 QueryHandler queryHandler()
          returns this Graph's query handler
 int size()
           
 

Field Detail

ADD

public static final int ADD
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

SIZE

public static final int SIZE
See Also:
Constant Field Values

ORDERED

public static final int ORDERED
See Also:
Constant Field Values
Method Detail

dependsOn

public boolean dependsOn(Graph other)
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.

Parameters:
other - the graph this graph may depend on
Returns:
false if this does not depend on other

queryHandler

public QueryHandler queryHandler()
returns this Graph's query handler


getTransactionHandler

public TransactionHandler getTransactionHandler()
returns this Graph's transaction handler


getBulkUpdateHandler

public BulkUpdateHandler getBulkUpdateHandler()
returns this Graph's bulk-update handler


getCapabilities

public Capabilities getCapabilities()
returns this Graph's capabilities


getEventManager

public GraphEventManager getEventManager()
Answer this Graph's event manager.


getReifier

public Reifier getReifier()
returns this Graph's reifier. Each call on a given Graph gets the same Reifier object.


getPrefixMapping

public com.hp.hpl.jena.shared.PrefixMapping getPrefixMapping()
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.


add

public void add(Triple t)
         throws com.hp.hpl.jena.shared.JenaAddDeniedException
Add the triple t (if possible) to the set belonging to this graph

Parameters:
t - the triple to add to the graph
Throws:
com.hp.hpl.jena.shared.JenaAddDeniedException - if the triple cannot be added

delete

public void delete(Triple t)
            throws com.hp.hpl.jena.shared.JenaDeleteDeniedException
Remove the triple t (if possible) from the set belonging to this graph

Parameters:
t - the triple to add to the graph
Throws:
com.hp.hpl.jena.shared.JenaDeleteDeniedException - if the triple cannot be removed

find

public ExtendedIterator find(TripleMatch m)
Returns an iterator over all the Triples that match the triple pattern.

Parameters:
m - a Triple[Match] encoding the pattern to look for
Returns:
an iterator of all triples in this graph that match m

find

public ExtendedIterator find(Node s,
                             Node p,
                             Node o)
Returns an iterator over Triple.


isIsomorphicWith

public boolean isIsomorphicWith(Graph g)
Compare this graph with another using the method described in http://www.w3.org/TR/rdf-concepts#section-Graph-syntax

Parameters:
g - Compare against this.
Returns:
boolean True if the two graphs are isomorphic.

contains

public boolean contains(Node s,
                        Node p,
                        Node o)
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)
Answer true iff the graph contains a triple that t matches; t may be fluid.


close

public void close()
Free all resources, any further use of this Graph is an error.


size

public int size()
         throws java.lang.UnsupportedOperationException
Throws:
java.lang.UnsupportedOperationException

capabilities

public int capabilities()
Returns the bitwise or of ADD, DELETE, SIZE and ORDERED, to show the capabilities of this implementation of Graph. So a read-only graph that finds in an unordered fashion, but can tell you how many triples are in the graph returns SIZE.



Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.