7 A Quality-enabled Spatial Integration System
145
Input
: Elementary query Q e , Binding B
Output
: Execution Plan expressed in term of local schemas
Algorithm : RW(Q e , B)
ExecutionPlan EP
If (fullbinding (Q e , M 1 ))
tmpEP = Q e
Else
Q p = getPrefixQuery(M 1 )
Q s = getSuffixQuery(M 1 )
B s = {M j ∈ B, j > 1}
tmpEP = (Q p RW(Q s , B s ))
End if
EP = EP ∪ tmpEP
Fig. 7.10. Rewriting algorithm
for $x in document(QUERY01)//roadL
return (
Type="HTTP" Adress="http://...">
$x/gid
$x/entityname
gid
$x/nbLanes
entityname $x/geom
nbLanes
)
geom
priority="1" Type="GQUERY">
nbLanes
for $x in document(QUERY02)//vCommL
2
return (
$x/gid
$x/toponym
$x/longm
)
Type="HTTP" Adress="http://...">
Priorite="2" Type="JOIN">
gid
for $x in document(query03)//Road
toponym
, $y in document(QUERY04)//Road
longm
where $x/id = $y/id return (
longm
$x/id
1000
$x/Description
$x/NbLanes
$x/Geometry
$y/toponym
$y/length
)
priority="1" Type="GQUERY">
Fig. 7.11. Final execution plan
Q 0 . This is done in extracting all Roads having two lanes and a length greater than
1000 meters. The schemas illustrated in Fig. 7.2 shows that attributes Toponym and
Length have no correspondent in class roadL (NTDB). Hence, the query is divided in
two subqueries: a prefix query that extracts NTDB attributes ID, Description, Lanes,
and Geometry that satisfy the condition NbLanes = 2, and a suffix query which extracts BDTQ attributes ID (the key), Toponym, and Length satisfying the condition
145
Input
: Elementary query Q e , Binding B
Output
: Execution Plan expressed in term of local schemas
Algorithm : RW(Q e , B)
ExecutionPlan EP
If (fullbinding (Q e , M 1 ))
tmpEP = Q e
Else
Q p = getPrefixQuery(M 1 )
Q s = getSuffixQuery(M 1 )
B s = {M j ∈ B, j > 1}
tmpEP = (Q p RW(Q s , B s ))
End if
EP = EP ∪ tmpEP
Fig. 7.10. Rewriting algorithm
for $x in document(QUERY01)//roadL
Type="HTTP" Adress="http://...">
priority="1" Type="GQUERY">
for $x in document(QUERY02)//vCommL
return (
Type="HTTP" Adress="http://...">
Priorite="2" Type="JOIN">
for $x in document(query03)//Road
, $y in document(QUERY04)//Road
where $x/id = $y/id return (
priority="1" Type="GQUERY">
Fig. 7.11. Final execution plan
Q 0 . This is done in extracting all Roads having two lanes and a length greater than
1000 meters. The schemas illustrated in Fig. 7.2 shows that attributes Toponym and
Length have no correspondent in class roadL (NTDB). Hence, the query is divided in
two subqueries: a prefix query that extracts NTDB attributes ID, Description, Lanes,
and Geometry that satisfy the condition NbLanes = 2, and a suffix query which extracts BDTQ attributes ID (the key), Toponym, and Length satisfying the condition
