Semantic Webapps? Lightweight RDF interfaces for SVG

SVG and RDF together provide the basis for the graphical user interfaces and abstract data models of next-generation Web applications. To fulfil this potential, SVG-based application developers will need to work with RDF data associated with SVG and raster image content. This paper outlines the current situation regarding RDF APIs and query languages, sketching a lightweight API design for SVG metadata access which is be consistent with the approaches used in systems such as Adobe's XMP system, Mozilla's XUL, and W3C's emerging RDF Data Access language and protocol.

W3C's Resource Description Framework (RDF) provides a set of conventions for mixing together descriptive data in XML. Although RDF is written in an XML syntax, the use of XML-level tools (DOM, SAX, XSLT) for accessing and manipulating RDF/XML documents can be problematic, since they can't directly exploit knowledge of RDF's abstract data model and schema languages (RDFS, OWL). The <metadata> tag in SVG encourages the use of W3C's Resource Description Framework (RDF) as an architecture for encoding metadata about SVG content and the things that such content represents. While the SVG DOM interface exposes the unprocessed RDF/XML through the SVGMetadataElement construct, there is potential for the creation of a simple, pragmatic RDF API that could be used to expose RDF metadata in terms of RDF concepts such as classes, properties and relationships.

An increasing number of documents and images contain RDF information relevant to SVG applications. There are a growing number of RDF "ontologies" which define vocabularies (associated with RDF/XML namespaces) each tuned to describing things in a particular domain. For example, the Dublin Core metadata vocabulary describes document-like objects, Creative Commons describes rights metadata. FOAF describes people and expresses homepage like content; XMP captures workflow information, SKOS represents thesaurus-based taxonomies, etc. Other RDF vocabularies address the descriptive needs of geographic and mapping apps, desktop tools (eg. Mozilla), and large scale taxonomies (Wordnet, TAP, Cyc, ...).

Almost all RDF APIs are designed such that the functions/methods are neutral regarding the RDF vocabularies they expose. This means that a single RDF API can be used to access a vast range of metadata fields: we don't need to define one API for rights metadata, another for RDF/EXIF, a third for content taxonomies. Furthermore, a basic interface to RDF data can be achieved with a single data access method. Even with refinements and convenience additions, there is a conceptual simplicity associated with RDF APIs, since they can all be understood in terms of sub-graph matching; either in terms of matching against a template RDF statement, or against a template RDF graph structure.

Embedded metadata may describe workflow properties, Exif data, creative commons information about allowable uses of the images, or user-defined RDF metadata about any aspect of the document or any other object, as RDF can be used to describe anything. There are also increasing numbers of self-contained RDF data documents on the web describing people, headlines and other entities relevant to SVG images yet not specifically image-centric. This information available could be made available to SVG applications via the SVG 1.2 getURL DOM interface.

At the time of writing, many RDF APIs exist but there is no one standard; work at W3C is currently focussed on a query language for RDF within the Data Access Working Group. However there is a great deal of implementation experience in multiple languages and applications, including Mozilla (specifically the XUL templating language) and in Abobe's XMP-reading software, as well as APIs in Javascript, Java, C#, C, C++, PHP.

In this paper we suggest some possible approaches to an RDF API for SVG based on current implementation experience. We argue that modest design effort and surprisingly simple technical details could provide us with an API for accessing RDF data within SVG, and that this would support a variety of interesting next-generation Web applications which combine the power of SVG graphics with RDF's data modelling and merging facilities.