01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query;
07:
08: import org.openrdf.model.Value;
09:
10: /**
11: * A query on a {@link Repository} that can be formulated in one of the
12: * supported query languages (for example SeRQL or SPARQL). It allows one to
13: * predefine bindings in the query to be able to reuse the same query with
14: * different bindings.
15: *
16: * @author Arjohn Kampman
17: * @author jeen
18: * @see org.openrdf.repository.RepositoryConnection
19: */
20: public interface Query {
21:
22: /**
23: * Binds the specified variable to the supplied value. Any value that was
24: * previously bound to the specified value will be overwritten.
25: *
26: * @param name
27: * The name of the variable that should be bound.
28: * @param value
29: * The (new) value for the specified variable.
30: */
31: public void setBinding(String name, Value value);
32:
33: /**
34: * Removes a previously set binding on the supplied variable. Calling this
35: * method with an unbound variable name has no effect.
36: *
37: * @param name
38: * The name of the variable from which the binding is to be removed.
39: */
40: public void removeBinding(String name);
41:
42: /**
43: * Retrieves the bindings that have been set on this query.
44: *
45: * @return A (possibly empty) set of query variable bindings.
46: * @see #setBinding(String, Value)
47: */
48: public BindingSet getBindings();
49:
50: /**
51: * Specifies the dataset against which to evaluate a query, overriding any
52: * dataset that is specified in the query itself.
53: */
54: public void setDataset(Dataset dataset);
55:
56: /**
57: * Gets the dataset that has been set using {@link #setDataset(Dataset)}, if
58: * any.
59: */
60: public Dataset getDataset();
61:
62: /**
63: * Determine whether evaluation results of this query should include inferred
64: * statements (if any inferred statements are present in the repository). The
65: * default setting is 'true'.
66: *
67: * @param includeInferred
68: * indicates whether inferred statements should included in the
69: * result.
70: */
71: public void setIncludeInferred(boolean includeInferred);
72:
73: /**
74: * Returns whether or not this query will return inferred statements (if any
75: * are present in the repository).
76: *
77: * @return <tt>true</tt> if inferred statements will be returned,
78: * <tt>false</tt> otherwise.
79: */
80: public boolean getIncludeInferred();
81: }
|