Abstract
RDF's relationship with XML is not always as smooth as it might be. In particular the XML serialisation is a clear example of the problems uniting a graph structure (the RDF model) with a tree structure (XML).
From an XML perspective the RDF serialisation can appear perverse, with the potential for a wide variety serialisations for semantically identical data. There is no canonical, or even normal, RDF XML serialisation. Moving to RDF tools, however, means losing beloved XML tools.
Conversely RDF users find XML tools of limited utility since they are forced to think in terms of the serialisation rather than the model. In addition XML tools do not provide RDFS and OWL inferencing support, an increasingly important feature in RDF tools.
Treehugger is an attempt to provide a bridge between XML and RDF. Specifically it glues an XML tool, in the form of XPath (using Saxon), to an RDF model (Jena 2). The ideal is to provide XML developers a familiar means to access the RDF model, while conversely providing some useful tools for RDF developers: namely XPath, and by extension XSLT and XQuery, access to an RDF model.
Treehugger gives RDF models the appearance of an 'ideal' XML serialisation, one where the whims of the serialiser are not visible. The results of an XSLT stylesheet on identical models will be the same, even if the XML serialisations very wildly. In addition existing stylesheets and queries, designed with a particular XML form in mind, will often work in Treehugger.
This has a further virtue in that Treehugger can provide a gentle introduction to the RDF model, allowing a smoother migration from XML to RDF toolkits.
The is achieved by dynamically building a tree from the RDF model; in essence Treehugger is a mapping between the XPath and RDF models. It is inspired by the striped RDF/XML syntax, hence many existing stylesheets work. There are, of course, problems inherent in this approach, particularly the mapping of the document root to a rootless graph, and the issue of cycles in the graph (for example in the descendant-or-self axis).
Finally there is the relationship with existing RDF query languages. RDF querying is a vibrant field, and the W3C is currently creating a data access workgroup which includes querying in its scope. Treehugger is effectively another rdf query system, though using paths rather than graph matching. The differences in the path and graph approaches, and particularly the effectiveness, is also discussed.
Keywords
![]() ![]() |
Design & Development by deepX Ltd. |