Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.graph.query
Class SimpleQueryHandler

    java.lang.Object
      com.hp.hpl.jena.graph.query.SimpleQueryHandler

All Implemented Interfaces:
  QueryHandler

    public class SimpleQueryHandler

extends java.lang.Object
implements QueryHandler

A SimpleQueryHandler is a more-or-less straightforward implementation of QueryHandler suitable for use on graphs with no special query engines.

Author:
  kers

Constructor Summary
`SimpleQueryHandler(Graph graph)` make an instance, remember the graph

Method Summary
`boolean` | `containsNode(Node n)` this is a simple-minded implementation of containsNode that uses find up to three times to locate the node.
`static ExtendedIterator` | `objectsFor(Graph g, Node s, Node p)`
`ExtendedIterator` | `objectsFor(Node s, Node p)` deliver an iterator over all the objects _o_ such that _(s, p, o)_ is in the underlying graph; nulls count as wildcards. .remove() is not defined on this iterator.
`Stage` | `patternStage(Mapping map, ExpressionSet constraints, Triple[] t)` produce a single Stage which will probe the underlying graph for triples matching p and inject all the resulting bindings into the processing stream (see Stage for details) _map_ is the variable binding map to use and update.
`static ExtendedIterator` | `predicatesFor(Graph g, Node s, Node o)`
`ExtendedIterator` | `predicatesFor(Node s, Node o)` Answer an iterator over all the predicates `p` such that `(s, p, o)` is in the underlying graph. .remove() is not defined on this iterator.
`BindingQueryPlan` | `prepareBindings(Query q, Node[] variables)` prepare a plan for generating bindings given the query _q_ and the result variables _variables_.
`TreeQueryPlan` | `prepareTree(Graph pattern)` deliver a plan for executing the tree-match query defined by _pattern_.
`static ExtendedIterator` | `subjectsFor(Graph g, Node p, Node o)`
`ExtendedIterator` | `subjectsFor(Node p, Node o)` deliver an iterator over all the subjects _s_ such that _(s, p, o)_ is in the underlying graph; nulls count as wildcards. .remove() is not defined on this iterator.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleQueryHandler

    public SimpleQueryHandler(Graph graph)

  make an instance, remember the graph

Method Detail

### patternStage

    public Stage patternStage(Mapping map,
                              ExpressionSet constraints,
                              Triple[] t)

  Description copied from interface: `QueryHandler`
  produce a single Stage which will probe the underlying graph for triples matching p and inject all the resulting bindings into the processing stream (see Stage for details)

  _map_ is the variable binding map to use and update. _constraints_ is the current constraint expression: if this Stage can absorb some of the ANDed constraints, it may do so, and remove them from the ExpressionSet.

  Specified by:
    `patternStage` in interface `QueryHandler`

### prepareBindings

    public BindingQueryPlan prepareBindings(Query q,
                                            Node[] variables)

  Description copied from interface: `QueryHandler`
  prepare a plan for generating bindings given the query _q_ and the result variables _variables_.

  Specified by:
    `prepareBindings` in interface `QueryHandler`

### prepareTree

    public TreeQueryPlan prepareTree(Graph pattern)

  Description copied from interface: `QueryHandler`
  deliver a plan for executing the tree-match query defined by _pattern_.

  Specified by:
    `prepareTree` in interface `QueryHandler`

### objectsFor

    public ExtendedIterator objectsFor(Node s,
                                       Node p)

  Description copied from interface: `QueryHandler`
  deliver an iterator over all the objects _o_ such that _(s, p, o)_ is in the underlying graph; nulls count as wildcards. .remove() is not defined on this iterator.

  Specified by:
    `objectsFor` in interface `QueryHandler`

### subjectsFor

    public ExtendedIterator subjectsFor(Node p,
                                        Node o)

  Description copied from interface: `QueryHandler`
  deliver an iterator over all the subjects _s_ such that _(s, p, o)_ is in the underlying graph; nulls count as wildcards. .remove() is not defined on this iterator.

  Specified by:
    `subjectsFor` in interface `QueryHandler`

### predicatesFor

    public ExtendedIterator predicatesFor(Node s,
                                          Node o)

  Description copied from interface: `QueryHandler`
  Answer an iterator over all the predicates `p` such that `(s, p, o)` is in the underlying graph. .remove() is not defined on this iterator.

  Specified by:
    `predicatesFor` in interface `QueryHandler`

### objectsFor

    public static ExtendedIterator objectsFor(Graph g,
                                              Node s,
                                              Node p)

### subjectsFor

    public static ExtendedIterator subjectsFor(Graph g,
                                               Node p,
                                               Node o)

### predicatesFor

    public static ExtendedIterator predicatesFor(Graph g,
                                                 Node s,
                                                 Node o)

### containsNode

    public boolean containsNode(Node n)

  this is a simple-minded implementation of containsNode that uses find up to three times to locate the node. Almost certainly particular graphs will be able to offer better query-handlers ...

  Specified by:
    `containsNode` in interface `QueryHandler`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP