|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fuberlin.wiwiss.d2rq.rdql.PatternQueryCombiner
Handles a triple pattern query on a D2RQ mapped database. (Current)Assumption: all PropertyBridges refer to same database. Contract: after Constructor, first call setup() then call resultTriplesIterator().
This class does not need to know anything about D2RQPatternStage, except
it's VariableBindings
semantics.
It seems that some of the information computed here could be reused in successive calls from D2RQPatternStage2. On the other hand, lots of preprocessing is useless, if there are (Bound) variables for predicates.
QueryCombiner
Nested Class Summary | |
private class |
PatternQueryCombiner.PQCResultIterator
Iterator for PatternQueryCombiner results. |
Field Summary | |
(package private) VariableBindings |
bindings
|
protected java.util.ArrayList[] |
bridges
holds for each triple its 'a priory' appliable bridges |
protected int[] |
bridgesCounts
holds for each triple its number of bridges or tripleQueries |
protected java.util.Collection |
constraints
|
protected Database |
database
|
protected GraphD2RQ |
graph
|
private boolean |
possible
if false then contradiction, no SQL query necessary. |
protected int |
tripleCount
|
protected TripleQuery[][] |
tripleQueries
holds for each triple its disjunctive SQL-TripleQuery Objects |
protected com.hp.hpl.jena.graph.Triple[] |
triples
|
Constructor Summary | |
PatternQueryCombiner(GraphD2RQ graph,
VariableBindings bindings,
java.util.Collection constraints,
com.hp.hpl.jena.graph.Triple[] triples)
|
Method Summary | |
private SQLStatementMaker |
getSQL(TripleQuery[] conjunction)
|
(package private) void |
makePropertyBridges()
Creates copies of the property bridges that could fit the triples . |
(package private) void |
makeStores()
allocates arrays |
(package private) void |
makeTripleQueries()
Creates a TripleQuery for each PropertyBridge . |
(package private) void |
reducePropertyBridges()
|
com.hp.hpl.jena.util.iterator.ClosableIterator |
resultTriplesIterator()
|
(package private) void |
setup()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean possible
protected Database database
protected GraphD2RQ graph
protected com.hp.hpl.jena.graph.Triple[] triples
protected int tripleCount
protected java.util.Collection constraints
VariableBindings bindings
protected java.util.ArrayList[] bridges
protected int[] bridgesCounts
protected TripleQuery[][] tripleQueries
Constructor Detail |
public PatternQueryCombiner(GraphD2RQ graph, VariableBindings bindings, java.util.Collection constraints, com.hp.hpl.jena.graph.Triple[] triples)
Method Detail |
void setup()
void makeStores()
void makePropertyBridges()
triples
.
Two triples that are combined with AND generally have nothing in common,
so we create individual instances of the bridges and systematically rename
their tables. We prefix each Table with "T
TablePrefixer
void makeTripleQueries()
TripleQuery
for each PropertyBridge
.
As a side effect we also set bridgesCounts
.
void reducePropertyBridges()
private SQLStatementMaker getSQL(TripleQuery[] conjunction)
public com.hp.hpl.jena.util.iterator.ClosableIterator resultTriplesIterator()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |