Title: XGI: A Graphic Interface for XQuery Creation and XML Schema Visualization
1XGI A Graphic Interface for XQuery Creation and
XML Schema Visualization
- Xiang Li
- University of Washington
- Biomedical and Health Informatics
- Master Thesis Committee
- James Brinkley, John Gennari
2Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and XQuery Graphic Interface (XGI)
system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
3Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and the XQuery Graphic Interface
(XGI) system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
4XML and XQuery
- XML
- De facto standard language for data exchange and
representation in biomedical research - Semistructured data model
- Wide-spread adoption and many data sources in XML
format - XQuery
- W3C-candidate, textual XML querying language
- Turing-complete and well-supported
- Required programmatic skill similar to SQL
5Examples
ltrootgt ltpatientgt ltyear_of_birthgt lt/year_of_birthgt ltwada_commentsgt lt/wada_commentsgt ltwada_memorygt lt/wada_memorygt ltwada_languagegt lt/wada_languagegt lthandednessgt lt/handednessgt ltsexgt lt/sexgt lttypegt lt/typegt ltgao_research_numgt lt/gao_research_numgt ltdescriptiongt lt/descriptiongt ltpregt lt/pregt ltsizegt lt/sizegt ltpnumgt lt/pnumgt ltviqgt lt/viqgt ltage_at_registrationgt lt/age_at_registrationgt .. . lt/patientgt lt/rootgt
ltresultgt for pa in root/patient where pa/surgery/csmstudy/trial/stimulated/text() 'Y' return ltpatientgt pa/pnum pa/viq pa/age_at_registrationgt lt/patientgt lt/resultgt
XQuery expression
XML source document
6Motivations for a graphic query system
- Creating XQuery is difficult
- Unfamiliar XQuery syntax and semantics
- Need explicit knowledge of the source data schema
- Goals
- Implement the Query-By-Example (QBE) paradigm
- Simplify query construction for novice users
- Expedite query generation process for expert
users - Balance between usability and expressivity
7Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and the XQuery Graphic Interface
(XGI) system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
8Design approaches
- Structured query approach
- Graphical interface is simple
- Query process is quick and uncomplicated
- Output format is pre-determined
- Users are not exposed to the underlying querying
language - Unstructured query approach
- Arbitrarily construct the output format
- Able to generate more expressive XQuery
statements - Complex query interface
-
9Existing systems
- Structured query approach
- QSByE
- QURSED
- XBrain
- Unstructured query approach
- BBQ
- XQBE
- Stylus Studio
10Existing systems
- Structured query approach
- QSByE
- QURSED
- XBrain
- Unstructured query approach
- BBQ
- XQBE
- Stylus Studio
11QURSED
- Query and Reporting Semistructured Data
- Developers create XML-querying forms for
end-users
Displays source schema in a tree
Web-based query forms
Uses output template to define structure
End-users cannot modify the query form, the
output template, and the generated query
Developers have to create the query form and the
output template for every single query
12XBrain
- Distributed query system
- Developers create saved queries for end-users to
execute
Allows users to modify and save custom queries
Very simple query interface
Novice users need developers to create more
complex queries
Output format is pre-determined
13XQBE
- XQuery By Example
- Users use the interface define the source and the
construct tree
Able to generate fairly complex queries
Free and still is being supported
Accepts multiple source schema formats
Requires users to have explicit knowledge of the
source data schema
Elaborate syntax and semantics
14Stylus Studio
- Comprehensive XML editing, publishing, and
querying tool - Novel query interface design by explicitly
constructing XQuery expression
Able to create very expressive XQuery statements
Displays the source schema as a tree
Expensive
Not open source or web-based
15Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and the XQuery Graphic Interface
(XGI) system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
16System requirements
- Reduced cost of implementation
- Support for multiple schema formats
- Navigable source tree
- Powerful XQuery creation
- Easy integration with other applications
- Support collaboration
17Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and the XQuery Graphic Interface
(XGI) system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
18My approach
- Reduced cost of implementation
- Web-based using Asynchronous JavaScript and XML
(AJAX) technology - Shared installation and resources
- Support for multiple schema formats
- XML Schema, Document Type Data (DTD), and
auto-extract schema from XML document - Navigable source tree
- Uses hierarchical tree to represent the nested
XML source schema
19My approach (cont.)
- Powerful XQuery creation
- Implements a subset of XQuery
- Easy integration with other applications
- Uses open source toolkits
- Implements modular design
- Support collaboration
- Allows users to save queries with
self-explanatory names
20System architecture
Client
Web Browser
Local Filesystem
Graphic interface scripts
Data Model
Translation Engine
Schemas File Management
Schema Preprocessor
Schemas
Server Filesystem
XQuery Generation Engine
Data Model Controller
Server
21XQuery generation engine
ltquerygt ltflwor_expgt ltstartTaggt ltquerygt ltendTaggt ltflwor_expgt ltforgt ltwheregt? ltreturngt ltforgt for ltsome_vargt ( , ltsome_vargt ) ltsome_vargt ltvar_namegt in ltpath_expgt ltwheregt where ltconstraintgt? ltconstraintgt ltpredicategt ( and ltpredicategt ) ltpredicategt exists( ltpath_expgt ) lt pred_expgt ltpred_expgt ltexpressiongt ltoperatorgt ltexpressiongt ltexpressiongt ltconstgt ltvariablegt ltoperatorgt lt gt lt gt ! ltreturngt return ( ltemptyTaggt ltpath_expgt ) return ltquerygt ltstartTaggt ltltnamegt ltattrgt? gt ltendTaggt lt/ ltnamegt gt ltemptyTaggt lt ltnamegt ltattrgt? /gt ltattrgt (ltnamegt ltpath_expgt ) ltnamegt valid name of schema elements ltpath_expgt XPath expression ltvariablegt any variable that has been bound to an outer schema element ltconstgt a constant value of the schema element ltvar_namegt an automatically generated, non-duplicative name for a variable
- Uses an Extended Backus-Naur Form grammar
- Retrieve the query schema from the data model
controller - Preprocess the schema to fit the grammar
- Return the generated query to the query interface
22Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and XQuery Graphic Interface (XGI)
system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
23Interface layout
Document name panel
Toolbar panel
Search box
Query panel
Source panel
Saved predicate panel
Information panel
24Example query 1
ltresultsgt for pa in root/patient return ltpatient id"pa/pnum/text()"gt pa/sex pa/viq lt/patientgt lt/resultsgt
ltrootgt ltpatientgt ltyear_of_birthgt lt/year_of_birthgt ltwada_commentsgt lt/wada_commentsgt ltwada_memorygt lt/wada_memorygt ltwada_languagegt lt/wada_languagegt lthandednessgt lt/handednessgt ltsexgt lt/sexgt lttypegt lt/typegt ltgao_research_numgt lt/gao_research_numgt ltdescriptiongt lt/descriptiongt ltpregt lt/pregt ltsizegt lt/sizegt ltpnumgt lt/pnumgt ltviqgt lt/viqgt ltage_at_registrationgt lt/age_at_registrationgt .. . lt/patientgt lt/rootgt
CSM database schema
25Load a source schema
26Insert the root node
27Add nodes to the query schema
28Add an attribute
29Create XQuery
30Example query 2
ltresultsgt for pa in root/patient where exists(pa/is_public) and pa/surgery/csmstudy/trial/stimulated/text() 'Y' return ltpatient id"pa/pnum/text()"gt pa/sex pa/viq ltagegt pa/age_at_registration/text() lt/agegt for tr in pa/surgery/csmstudy/trial return lttrialsgt tr/trial_num lt/trialsgt lt/patientgt lt/resultsgt
31Add a user-defined node
32Change node relation
33Add existential quantification
34Add a predicate
35Change node name
36Create XQuery
37Outline
- Needs for graphically querying XML
- Existing graphical query solutions
- Requirements for a successful system
- My approach and XQuery Graphic Interface (XGI)
system overview - Using XGI to build a XQuery
- System validation and evaluation
- Discussion and conclusions
38Validation
- XGI vs. XQBE
- Compare features
- Compare capable queries
- Recreate queries from XBrain
- Language-error queries
- Custom saved queries
39Compare features with XQBE
Feature XQuery XQBE XGI
Existential Quantification Yes Yes Yes
Conjunction Yes Yes Yes
Breadth Projection Yes Yes Yes
Depth Projection Yes Yes Yes
Renaming Yes Yes Yes
New Element Yes Yes Yes
Join Yes Yes Partial
Cartesian Product Yes Yes Partial
Flattening Yes Yes Yes
Nesting Yes Partial No
Filtering Yes Yes No
Negation Yes Partial No
Aggregates Yes Yes No
Arithmetic Computations Yes Yes No
Sorting Yes Yes No
40Recreate queries
- Able to generate 13/23 queries capable by XQBE
- Generate all language error queries from XBrain
- Expert users created custom queries in XBrain
- Fully or partially recreate 22/43
- Cannot recreate 21/43
41User Evaluation
- Only one expert user used the system informally
- Installation
- Require multiple packages that should be bundled
into a deployable archive file - Need to change a few system settings
- Certain features could be more easily accessible
- Need to support more features
- More feedbacks on the limitations of the interface
42Discussion
- XGI is capable of generating a large subset of
XQuery - Limitations
- Does not support functions and some query
constructs - Saved queries are constrained by the query schema
43Future work
- Support more extensive collaboration
- Implement more XQuery features
- Let, Order by, etc
- XQuery functions and user-defined functions
- Improve UI and enable browser compatibility
44Conclusion
- XGI is a simple and effective graphical query
tool for assisting both novice and expert users
to create complex XQuery statements quickly and
accurately.
45Thank You!