01 /*
02 * Copyright (c) 1995-2010, The University of Sheffield. See the file
03 * COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
04 *
05 * This file is part of GATE (see http://gate.ac.uk/), and is free
06 * software, licenced under the GNU Library General Public License,
07 * Version 2, June 1991 (in the distribution as file licence.html,
08 * and also available at http://gate.ac.uk/gate/licence.html).
09 *
10 * Johann Petrak 2009-08-13
11 *
12 * $Id: OntologyBooleanQuery.java 12006 2009-12-01 17:24:28Z thomas_heitz $
13 */
14 package gate.creole.ontology;
15
16 /**
17 * This represents a boolean query of the triple store for the ontology.
18 * To create a boolean query object you must use the ontology's factory
19 * method {@link Ontology.createBooleanQuery(String query, QueryLanguage lang)}.
20 * <p>
21 * NOTE: querying the ontology triple store directly should be avoided and
22 * only done in exceptional cases. Using the methods to query and access ontology
23 * entities should be preferred whenever possible!
24 *
25 * @author Johann Petrak
26 */
27 public interface OntologyBooleanQuery {
28 /**
29 * Re-assign a query variable to a new value. This will let you
30 * query the triple store with the same query but a different value
31 * for the variable. Depending on the implemenation, this might avoid
32 * the necessity to recompile the whole query.
33 *
34 * @param varName - the name of the variable to be reassigned
35 * @param value - a LiteralOrONodeID object representing either a literal or
36 * either an URI or a blank node identifier.
37 *
38 */
39 public void setBinding(String varName, LiteralOrONodeID value);
40 /**
41 * Evaluate the boolean query and return whether it evaluates to true
42 * or false;
43 *
44 * @return - a boolean representing the result of the boolean query
45 */
46 public boolean evaluate();
47 }
|