Visions of Aestia

10 Dec 2004

RDF/OWL == XML/XSLT, part 1

Filed under: Programming, PlanetRDF — JBowtie @ 2:43 pm

Once upon a time, you used to have to explain XML to a group of IT people who had never heard of it. You’d give a little speech starting “XML is just like HTML except….”, followed by the five or six key points about XML. It was of course a drastic oversimplification and lots of details were glossed over, but everyone understood the basic concepts.

This is my attempt at a similar stab at getting everyone to understand RDF/OWL.

RDF and OWL are just like XML and XSLT. Let me illustrate.

A chunk of XML describing a person might look like this:


Clifford

123 Main St


If you wanted to link to this chunk of XML, you would use something like:






Notice how the ID is used to identify the chunk of XML you care about, and how a URL is used to refer to it from somewhere else. In this example, we might use some XSLT to create a web page with links to the XML describing my relatives. Most of us have seen stuff like this, this is how HTML links work.

RDF works exactly the same way. We identify some chunk of RDF with an ID, and use a URL to refer to it from somewhere else. We use rdf:resource in place of the href, and rdf:id so that RDF recognizes the id.






Cool. I can still turn this into a web page without thinking too hard. Any RDF-aware program can follow the links and get the XML describing my uncle Cliff.

I’m not just confined to linking to my uncle’s XML, though. I can add to it pretty easily by using a rdf:Description element.








Cliff
United States

As far as any RDF application is concerned, this is exactly the same as if I edited the original document to look like this:


Clifford

123 Main St

Cliff
United States

What the RDF parser is doing (conceptually) is following the link to get the original XML, then adding anything contained in the description block to get the final XML it ends up showing you. I could do this manually in XSLT by writing a transform, at least for simple cases.

There is only one other thing you need to know about RDF.

Most RDF browsers don’t actually care if a document you link to exists; they just won’t be able to show you much information. If example.org/family.xml is deleted, the browser will only show my uncle’s nickname and country. But that’s fine, it can still combine any other description blocks it finds that link to him. From an RDF perspective, the URL is just a unique identifier, like a database key.

The bit about adding description blocks together is really key. When I don’t have access or permission to modify an XML document, I can create a description block so that it appears (to an RDF browser) that I’ve made the changes anyway.

On to OWL in my next post.

2 Responses to “RDF/OWL == XML/XSLT, part 1”

  1. Says:

    RDF/OWL == XML/XSLT
    If you haven’t heard of John C. Barstow my guess is that sooner or later (or how about right now :) you will. In a post I made last week in regards to the thought that I may be the…

  2. Visions of Aestia » Dumb RDF and Smart RDF Says:

    […] 6 pm

    Once you understand that RDF is really just a distributed form of XML (see RDF/OWL == XML/XSLT, part 1 if needed), you’ll probably want to start taking advantage of it […]

Leave a Reply

Powered by WordPress