|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.jena.rdf.query.Query
The data structure for a query. There are two ways of creating a query - use the parser to turn a string description of the query into the executable form, and the programmatic way (the parser is calling the programmatic operations driven by the quyery string). The declarative approach of passing in a string is preferred. Once a query is built, it can be passed to a query engine.
QueryEngine
,
QueryResults
Field Summary | |
long |
buildTime
|
long |
executeTime
|
long |
loadTime
|
long |
parseTime
|
Constructor Summary | |
Query()
Create a blank query. |
|
Query(java.lang.String s)
Create a query from the given string by calling the parser. |
Method Summary | |
void |
addConstraint(Constraint c)
Programmatic API operation |
void |
addResultVar(java.lang.String varName)
Programmatic API operation |
void |
addTriplePattern(TriplePattern tp)
Programmatic API operation |
static QueryResults |
exec(java.lang.String queryString)
Convenience function to parse and execute a query. |
static QueryResults |
exec(java.lang.String queryString,
Model model)
Convenience function to parse and execute a query against an existing model. |
static QueryResults |
exec(java.lang.String queryString,
java.lang.String dataURL)
Convenience function to parse and execute a query against a remote model. |
Log |
getLog()
Get the current log |
boolean |
getLogging()
See if we are logging |
java.util.List |
getResultVars()
Programmatic API operation |
Model |
getSource()
Return the model that this query executes against. |
java.lang.String |
getSourceURL()
|
void |
setLog(Log newLog)
Set the log destination. |
void |
setLogging(boolean loggingSwitch)
Switch for logging. |
void |
setSource(Model m)
The data target for the query as a Jena model. |
void |
setSourceURL(java.lang.String s)
Location of the source for the data. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public long parseTime
public long buildTime
public long loadTime
public long executeTime
Constructor Detail |
public Query(java.lang.String s)
String
- The query stringQueryException
- Thrown when a parse error occurspublic Query()
Method Detail |
public static QueryResults exec(java.lang.String queryString)
queryString
- The query: should include FROM clause to provide the dataQueryException
- Runtime exceptionpublic static QueryResults exec(java.lang.String queryString, Model model)
queryString
- The query: the FROM clause will be overriddenmodel
- The dataQueryException
- Runtime exceptionpublic static QueryResults exec(java.lang.String queryString, java.lang.String dataURL)
queryString
- The query: the FROM clause will be overriddendatatURL
- The remote data sourceQueryException
- Runtime exceptionpublic void setSource(Model m)
public Model getSource()
public void setSourceURL(java.lang.String s)
public java.lang.String getSourceURL()
public java.util.List getResultVars()
public void addResultVar(java.lang.String varName)
public void addConstraint(Constraint c)
public void addTriplePattern(TriplePattern tp)
public void setLog(Log newLog)
public Log getLog()
public void setLogging(boolean loggingSwitch)
public boolean getLogging()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |