|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.common.rdb.container.query.RdbBGPQuery
public class RdbBGPQuery
RdbBGPQuery creates SQL queries agains the Anzo relational schema from conjoined triple patterns. The entire context of a single RdbBGPQuery instance can be constrainted with a GRAPH clause (with either an IRI reference of a variable.) It does not handle OPTIONAL patterns, UNION patterns, or FILTERs. The algorithms in this class are based on research in: http://www.cs.wayne.edu/~artem/main/research/TR-DB-052006-CLJF.pdf#search=%22sparql%20sql%20optional%20wayne%22 adjusted to the particulars of the Anzo relational schema. Other deviations from Chebotko et al.'s work are documented below.
| Constructor Summary | |
|---|---|
RdbBGPQuery(RDBConnection container,
NodeConverter converter,
QueryInformation queryInformation)
Create a new RdbBGPQuery |
|
| Method Summary | |
|---|---|
void |
addExtraTriplePattern(TriplePatternComponent s,
TriplePatternComponent p,
TriplePatternComponent o)
Add an extra triple patter to this query. |
void |
addLikeMatch(Variable variable,
java.lang.String matchText)
Add an pattern for the special textLike predicate |
void |
addOptionalPattern(TriplePattern tp)
Add an optional triple pattern to this query. |
void |
addOptionalPatterns(java.util.List<TriplePattern> tps)
Add an optional triple patterns to this query. |
void |
addTriplePattern(TriplePattern tp)
Add a regular triple pattern to this query |
void |
catalogTriples()
Once all the triple patterns are added to the query, catalog them, determining things like what variables are need to fulfill optionals, likematches, and create maps between the variables and the patterns that they fulfill. |
java.lang.String |
getExtraSQL(java.lang.String tempTable,
java.util.ArrayList<Bindable> bindableColumns,
java.util.ArrayList<Bindable> resultColumns)
Get the SQL string for this query for the extra triple patterns. |
java.lang.String |
getSQL(boolean extras,
java.lang.String tableName,
java.util.ArrayList<Bindable> bindableColumns)
Get the SQL string for this query. |
void |
setGraphVariable(Variable variable)
Set the named graph variable for this query, if there is one |
void |
setNamedGraph(IRIReference iri)
Set the specific namedGraph on which this query is running |
void |
setThisNode(TreeNode node)
Set the node on which this query is based |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RdbBGPQuery(RDBConnection container,
NodeConverter converter,
QueryInformation queryInformation)
container - source of dataconverter - converts between Glitter and Anzo typesqueryInformation - Glitter queryInformation| Method Detail |
|---|
public void setThisNode(TreeNode node)
node - on which this query is basedpublic void setGraphVariable(Variable variable)
variable - the named graph variable for this query
public void setNamedGraph(IRIReference iri)
throws NoSolutionsException
iri - NamedGraph's URI in glitter IRI format
NoSolutionsExceptionpublic void catalogTriples()
public void addTriplePattern(TriplePattern tp)
tp - triple pattern to add
public void addExtraTriplePattern(TriplePatternComponent s,
TriplePatternComponent p,
TriplePatternComponent o)
s - Subject value or variablep - Property value or variableo - Object value or variablepublic void addOptionalPattern(TriplePattern tp)
tp - triple pattern to addpublic void addOptionalPatterns(java.util.List<TriplePattern> tps)
tps - triple patterns to add
public void addLikeMatch(Variable variable,
java.lang.String matchText)
variable - variable for subject of patternmatchText - string to match in like query
public java.lang.String getSQL(boolean extras,
java.lang.String tableName,
java.util.ArrayList<Bindable> bindableColumns)
throws NoSolutionsException
extras - true if there are "Extra" triple patterns besides the regular patterns.tableName - temporary table to place results in, if extra is truebindableColumns - names of the columns/bindings for the results
NoSolutionsException
public java.lang.String getExtraSQL(java.lang.String tempTable,
java.util.ArrayList<Bindable> bindableColumns,
java.util.ArrayList<Bindable> resultColumns)
throws NoSolutionsException
tempTable - temporary table that holds results from getSQL callbindableColumns - names of the columns/bindings that can are available due to the initial getSQL stepresultColumns - names of the columns/bindings for the results
NoSolutionsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||