Teaching XML databases with eXist - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Teaching XML databases with eXist

Description:

Use ER models to capture understanding of Flickr, an online photo album ... Language extensions (free-text matching and update) Schema validation supported ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 17
Provided by: chr1
Category:

less

Transcript and Presenter's Notes

Title: Teaching XML databases with eXist


1
Teaching XML databases with eXist
  • Chris Wallace
  • Senior Lecturer
  • School of Information Systems
  • University of the West of England, Bristol, UK
  • TLAD 2006
  • 18th July 2006

2
Outline
  • The teaching context
  • The rationale for XML Databases
  • eXist as a suitable Native XML database
  • Conceptual data modelling
  • Conceptual language modelling
  • Issues

3
The teaching Context
  • Multimedia Computing Programme
  • First year Java, HTML, web applications with Perl
  • Level 2 module Data, Schemas and Applications
  • Broad coverage of data structures
  • Tables
  • Tagged structures
  • Trees
  • Sequences
  • Web application development
  • Emphasis on transferable knowledge

4
The workplan
  • Semester 1
  • Use ER models to capture understanding of Flickr,
    an online photo album
  • Groups of 3 Use PHP and MySQL to implement a
    baby Flickr
  • Semester
  • Use XML to structure data (Whisky data)
  • Use XQuery and eXist to develop individual
    XML-based application (jh)

5
The Rationale for XML database
  • Case study the CEMS FOLD
  • A faculty web site providing staff and students
    with information about
  • Modules
  • Programmes
  • Staff
  • Organisational structure

Word documents
Spread sheets
SQL DB
JPEGs
LDAP
6
Why not an RDBMS?
  • Documents
  • Unit of editing, ownership, communication
  • Complex composite structures
  • Ordering and other complex relationships
  • Linked by shared values
  • Spreadsheets
  • Familiar data organisation tool
  • Process descriptions
  • eBXML

7
structured text
composition
Complex expressions
associations
ordering
subtypes
8
eXist Native XML Database
  • Open source Java
  • European team of developers led by Wolfgang
    Meier(Darmstadt)
  • Documents (files) are organised in collections
    (folders) in a file store
  • XML Documents stored in an efficient, B tree
    structure with indexes
  • Non-XML resources (XQuery, CSS, JPEG ..), etc can
    be stored as binary
  • Deployable in different ways
  • Embedded in a Java application
  • With embedded Jetty HTTPserver
  • Multiple Interfaces
  • REST to Java servlet
  • SOAP
  • XMLRPC
  • Support for XQuery
  • Function library extensions
  • Language extensions (free-text matching and
    update)
  • Schema validation supported
  • Database is not schema-aware no type
    information available

9
NDX/RDBMS similarities and differences
  • Similarities
  • Associations implemented via common values
  • Differences
  • NDX can store documents without a prior schema
    agile modelling
  • Composition implemented via containment
  • Sequence directly supported
  • XQuery fulfils the role of SQL (PL/SQL,PHP,JSP)

10
SQL and XQuery
  • SELECT FROM emp WHERE deptno 10
  • //Empdeptno 10
  • SELECT empno, location
  • FROM dept, emp
  • WHERE dept.DEPTNO emp.DEPTNO
  • for e in //Emp
  • let d //Deptdeptno e/deptno
  • return (e/empno,d/loc)
  • SELECT e.ename,m.ename
  • FROM emp AS e, emp AS m
  • WHERE e.mgr m.empno
  • AND e.deptno 20
  • for e in //Empdeptno 20
  • let m //Empempno e/mgr
  • return ltempgte/ename ,m/enamelt/empgt

11
Simple Table Example
  • Data on Excel spreadsheet
  • Convert to XML (Excel add-in)
  • Save as XML data
  • Load into eXist database
  • Run trip.xql to find and generate XQuery to
    generate .kml file
  • View with GoogleEarth

12
Stored Query
  • lthtmlgt
  • ltheadgt
  • lttitlegtBSA trip reportslt/titlegt
  • lt/headgt
  • ltbodygt
  • lth1gtBSA trip reportslt/h1gt
  • lttable border"1"gt
  • lttrgtltthgtStart Datelt/thgtltthgtTriplt/thgtlt/trgt
  • for trip in collection("/db/chriswallace/voyage")
    //trip
  • return
  • lttrgt
  • lttdgtstring(trip/startDate)lt/tdgt
  • lttdgtstring(trip/title)lt/tdgt
  • lttdgtlta href"trip2kml.xql?idtrip/id"gtGoog
    le Earthlt/agtlt/tdgt
  • lttdgtlta href"showtrip.xql?idtrip/id"gtShow
    triplt/agtlt/tdgt
  • lt/trgt
  • lt/tablegt

13
Conceptual Data Models
  • QSEE allows conceptual data models to be created,
    and then SQL DDL generated with
  • Foreign key generation
  • Composite primary keys
  • Many-many resolution
  • Creates the necessary separation between the
    conceptual model and its realisation in a given
    logical data model
  • The student to develop a sense of the utility of
    ER models across a wide range of structures

14
Conceptual Language Model
  • Web development calls for multiple languages
    Java, JavaScript, Perl, PHP, XQuery, XSLT, SQL
  • This provides the opportunity and need to try to
    dig down to the common conceptual models e.g.
  • Formal/informal language mixture
  • Structured programming
  • Modularity

15
Issues
  • Controlled exposure to language
  • Complexity of XQuery versus SQL
  • Schemas hindrance or lifeline?
  • Tools for conceptual modelling
  • Weaker students

16
Takeaways
  • XQuery and the eXist Native XML database are the
    most fun Ive had since Smalltalk
  • actually more because it delivers useful systems
  • Take the code to the data, not the data to the
    code
  • PHP/ Java
  • loading and unloading XML ltgt internal structures
    (SAX, DOM)
  • XQuery/XSLT
  • Direct operations on the persistent XML data
  • Content is king
  • A successful Information system depends on
  • Data quality model fidelity more than model
    integrity
  • Handling multiple, sometimes inconsistent, views
    of the world
Write a Comment
User Comments (0)
About PowerShow.com