W3C home > Mailing lists > Public > public-ws-semann@w3.org > November 2006

Some text about why we need to combine SPARQL with XSLT in lowering schema mapping

From: Jacek Kopecky <jacek.kopecky@deri.org>
Date: Tue, 28 Nov 2006 18:00:03 +0100
To: SAWSDL public list <public-ws-semann@w3.org>
Message-Id: <1164733203.4191.204.camel@localhost>

Hi all, in (potential) fulfillment of my action item, below is an
unpolished first draft text talking about why we can use only XSLT for
lifting schema mapping but we need SPARQL and XSLT for lowering schema
mapping. This text should help the editors justify in our documents that
we use so many other technologies for our mappings.

Hope it helps,
Jacek

Schema mapping annotations in SAWSDL are realized in two directions - lifting
and lowering. Lifting schema mapping transforms XML data into instances of a
semantic model, and lowering schema mapping does the opposite, it transforms
semantic model instances into XML data.

For example, an RDF-based semantic Web service client may wish to invoke an
operation that it earlier discovered. The client would have some RDF data
that it intends to pass to the operation as the request XML message, lowering
from RDF to XML. When the service replies with the response XML message, the
client will need to lift the data back to RDF in order to process it.

Our examples show lifting schema mappings using XSLT or XQuery, either one
will take the XML data (e.g. coming from the Web service) and produce RDF
data in the RDF/XML syntax. This is rather straighforward.

Lowering schema mappings are more complex, because of the flexible nature of
RDF/XML. RDF/XML is an XML serialization of the graph-of-triples model of RDF
data. In essence, RDF data is always an unordered set of triples consisting
of a subject, a predicate and an object. The XML serialization puts the
values of these parts of the triples alternatively into namespace-qualified
XML element and attribute names, and into character values of elements or
attributes. Languages like XSLT or XQuery rely on XPath to find and select
data in XML structure. XPath is geared towards more fixed XML structures, so
it takes different XPath expressions to select for instance predicates, which
can be encoded as elements or attributes in many places within an RDF/XML
document. XPath (and by extension XSLT and XQuery) does not provide means of
ignoring the purely syntactical differences in the various possible RDF/XML
serializations of otherwise equal RDF graphs, therefore all alternatives have
to be accounted for in the XSLT stylesheet or XQuery query.

Practice has shown that it is a very hard task to create XSLT or XQuery
transformations that take arbitrary RDF/XML as input. Instead, we envision
that lowering schema mappings (for RDF-based semantic models) will use RDF
query languages either to construct the final XML, or to construct a stricter
form of XML that can then be input to XSLT or XQuery to produce the final XML
structure. In our examples, we combine SPARQL to query the RDF data and
procude an XML table of variable bindings, and XSLT that transforms this XML
table into the required XML.

To conclude, if we use RDF as the base for our semantic model, we can easily
use XML transformation technologies like XSLT or XQuery for lifting schema
mappings, but for lowering schema mappings we can only use the XML
technologies if combined with an RDF query language like SPARQL to preprocess
the RDF data.
Received on Tuesday, 28 November 2006 17:00:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 17 April 2012 12:14:27 GMT