web services interfaces
TRANSCRIPT
Web Services Interfaces
Michalis PetropoulosAlin Deutsch
Yannis PapakonstantinouVasilis VassalosScott Mitchell
UNIVERSITY OF CALIFORNIA, SAN DIEGO
Microsoft Research, July 2003
Exporting DBMSs on the Web
SourceDATABASE
SERVER
Source
XQuery
XML XML
XMLView
XMLSchema
XMLView
• Exporting Query Capabilities on the Web– Web Services
(Function Signatures)
• Integrating Web Applications– Use Web Services – Export Query Capabilities
Themselves
• HTML Web Interfaces(Forms & Reports)
WebService
WebService
Mediator
WebService End-User
HTMLForms &Reports
DATABASEAPPLICATIONS
Overview
• Query Set Specification Language (QSSL)– Describes Parameterized Tree Pattern (TP) Queries
• Data Services– Web Services for Query Capabilities
• Forms & Reports for Semistructured Data– The QURSED system
• Authoring Interfaces
Motivation for QSSL
• 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– Difficult to export schema information
Query Set Specification Language
Goals • Any combination of the following conditions on:– 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
flights
airline
flight
name
from
to
day
leg
aircraft
to
from
+
*
+
?
+
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
flight
name =‘Delta’
from
to =‘LAX’=‘JFK’
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
f8
f6
f5
f4
f3
f2
f1flights
airline
flight
name=#1
from
to =#3=#2
day =#4leg
to =#6
?
?
?
flights
airline
flight
name
day
leg
from
to
to
=‘Delta’
=‘LAX’=‘JFK’
=‘MON’
=‘LAS’
=‘Delta’
=‘LAX’=‘JFK’
=‘MON’
=‘LAS’
=#1
=#3=#2
=#4
=#6flight
day =#7
+
Query Set Specification Language
Query Set Specificationflightsf1
flights
airline
flight
name=#1
from
to =#3
=#2
day =#4
leg
aircraft
to
from
=#6
=#5
=#7
+
?
*?
??
airline
f3f2 +f1flights
airline
flight
name
from
to
day
leg
aircraft
to
from
+
*
+
?
+
name=#1f2f2f3 flight
f6f4 f5? *f3
f4 from=#2f4to =#3
f5day =#4f5
f6f6 leg
f9f7 f8 ?? ?f7
f8from=#5f7
f9to =#6f8
aircraft=#7f9
• Similar to extended context-free grammars
Query Set Specification Language
Recursive XML Schemas
familyTree
person
spouse
name
name
children?
?place
place
person *
familyTree
person
name
place
=#1=#2
spouse
name
place
=#5=#6
f8
f7
f6
f5
f4
f3
f2
f1
?????
familyTree
person
spouse
name
name
children
place
place
=#1=#2
=#3=#4
?f2*
children
person
spouse
person
Query Set Specification Language
Recursive XML SchemasfamilyTreefamilyTree
person
spouse
name
name
children
f2
place
place
=#1
=#2
=#3
=#4
?
*
f1 f1f2f2
f2 person
f5f3 f4 ?? ??f3
?f4name=#1f3
f5 ?place=#2f4
?f6f5 spouse
f8f6 f7 ?? ??f7
f8name=#3f6
place=#4f7
childrenf8f2 *
• QSS of fixed size
Data Services
Input Message
Agent
ViewXML Schema
DataService
DataSource
WSDL
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
WSDLInput Message Type
Output Message Type
Output Message
Input Message
QSSX
XML Schema
XML
TPX
DataService
ViewXML Schema
DataSource
Agent
• 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. Membership of a query in a data service2. Subsumption of data services3. Totality of a data service4. Overlap of data services
• These problems (except 1) are undecidable for context-free grammars
• QSS can be translated to an equivalent top-down nondeterministic unranked tree automaton
• Problems become decidable
Future Work
Capability-Based Rewriting
RewritingProcessor
PlanProcessor
CandidateQueries
MediatorContaining
Result
DataSource
• Capability-based rewriting problem– Partial rewritings
Query ResultUser Query
XMLTPXExecution
EngineRemainderQuery
DataService
Data Services
Authoring Interface
Query Forms and Reports
• Handle semistructureness– Powerful query forms and reports
• Be declarative– Separate logic from presentation
• Visual interface for the developer– Programming should NOT be a requirement
Requirements
Query Forms and Reports
Query Forms and Reports
• XML Schema-driven• Declarative!
– Separation of content & presentation
• Editor– Visual actions to declarative
specifications– Automatic construction of
report pages• Query Set Specification (QSS)
– Large set of parameterized queries
– Compact representation• Engine
– Automatic query formulation– Direct result construction
QURSED Approach
QURSEDEngine
XQueryEngine
XQuery
QueryFormPage
ReportPages
End-User
XHTML
QSS
QURSEDEditor
XMLSchema
HTML
Developing Query Forms from the XML Schema
Developing Reports from the XML Schema
QURSED Editor
Building Query/Visual Association
Condition Fragment List
Predicate
Data Path
Form Control
QURSED Editor
Building Reports
Elementsto Appearon Report
Element Mapping
Group By Mapping
More Features
• Structural disjunction• Dependencies• Sort-by options• Template-driven construction of report pages• Report customization• Dynamic projection• Online demo:
http://www.db.ucsd.edu/qursed/
Related work
• Data intensive Web site generators– Strudel
– Forms as functions on edges/links
– Araneus– Autoweb
SEMISTRUCTUREDDATA
(Mediated)View
End-User
Presentation Templates
SiteGenerator
WebSite
SITEGRAPH Web Site
Contentand Structure
SemistructuredQueries
SCHEMA
• Declarative• Separation of content,
structure and presentation
Related work
• Web-based Form and Report Generators– Macromedia Ultradev, Coldfusion, Microsoft Visual InterDev– Excellent for flat uniform relational tables– Visual query formulation paradigm allows the specification of
projections, sort-bys, simple conditions– However, the development of form and report pages for
semistructured data requires substantial programming effort
• Visual Querying Interfaces– EquiX, BBQ, VQBD, Lorel’s DataGuide-driven GUI, PESTO– Excellent visual paradigm for the formulation of fairly
complex queries – The goal is the development of a query or a query template– User needs to be familiar with database models and schemas
Questions and Answers
?
Query Set Specification Language
Example Derivation
flights
airline
f3f2 +
f1
flight
f6f4 f5
airline
? *
flights
from=#2 to =#3 day =#4leg
flight
airline
f7 f8 ??
flights⇒ ⇒ ⇒
name=#1 name=#1
f9 ?
to =#6
from=#2 to =#3 day =#4
flight
airline
flights⇒
name=#1
leg
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
• Capability-based rewriting problem– Total rewritings only
QURSED System Architecture
QURSEDRun Time Engine
QURSEDCompiler
XQueryEngine
QURSEDEditor
(Optional)Custom
Predicates
Query FormPage
XQueryExpressions XML/XHTML
QueryForm Page
ReportPages
APP SERVER
BROWSER
XHTMLQuery Form
Page
(Optional)XHTML
TemplateReport Page
Query SetSpecification
Query/VisualAssociation
DynamicServer Pages
WYSIWYGXHTMLEditor
Deployment
XMLSchema
Developer
Web Designer
End-User