Jump to content

XQuery/The Emp-Dept case study

From Wikibooks, open books for an open world

The Employee-Department case study used in the comparison of XQuery from SQL is used here to explore the XQuery/SPARQL pairing.


Conversion to RDF

[edit | edit source]

Taking as the starting point the XML documents defining the three tables:

These documents are converted to RDF using an XQuery script guided by a mapping file. The generated RDF is cached. and accessed by an XQuery script to de-reference the resource URIs.


Individual resource URIs are re-written in Apache to calls on an XQuery script which retrieves the fragment of RDF from the cached file. Thus;

This should be replaced by a query on the SPARQL endpoint.

RDF browsing

[edit | edit source]

This RDF can be browsed with and RDF browser such as Disco , OpenLink RDF browser OpenLink Data Explorer or Tabulator as an add-in to Opera or Firefox

Querying with SPARQL

[edit | edit source]

The RDF can be queried with SPARQL. The same queries uses in the SQL /XQuery example are expressed in SPARQL in this tutorial