Wednesday, September 20, 2006

RDF/A support in TopBraid Composer

Ok, I have done my homework and have created this nice RDF/OWL ontology. But how can I put it on my web page? What can I actually do with my ontology? - we all have seen many variations of this question on various mailing lists. Here is one potential answer.

RDF/A (sometimes spelled RDFa) is an evolving working draft in the context of W3C's Semantic Web activity. RDF/A can be used to embed RDF/OWL into XML languages. In particular, RDF/A defines a collection of attributes for embedding RDF data into XHTML pages.

This is a potentially very important step towards implementing the Semantic Web vision, because it provides an incremental entry point for mainstream Web developers. These people are typically experts in HTML, but find RDF rather scary to look at. RDF/A enables them to add a few tags into their existing web pages, so that Semantic Web enabled web browsers and agents can process additional (meta) data in a machine-readable format.

To get an idea how this works, have a look at Dean Allemang's class announcement page http://www.topquadrant.com/seminars/topmind.htm

A user visiting this page with a browser will see a typical internet page describing upcoming seminars with links to a flyer, dates and locations. However, a closer look into the HTML source code reveals additional tags like the following:



The highlighted parts are RDF/A tags defining RDF triples - here to specify start and end time of an event, as well as the geographical location of the venue. In the spirit of next-generation Web applications, this extra information can be extracted on the fly and used for all kinds of interesting services. For example, a simple Firefox plugin would enable users to drag cal:-tagged items into their personal calendar, or to visualize geo:-tagged locations on a map.

In this spirit, our ontology development platform TopBraid Composer now also supports RDF/A data sources. Download version 1.2.2 and use the Import wizard to connect to the Web page link above. This will create a virtual proxy ontology which you can then import into other RDF/OWL projects. For example, you can import it into the geotravel ontology. A look at the Triples View will then reveal the additional triples:




These RDF/A triples are treated like any other subgraph of the overall model, i.e. you can run SPARQL queries on them, classify them according to OWL semantics, and visualize them. In this particular case, you can use Composer's Geography support to show the seminar venues on a Google map (click for a larger image):


We are working on additional mash-up facilities within TopBraid Composer so that developers can benefit from very rapid turn-around times between ontology design and testing.

In order to get this going, I wrote an RDF/A parser based on SAX and Jena. During the development of this parser it became obvious that RDF/A is still evolving and not stable yet. However, the language is fairly small and therefore easy to adopt.

Many people argue that a limitation of RDF/A is that it only works for well-formed XML files. On the Web, of course, few people are using XML-compliant HTML (XHTML), so that adding RDF/A tags is often painful. We were hit by this problem ourselves, when Dean added the RDF/A markup to his existing web page - a page that had a long history with lots of manual edits with many different tools. We solved this problem by adding an optional pre-processor based on JTidy, an HTML to XHTML converter. Using this pre-processor, TopBraid is much more forgiving to ill-formed HTML.

Sincere acknowledgements to Elias Torres for providing me with helpful advice and test cases for the RDF/A parser, and to Dean Allemang who suggested to implement this feature in the first place. Note that both his example web page and our RDF/A support are work in progress - please stay tuned and let us know what you think!

1 Comments:

At 5:34 PM, Anonymous Anonymous said...

Good example but I think we'll have to set the bar higher for RDF/a. Using the Operator plugin for Firefox I can go to Upcomming.org and export events directly into my outlook calendar. Same for reviews and other types of data...no RDF, no OWL, and no expensive tool necessary. Just a few microformats inserted into the xhtml.

 

Post a Comment

<< Home