|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.ucm.fdi.gaia.ontobridge.SPARQL
public class SPARQL
This class allows to ask SPARQL queries to the reasoner
Constructor Summary | |
---|---|
SPARQL(OntoBridge ob)
|
Method Summary | |
---|---|
boolean |
execAskQuery(java.lang.String queryStr)
Executes a SPARQL query of type ASK (boolean query). |
com.hp.hpl.jena.rdf.model.Model |
execConstructQuery(java.lang.String queryStr)
Executes a SPARQL query of type CONSTRUCT and returns a new model with the results. |
com.hp.hpl.jena.rdf.model.Model |
execDescribeQuery(java.lang.String queryStr)
Executes a SPARQL query of type DESCRIBE and returns a new model with the results. |
java.util.Iterator<com.hp.hpl.jena.query.QuerySolution> |
execSelectQuery(java.lang.String queryStr)
Executes a SPARQL query of type SELECT and returns an iterator over the solutions. |
void |
execSelectQueryAndPrint(java.lang.String queryStr,
java.io.PrintStream outStream)
Executes a SPARQL query of type SELECT and prints the result as a table in the specified stream (usually System.out) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SPARQL(OntoBridge ob)
Method Detail |
---|
public boolean execAskQuery(java.lang.String queryStr)
public java.util.Iterator<com.hp.hpl.jena.query.QuerySolution> execSelectQuery(java.lang.String queryStr)
// Create a new query Query query = QueryFactory.create(queryStr); // Execute the query and obtain results QueryExecution qe = QueryExecutionFactory.create(query, ONT_MODEL); ResultSet results = qe.execSelect(); // Use the results as needed... QuerySolution sol; while(results.hasNext()) { sol = results.nextSolution(); ...; } // Important - free up resources used running the query qe.close();
public void execSelectQueryAndPrint(java.lang.String queryStr, java.io.PrintStream outStream)
public com.hp.hpl.jena.rdf.model.Model execConstructQuery(java.lang.String queryStr)
public com.hp.hpl.jena.rdf.model.Model execDescribeQuery(java.lang.String queryStr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |