org.trippi.nodegraph
Class NodeGraph

java.lang.Object
  extended by org.trippi.nodegraph.NodeGraph
All Implemented Interfaces:
java.io.Serializable, org.jrdf.graph.Graph

public abstract class NodeGraph
extends java.lang.Object
implements org.jrdf.graph.Graph

A Graph that provides direct node access. This extension of the Graph interface is intended to simplify the task of node-by-node graph traversal.

Author:
cwilper@cs.cornell.edu
See Also:
Serialized Form

Constructor Summary
NodeGraph()
           
 
Method Summary
abstract  NodeResults findObjects(org.jrdf.graph.Node subject, org.jrdf.graph.Node predicate)
          Iterate distinct objects of triples in the graph with the given subject and predicate.
abstract  NodeResults findPredicates(org.jrdf.graph.Node subject, org.jrdf.graph.Node object)
          Iterate distinct predicates of triples in the graph with the given subject and object.
abstract  NodeResults findSubjects(org.jrdf.graph.Node predicate, org.jrdf.graph.Node object)
          Iterate distinct subjects of triples in the graph with the given predicate and object.
abstract  TripleResults findTriples(org.jrdf.graph.Node subject, org.jrdf.graph.Node predicate, org.jrdf.graph.Node object)
          Iterate triples in the graph that match a given subject, predicate and object.
static NodeGraph getInstance(org.jrdf.graph.Graph graph)
          Get an instance that wraps the given JRDF Graph, or a new memory-backed instance if graph is * given as null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jrdf.graph.Graph
add, add, add, contains, contains, find, find, getElementFactory, getNumberOfTriples, getTripleFactory, isEmpty, remove, remove, remove
 

Constructor Detail

NodeGraph

public NodeGraph()
Method Detail

getInstance

public static NodeGraph getInstance(org.jrdf.graph.Graph graph)
                             throws org.jrdf.graph.GraphException
Get an instance that wraps the given JRDF Graph, or a new memory-backed instance if graph is * given as null. If the given graph is already an instance of NodeGraph, it will simply be casted and returned.

Throws:
org.jrdf.graph.GraphException

findSubjects

public abstract NodeResults findSubjects(org.jrdf.graph.Node predicate,
                                         org.jrdf.graph.Node object)
                                  throws org.jrdf.graph.GraphException
Iterate distinct subjects of triples in the graph with the given predicate and object. If either parameter is given as null it will be treated as an unconstrained value (all will match).

Throws:
org.jrdf.graph.GraphException

findPredicates

public abstract NodeResults findPredicates(org.jrdf.graph.Node subject,
                                           org.jrdf.graph.Node object)
                                    throws org.jrdf.graph.GraphException
Iterate distinct predicates of triples in the graph with the given subject and object. If either parameter is given as null it will be treated as an unconstrained value (all will match).

Throws:
org.jrdf.graph.GraphException

findObjects

public abstract NodeResults findObjects(org.jrdf.graph.Node subject,
                                        org.jrdf.graph.Node predicate)
                                 throws org.jrdf.graph.GraphException
Iterate distinct objects of triples in the graph with the given subject and predicate. If either parameter is given as null it will be treated as an unconstrained value (all will match).

Throws:
org.jrdf.graph.GraphException

findTriples

public abstract TripleResults findTriples(org.jrdf.graph.Node subject,
                                          org.jrdf.graph.Node predicate,
                                          org.jrdf.graph.Node object)
                                   throws org.jrdf.graph.GraphException
Iterate triples in the graph that match a given subject, predicate and object. If any parameter is given as null it will be treated as an unconstrained value (all will match).

Throws:
org.jrdf.graph.GraphException