|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nsdl.mptstore.query.provider.GraphQuerySQLProvider
public class GraphQuerySQLProvider
Translates a GraphQuery into a series of SQL statements.
Produces ANSI SQL-92 queries by converting each GraphPattern leaf
of the query tree into a series of JOINs. Each join condition is formed
by matching variables between TriplePatterns in the appripriate
GraphPatterns.
TODO:
| Constructor Summary | |
|---|---|
GraphQuerySQLProvider(TableManager tableManager,
GraphQuery graphQuery)
Create an instance. |
|
| Method Summary | |
|---|---|
java.util.List<java.lang.String> |
getSQL()
Returns a query in ANSI SQL |
java.util.List<java.lang.String> |
getTargets()
Get the names of the values that are being selected. |
void |
orderBy(java.lang.String target,
boolean desc)
Force an order on the results. |
void |
setTargets(java.util.List<java.lang.String> targetList)
Choose the variables that define result tuples |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphQuerySQLProvider(TableManager tableManager,
GraphQuery graphQuery)
tableManager - the table manager to use for looking up table names.graphQuery - the graph query.| Method Detail |
|---|
public void setTargets(java.util.List<java.lang.String> targetList)
The given list of variables are used for determining which bound values are included in result tuples, and in what order. If a variable is specified as a target, it must be present somewhere in the query. Any unmatched target will result in error
setTargets in interface SQLBuildertargetList - the list of query variables.SQLProvider.getTargets()
public void orderBy(java.lang.String target,
boolean desc)
Given the name of a target variable, results will be ordered by its bound value. Results may be specified to return in ascending or descending order.
target - Name of the target variable whose value will be the sort
key.desc - True if results are to be in desceiding order, false
otherwise.
public java.util.List<java.lang.String> getSQL()
throws QueryException
Translates the GraphQuery defined in the constructor, along with any specified orderings , into a set of SQL statements. The union of all SQL statement results, executed in order, will represent the entire result set.
getSQL in interface SQLProviderQueryException - if there is some error translating the query
to SQL.public java.util.List<java.lang.String> getTargets()
getTargets in interface SQLProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||