com.hp.hpl.jena.graph.query
Class Query

java.lang.Object
  extended by com.hp.hpl.jena.graph.query.Query

public class Query
extends java.lang.Object

The class of graph queries, plus some machinery (which should move) for implementing them.

Author:
hedgehog

Nested Class Summary
static class Query.UnboundVariableException
          Exception thrown when a query variable is discovered to be unbound.
 
Field Summary
static Node ANY
          A convenient synonym for Node.ANY, used in a match to match anything.
static Node O
          A query variable called "O".
static Node P
          A query variable called "P".
static Node S
          A query variable called "S".
static Node X
          A query variable called "X".
static Node Y
          A query variable called "Y".
static Node Z
          A query variable called "Z".
 
Constructor Summary
Query()
          Initialiser for Query; makes an empty Query [no matches, no constraints]
Query(Graph pattern)
          Initialiser for Query; makes a Query with its matches taken from pattern.
 
Method Summary
 Query addConstraint(Expression e)
           
 Query addMatch(Node s, Node p, Node o)
          Add an (S, P, O) match to the query's collection of match triples.
 Query addMatch(Triple t)
          Add a triple to the query's collection of match triples.
 NamedGraphMap args()
           
 com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(Graph g, java.util.List<Stage> stages, Node[] results)
           
 com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(Graph g, Node[] results)
           
 com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(java.util.List<Stage> outStages, NamedGraphMap args, Node[] nodes)
          the standard "default" implementation of executeBindings.
 com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(NamedGraphMap args, Node[] nodes)
           
 ExpressionSet getConstraints()
           
 java.util.List<Triple> getPattern()
          Answer a list of the triples that have been added to this query.
 TripleSorter getSorter()
           
 int getVariableCount()
           
 void setTripleSorter(TripleSorter ts)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY

public static final Node ANY
A convenient synonym for Node.ANY, used in a match to match anything.


S

public static final Node S
A query variable called "S".


P

public static final Node P
A query variable called "P".


O

public static final Node O
A query variable called "O".


X

public static final Node X
A query variable called "X".


Y

public static final Node Y
A query variable called "Y".


Z

public static final Node Z
A query variable called "Z".

Constructor Detail

Query

public Query()
Initialiser for Query; makes an empty Query [no matches, no constraints]


Query

public Query(Graph pattern)
Initialiser for Query; makes a Query with its matches taken from pattern.

Parameters:
pattern - a Graph whose triples are used as match elements
Method Detail

addMatch

public Query addMatch(Node s,
                      Node p,
                      Node o)
Add an (S, P, O) match to the query's collection of match triples. Return this query for cascading.

Parameters:
s - the node to match the subject
p - the node to match the predicate
o - the node to match the object
Returns:
this Query, for cascading

addMatch

public Query addMatch(Triple t)
Add a triple to the query's collection of match triples. Return this query for cascading.

Parameters:
t - an (S, P, O) triple to add to the collection of matches
Returns:
this Query, for cascading

getPattern

public java.util.List<Triple> getPattern()
Answer a list of the triples that have been added to this query. (Note: ignores "named triples").

Returns:
List

getConstraints

public ExpressionSet getConstraints()

addConstraint

public Query addConstraint(Expression e)

executeBindings

public com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(Graph g,
                                                                              Node[] results)

executeBindings

public com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(Graph g,
                                                                              java.util.List<Stage> stages,
                                                                              Node[] results)

executeBindings

public com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(NamedGraphMap args,
                                                                              Node[] nodes)

executeBindings

public com.hp.hpl.jena.util.iterator.ExtendedIterator<Domain> executeBindings(java.util.List<Stage> outStages,
                                                                              NamedGraphMap args,
                                                                              Node[] nodes)
the standard "default" implementation of executeBindings.


args

public NamedGraphMap args()

getSorter

public TripleSorter getSorter()

setTripleSorter

public void setTripleSorter(TripleSorter ts)

getVariableCount

public int getVariableCount()


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