XMLApe Architecture
description
Transcript of XMLApe Architecture
1
XMLApe Architecture
XMLApeEngine
XMLApeData Source
XMLApeData Source
XMLApeGUI
Figure 1
2
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlape.cc.gatech.edu/myflights" xmlns="http://xmlape.cc.gatech.edu/myflights" elementFormDefault="qualified">
<xsd:element name="flights"> <xsd:complexType> <xsd:sequence> <xsd:element ref="flight" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:element name="flight" type="flightType"/>
<xsd:complexType name="flightType"> <xsd:sequence> <xsd:element name="airline" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="from" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="to" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType>
</xsd:schema>
EXAMPLE - Flights Schema
Figure 2
3
EXAMPLE - Flights Data
<?xml version="1.0"?><flights xmlns="http://xmlape.cc.gatech.edu/myflights" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlape.cc.gatech.edu/myflights myflights.xsd"> <flight> <airline>Delta</airline> <from>Atlanta</from> <to>Detroit</to> </flight> <flight> <airline>Delta</airline> <from>Detroit</from> <to>Atlanta</to> </flight> <flight> <airline>USAirways</airline> <from>New York</from> <to>Los Angeles</to> </flight></flights>
Figure 3
4
EXAMPLE - Car Rentals Schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlape.cc.gatech.edu/myrental" xmlns="http://xmlape.cc.gatech.edu/myrental" elementFormDefault="qualified">
<xsd:element name="rentals"> <xsd:complexType> <xsd:sequence> <xsd:element ref="rental" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:element name="rental" type="rentalType"/>
<xsd:complexType name="rentalType"> <xsd:sequence> <xsd:element name="company" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="from" type="xsd:string" minOccurs="1" maxOccurs="1"/> <xsd:element name="to" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType>
</xsd:schema>
Figure 4
5
EXAMPLE - Car Rentals data
<?xml version="1.0"?><rentals xmlns="http://xmlape.cc.gatech.edu/myrental" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlape.cc.gatech.edu/myrental myrental.xsd"> <rental> <company>Avis</company> <from>Atlanta</from> <to>Atlanta</to> </rental> <rental> <company>Dollar</company> <from>Atlanta</from> <to>Athens</to> </rental> <rental> <company>Thrifty</company> <from>New York</from> <to>Hartford</to> </rental></rentals>
Figure 5
6
Start screen with s-buttons and empty XMLApe Query Form
CAR RENTAL
EVENT
FLIGHT
HOTEL
TRAIN
CRUISE
URL:
Figure 6
7
Query Schema
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlape.cc.gtri.gatech.edu/query" xmlns="http://xmlape.cc.gtri.gatech.edu/query" elementFormDefault="qualified">
<xsd:element name="query" type="queryType" />
<xsd:complexType name="queryType"> <xsd:sequence>
<xsd:element name="source" type="sourceType" minOccurs="0" maxOccurs="unbounded" /><xsd:element name="select" type="selectType" minOccurs="0" maxOccurs="unbounded" /><xsd:element name="join" type="joinType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence> </xsd:complexType>
<xsd:complexType name="sourceType"> <xsd:sequence>
<xsd:element name="location" type="xsd:anyURI" minOccurs="1" maxOccurs="1" /><xsd:element name="alias" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence> </xsd:complexType>
Figure 7
8
Query Schema (cont.)
<xsd:complexType name="selectType"> <xsd:sequence>
<xsd:element name="schemaRef" type="schemaRefType" minOccurs="1" maxOccurs="1"/><xsd:element name="value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence> </xsd:complexType>
<xsd:complexType name="joinType"> <xsd:sequence> <xsd:element name="schemaRef" type="schemaRefType" minOccurs="2" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType>
<xsd:complexType name="schemaRefType"> <xsd:sequence>
<xsd:element name="alias" type="xsd:string" minOccurs="1" maxOccurs="1"/> <!-- change the type to specify XPath when we get a grip on that -->
<xsd:element name="field" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType>
</xsd:schema>
Figure 8
9
Empty Query Document
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd"></query>
Figure 9
10
Empty Query Result Schema<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="query1_results" xmlns="query1_results" elementFormDefault="qualified">
<xsd:element name="results"> <xsd:complexType> <xsd:sequence> <xsd:element ref="result" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:element name="result" type="resultType"/>
<xsd:complexType name="resultType"> <xsd:sequence> </xsd:sequence> </xsd:complexType>
</xsd:schema>
Figure 10
11
Empty Query Result Data
<?xml version="1.0"?><results xmlns="query1_results" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="query1_results query1_results.xsd"></results>
Figure 11
12
XMLApe Query Form generated by the GUI from the XML schema in Figure 2
RENTAL
EVENT
FLIGHT
HOTEL
TRAIN
CRUISE
URL:
Figure 12
FLIGHT AIRLINE
FROM
TO
13
XMLApe Query Form; two FLIGHT schemas, Figure 2, and one RENTAL schema, Figure 4
RENTAL
EVENT
FLIGHT
HOTEL
TRAIN
CRUISE
URL:
Figure 13
FLIGHT AIRLINE
FROM
TO
FLIGHT AIRLINE
FROM
TO
RENTAL COMPANY
FROM
TO
14
3-source Query Document after Figure 13; no selections; no joins
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd">
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights1</alias> </source>
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights2</alias> </source>
<source> <!-- datasource for 'myrental.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myrental.datasource</location> <alias>myrental1</alias> </source>
</query>
Figure 14
15
Result Schema for 3-source query; no selections; no joins
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="query2_results" xmlns="query2_results" xmlns:myrental="http://xmlape.cc.gatech.edu/myrental" xmlns:myflights="http://xmlape.cc.gatech.edu/myflights" elementFormDefault="qualified"> <xsd:import namespace="http://xmlape.cc.gatech.edu/myrental" schemaLocation="myrental.xsd"/> <xsd:import namespace="http://xmlape.cc.gatech.edu/myflights" schemaLocation="myflights.xsd"/>
<xsd:element name="results"> <xsd:complexType> <xsd:sequence> <xsd:element ref="result" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:element name="result" type="resultType"/>
<xsd:complexType name="resultType"> <xsd:sequence> <xsd:element name="myflights1" type="myflights:flightType" minOccurs="1" maxOccurs="1"/> <xsd:element name="myflights2" type="myflights:flightType" minOccurs="1" maxOccurs="1"/> <xsd:element name="myrental1" type="myrental:rentalType" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType>
</xsd:schema>
Figure 15
16
Result Data for 3-source query;no selections; no joins
<?xml version="1.0"?><results xmlns="query2_results" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:myrental="http://xmlape.cc.gatech.edu/myrental" xmlns:myflights="http://xmlape.cc.gatech.edu/myflights" xsi:schemaLocation="query2_results query2_results.xsd">
<result> <myflights1> <myflights:airline>Delta</myflights:airline> <myflights:from>Atlanta</myflights:from> <myflights:to>Detroit</myflights:to> </myflights1> <myflights2> <myflights:airline>Delta</myflights:airline> <myflights:from>Atlanta</myflights:from> <myflights:to>Detroit</myflights:to> </myflights2> <myrental1> <myrental:company>Avis</myrental:company> <myrental:from>Atlanta</myrental:from> <myrental:to>Atlanta</myrental:to> </myrental1> </result>
Figure 16
17
Result Data for 3-source query;no selections; no joins (cont.)
25 more <result>’s …….and, finally, the last one:
<result> <myflights1> <myflights:airline>USAirways</myflights:airline> <myflights:from>New York</myflights:from> <myflights:to>Los Angeles</myflights:to> </myflights1> <myflights2> <myflights:airline>USAirways</myflights:airline> <myflights:from>New York</myflights:from> <myflights:to>Los Angeles</myflights:to> </myflights2> <myrental1> <myrental:company>Thrifty</myrental:company> <myrental:from>New York</myrental:from> <myrental:to>Hartford</myrental:to> </myrental1> </result>
</results>
Figure 17
18
Query w/selections and joins in the XMLApe Query Form
CAR
EVENT
FLIGHT
HOTEL
TRAIN
CRUISE
URL:
Figure 18
FLIGHT AIRLINE
DetroitFROM
TO
FLIGHT AIRLINE
FROM
TO
RENTAL COMPANY
FROM
TO
Surprise vacation:
Leaving Detroit flying somewhere. Picking up a rental from that place and returning it to the same place. Leaving that place flying somewhere else.
19
Query Document w/selections and joins corresponding to Figure 18
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd">
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights1</alias> </source>
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights2</alias> </source>
<source> <!-- datasource for 'myrental.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myrental.datasource</location> <alias>myrental1</alias> </source>
Figure 19
20
Query Document w/selections and joins (cont.)corresponding to Figure 18
<select> <schemaRef> <alias>myflights1</alias> <field>"XPath expression: flightType:from"</field> </schemaRef> <value>Detroit</value> </select>
<join> <schemaRef> <alias>myflights1</alias> <field>"XPath expression: flightType:to"</field> </schemaRef> <schemaRef> <alias>myflights2</alias> <field>"XPath expression: flightType:from"</field> </schemaRef> <schemaRef> <alias>myrental1</alias> <field>"XPath expression: myRental:from"</field> </schemaRef> <schemaRef> <alias>myrental1</alias> <field>"XPath expression: myRental:to"</field> </schemaRef> </join>
</query>
Figure 20
21
Schema for Result of query in Figure 19-20 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="query3_results" xmlns="query3_results" xmlns:myrental="http://xmlape.cc.gatech.edu/myrental" xmlns:myflights="http://xmlape.cc.gatech.edu/myflights" elementFormDefault="qualified"> <xsd:import namespace="http://xmlape.cc.gatech.edu/myrental" schemaLocation="myrental.xsd"/> <xsd:import namespace="http://xmlape.cc.gatech.edu/myflights" schemaLocation="myflights.xsd"/>
<xsd:element name="results"> <xsd:complexType> <xsd:sequence> <xsd:element ref="result" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:element name="result" type="resultType"/>
<xsd:complexType name="resultType"> <xsd:sequence> <xsd:element name="myflights1" type="myflights:flightType" minOccurs="1" maxOccurs="1"/> <xsd:element name="myflights2" type="myflights:flightType" minOccurs="1" maxOccurs="1"/> <xsd:element name="myrental1" type="myrental:rentalType" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType>
</xsd:schema>
Figure 21
22
Result Data for query in Figure 19-20<?xml version="1.0"?><results xmlns="query3_results" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:myrental="http://xmlape.cc.gatech.edu/myrental" xmlns:myflights="http://xmlape.cc.gatech.edu/myflights" xsi:schemaLocation="query3_results query3_results.xsd">
<result> <myflights1> <myflights:airline>Delta</myflights:airline> <myflights:from>Detroit</myflights:from> <myflights:to>Atlanta</myflights:to> </myflights1> <myflights2> <myflights:airline>Delta</myflights:airline> <myflights:from>Atlanta</myflights:from> <myflights:to>Detroit</myflights:to> </myflights2> <myrental1> <myrental:company>Avis</myrental:company> <myrental:from>Atlanta</myrental:from> <myrental:to>Atlanta</myrental:to> </myrental1> </result>
</results>
Figure 22
23
Engine: Query Document breakdown (1 of 3) from Figure 19-20
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd">
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights1</alias> </source>
<select> <schemaRef> <alias>myflights1</alias> <field>"XPath expression: flightType:from"</field> </schemaRef> <value>Detroit</value> </select>
</query>
Figure 23
24
Engine: Result Data for query in Figure 23
<?xml version="1.0"?><flights xmlns="http://xmlape.cc.gatech.edu/myflights" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlape.cc.gatech.edu/myflights myflights.xsd"> <flight> <airline>Delta</airline> <from>Detroit</from> <to>Atlanta</to> </flight></flights>
Figure 24
25
Engine: Query Document breakdown (2 of 3) from Figure 19-20
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd">
<source> <!-- datasource for 'myflights.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myflights.datasource</location> <alias>myflights2</alias> </source>
</query>
Figure 25
26
Engine: Result Data for query in Figure 25
<?xml version="1.0"?><flights xmlns="http://xmlape.cc.gatech.edu/myflights" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlape.cc.gatech.edu/myflights myflights.xsd"> <flight> <airline>Delta</airline> <from>Atlanta</from> <to>Detroit</to> </flight> <flight> <airline>Delta</airline> <from>Detroit</from> <to>Atlanta</to> </flight> <flight> <airline>USAirways</airline> <from>New York</from> <to>Los Angeles</to> </flight></flights>
Figure 26
27
Engine: Query Document breakdown (3 of 3) from Figure 19-20
<?xml version="1.0" encoding="UTF-8"?><query xmlns="http://xmlape.cc.gtri.gatech.edu/query" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://xmlape.cc.gtri.gatech.edu/query query.xsd">
<source> <!-- datasource for 'myrental.xsd' schema --> <location>http://xmlape.cc.gatech.edu/myrental.datasource</location> <alias>myrental1</alias> </source>
<join> <schemaRef> <alias>myrental1</alias> <field>"XPath expression: myRental:from"</field> </schemaRef> <schemaRef> <alias>myrental1</alias> <field>"XPath expression: myRental:to"</field> </schemaRef> </join>
</query>
Figure 27
28
Engine: Result Data for query in Figure 27<?xml version="1.0"?><rentals xmlns="http://xmlape.cc.gatech.edu/myrental" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlape.cc.gatech.edu/myrental myrental.xsd"> <rental> <company>Avis</company> <from>Atlanta</from> <to>Atlanta</to> </rental></rentals>
Figure 28
29
Engine: Join Results from Figure 24-26-28 to get Result in Figure 22
<?xml version="1.0"?><results xmlns="query3_results" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:myrental="http://xmlape.cc.gatech.edu/myrental" xmlns:myflights="http://xmlape.cc.gatech.edu/myflights" xsi:schemaLocation="query3_results query3_results.xsd">
<result> <myflights1> <myflights:airline>Delta</myflights:airline> <myflights:from>Detroit</myflights:from> <myflights:to>Atlanta</myflights:to> </myflights1> <myflights2> <myflights:airline>Delta</myflights:airline> <myflights:from>Atlanta</myflights:from> <myflights:to>Detroit</myflights:to> </myflights2> <myrental1> <myrental:company>Avis</myrental:company> <myrental:from>Atlanta</myrental:from> <myrental:to>Atlanta</myrental:to> </myrental1> </result>
</results>
Figure 29