Query Set Specification Language (QSSL) Michalis Petropoulos Alin Deutsch

advertisement
Query Set Specification
Language (QSSL)
Michalis Petropoulos
Alin Deutsch
Yannis Papakonstantinou
UNIVERSITY OF CALIFORNIA, SAN DIEGO
June 2003
Exporting DBMSs on the Web
DATABASE
APPLICATIONS
Web
Service
Mediator
XML
– Web Services
(Function Signatures)
XML
• Integrating Web
Applications
XQuery
Web
Service
Web
Service
XML
View
XML
View
Source
Source
• Exporting Query
Capabilities on the Web
XML
Schema
DATABASE
SERVER
– Use Web Services
– Export Query Capabilities
Themselves
Overview
• Query Set Specification Language (QSSL)
– Describes Parameterized Tree Pattern (TP) Queries
• Data Services
– Web Services for Query Capabilities
• Authoring Interface
Motivation for QSSL (I)
• Any combination of the following
conditions on:
flights
airline +
name
flight *
from
to
day +
leg +
from
to
aircraft ?
– the name of the airline company
– the origin and destination of one or
more flights (optional)
– a day of the week
– the origin of zero or more legs
(optional)
– the destination of zero or more legs
(optional)
– the aircraft used for zero or more
legs (optional)
• The queries may return “airline”
or “flight” elements
Motivation for QSSL (II)
• Web Services published as function signatures:
– Fixed number of input and output parameters
– Do not capture the functionality of databases
– Large number of web services needed
– One function signature for every parameterized query
– Do not capture the semantic connections the available
functions have with each other and with the underlying
databases
• JDBC Interfaces
– All possible queries
Query Set Specification Language
Query Language
• Tree Pattern Queries:
– Acyclic XPath expressions consisting
of:
–
–
–
–
node tests
child axis ‘/’
descendant axis ‘//’
predicates ‘[]’
– Widely used in current applications
– Building blocks of XQuery
– Excellent visual paradigm for GUIs
flights
airline
name =‘Delta’
flight
from =‘JFK’
to =‘LAX’
day =‘MON’
leg
to =‘LAS’
flights/airline[name=‘Delta’]/flight[from=‘JFK’][to=‘LAX’][day=‘MON’][leg[to=‘LAS’]]
Query Set Specification Language
Query Set Specification
f1
f2
+ f3
? f4
f5
? f6
? f8
flights
flights
airline
airline
name=#1
name =#1
=‘Delta’
flight
flight
from =#2
from =#2
=‘JFK’
to =#3
to =#3
=‘LAX’
day =#4
day =#4
=‘MON’
leg
leg
to =#6
to =#6
=‘LAS’
flight
day =#7
Query Set Specification Language
Query Set Specification
f1
flights
airline +
name
flight *
from
to
day +
leg +
from
to
aircraft ?
flights
f2
airline
f2
name=#1
f2
f3
flight +
f3
f4
flights
airline
f1
from =#2
to =#3
f5
day =#4
f6
leg *
name=#1
flight
f4 ?
?
f7
from =#5 ?
f8
to =#6 ?
f9
aircraft =#7 ?
f3 +
f5
f4
from=#2
to =#3
f5
day =#4
f6 *
leg
f6
f7 ?
f8 ?
f7
from=#5
f8
to =#6
f9
aircraft =#7
• Similar to extended context-free grammars
f9 ?
Query Set Specification Language
Recursive XML Schemas
f1
f2
familyTree
familyTree
person
person
?
f3
name =#1
name =#1
?
f4
place=#2
place =#2
?
f5
spouse ?
spouse
?
f6
name =#3
?
f7
place=#4
?
f8
children ?
*
person
*
f2
children
person
person
spouse
name =#5
place =#6
Query Set Specification Language
Recursive XML Schemas
f1
f2
f1
familyTree
familyTree
f2
person
f3
name =#1 ?
f4
place=#2 ?
f5
spouse ?
f6
name =#3 ?
f7
place=#4 ?
f8
children ?
f2 *
• QSS of fixed size
person
f2
f3 ?
f4 ?
f3
name=#1
f4
place=#2
f5 ?
spouse
f5
f6 ?
f7 ?
f6
name=#3
f7
place=#4
f8
children
f2 *
f8 ?
Data Services
Input Message
View
XML Schema
Data
Source
Data
Service
WSDL
Agent
Output Message
•
•
•
•
Data Service = WSDL + QSS
A QSS deployed as a web service
Exports the XML Schema of an XML view
Connects the WSDL calls with the underlying
database
• Receives queries that are encoded by QSS
• Explicit relationship between input and output
Data Services
Input Message
TPX
View
XML Schema
WSDL
Input Message Type
Data
Source
Data
Service
QSSX
Agent
Output Message Type
XML Schema
Output Message
XML
• QSS is translated to XML Schema (QSSX)
• TP queries that are encoded as XML (TPX)
• Query result is described by an XML Schema
Data Services
Reasoning
1.
2.
3.
4.
Membership of a query in a data service
Subsumption of data services
Totality of a data service
Overlap of data services
• QSS can be translated to an equivalent topdown nondeterministic unranked tree
automaton
• Problems are decidable
Data Services
Authoring Interface
Future Work
Capability-Based Rewriting
Mediator
User Query
Rewriting
Processor
TPX
Candidate
Queries
Containing
Result
Plan
Processor
Remainder
Query
Data
Service
flights
flights
airline
XML
flight
day =‘MON’
Data
Source
f1
Query Result
Execution
Engine
flights
airline
airline
f2
name=#1
name =‘Delta’
name =‘Delta’
f3
flight +
flight
flight
f4
from
to =#3
day
?
from =‘JFK’
from =‘JFK’
to =‘LAX’
to =‘LAX’
day =‘MON’
Questions and Answers
?
Query Set Specification Language
Example Derivation
f1 ⇒
flights
airline
f2
⇒
f3 +
⇒
flights
airline
flight
name=#1
f4 ?
f5
flights
airline
name=#1
f6 *
flight
from =#2 to =#3 day =#4
f7 ?
⇒
flights
airline
name=#1
flight
from =#2 to =#3 day =#4
leg
to =#6
leg
f8 ?
f9 ?
Related Work
Capability-Based Rewriting
• Capabilities described as binding patterns
– Adornments on view attributes
– Negative approach
• Expansions of Datalog programs
– Recursive programs € Infinite queries
– Positive approach
Download