|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OntologyTupleQuery
This represents a tuple query of the triple store for the ontology.
To create a tuple query object you must use the ontology's factory
method Ontology.createTupleQuery(String, gate.creole.ontology.OConstants.QueryLanguage)
.
NOTE: querying the ontology triple store directly should be avoided and only done in exceptional cases. Using the methods to query and access ontology entities should be preferred whenever possible!
The query object implements a closable iterator that auto-closes when all its elements are exhausted. However, you must close it if you stop retrieving elements before all elements have been exhausted (i.e. before the hasNext() method has returned false). Closing the query object is necessary to free the considerable resources allocated by it.
To use a query object properly, be sure to follow the following steps:
Method Summary | |
---|---|
void |
close()
Explicitly close the query and free its resources. |
void |
evaluate()
Evaluate the tuple query (again). |
boolean |
hasNext()
Test if more results are available. |
Vector<LiteralOrONodeID> |
next()
Retrieve the next tuple from the query object. |
Vector<String> |
nextAsString()
Retrieve the next tuple from the query object as a vector of strings. |
LiteralOrONodeID |
nextFirst()
Return just the first variable of a tuple. |
String |
nextFirstAsString()
Return just the first variable of a tuple as a String. |
void |
setBinding(String varName,
Literal value)
Set the binding of a query variable to a new value. |
void |
setBinding(String varName,
ONodeID value)
Set the binding of a query variable to a new value. |
Methods inherited from interface java.util.Iterator |
---|
remove |
Method Detail |
---|
boolean hasNext()
hasNext
in interface Iterator<Vector<LiteralOrONodeID>>
Vector<LiteralOrONodeID> next()
next
in interface Iterator<Vector<LiteralOrONodeID>>
Vector<String> nextAsString()
void setBinding(String varName, Literal value)
varName
- the name of the variablevalue
- the value to assign to the variablevoid setBinding(String varName, ONodeID value)
varName
- the name of the variablevalue
- the value to assign to the variablevoid evaluate()
LiteralOrONodeID nextFirst()
String nextFirstAsString()
void close()
close
in interface ClosableIterator<Vector<LiteralOrONodeID>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |