|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.rdql.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 |
addBoundVar(java.lang.String varName)
Programmatic API operation |
void |
addConstraint(Constraint c)
Programmatic API operation |
void |
addResultVar(java.lang.String varName)
Programmatic API operation |
void |
addTriplePattern(Node s,
Node p,
Node o)
|
void |
addTriplePattern(Triple t)
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. |
java.util.List |
getBoundVars()
Programmatic API operation |
java.lang.String |
getPrefix(java.lang.String prefix)
Lookup a prefix for this query, including the default prefixes |
java.util.List |
getResultVars()
Programmatic API operation |
Model |
getSource()
Return the model that this query executes against. |
java.lang.String |
getSourceURL()
|
java.util.List |
getTriplePatterns()
Programmatic API operation |
void |
setPrefix(java.lang.String prefix,
java.lang.String expansion)
Set a prefix for this query |
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)
s
- The query string
QueryException
- 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 data
QueryException
- Runtime exceptionpublic static QueryResults exec(java.lang.String queryString, Model model)
queryString
- The query: the FROM clause will be overriddenmodel
- The data
QueryException
- Runtime exceptionpublic static QueryResults exec(java.lang.String queryString, java.lang.String dataURL)
queryString
- The query: the FROM clause will be overriddendataURL
- The remote data source
QueryException
- 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 java.util.List getBoundVars()
public void addBoundVar(java.lang.String varName)
public void addConstraint(Constraint c)
public void addTriplePattern(Triple t)
public void addTriplePattern(Node s, Node p, Node o)
public java.util.List getTriplePatterns()
public void setPrefix(java.lang.String prefix, java.lang.String expansion)
public java.lang.String getPrefix(java.lang.String prefix)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |