![]() |
|||||||||
![]() |
|||||||||
|
|
|||||||||
|
December 26, 2003
RDF intro, part 2
In my last post, we learned that RDF is all about describing resources, and that resources are referenced with URIs. So how does it describe them? Let's start by looking at the source of this very page (View / Page Source). There's two snippets of RDF embedded in the HTML. The first helps tools like Movable Type create what are called "trackbacks", links to this post from other people's posts. Here's the RDF:
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about="http://bigfractaltangle.com/archive/2003/12/26.jsp"
trackback:ping="http://immuexa.com/cgi-bin/mtype/mt-tb.cgi/80"
dc:title="RDF intro, part 2"
dc:identifier="http://bigfractaltangle.com/archive/2003/12/26.jsp"
dc:subject="Tangle Yarns"
dc:description="In my last post, we learned..."
dc:creator="timothy"
dc:date="2003-12-26T21:49:46-08:00" />
</rdf:RDF>
-->
First, notice that the entire snippet is surrounded by HTML comments. This practice hides the code from older browsers. It also helps the page validate as official HTML. Next, look at the surrounding <rdf:RDF> tags, which define the snippet as RDF. They also define the namespaces we're using. What's a namespace? Well, a big problem with computers is that people often use the same terms for slightly different things. When I say "subject," I may mean "email subject." When you say it, you may mean "category." If we tried to mix our data together, your subjects would clash with my subjects, and it'd be a big mess. Namespaces let people say, "These words have my meaning." They're kind of like our own private dictionaries. We indicate a word is from a particular namespace by putting a special prefix in front, such as "dc:subject." This lets the computer know we're talking about a "subject" as understood in the "dc" namespace (or dictionary), as opposed to "mail:subject", which uses the "mail" namespace. A big part of RDF is defining these separate vocabularies so we can put labels on things without stepping on each other's toes. To indicate that you want to use a particular namespace, use an "xmlns" attribute, followed by an equals sign, followed by the URI of the official namespace definition, or "schema". In this snippet, we're using three namespaces: 1) the RDF namespace, rdf, 2) the trackback namespace, trackback, and 3) the Dublin Core namespace, dc. So we've got three namespaces, but what does the damned thing do? Well, RDF is the Resource Description Framework, so it must be describing a resource. Which resource? For a clue, look at the <rdf:Description> tag. What's it "about"? Ah ha... there's one of them URI things (http://bigfractaltangle.com/archive/2003/12/26.jsp). Looks like we're describing this very page by specifying several of its properties: its creator (dc:creator), its date (dc:date), its title (dc:title), etc. Movable Type uses this information to reference this page from other websites. So, RDF describes a resource in the <Description> tag. The resource is identified in the "about" attribute. The remaining attributes in the tag make up the actual description, which is essentially a collection of properties about the resource. Properties are specified using namespace qualified names, such as "dc:title". As you would expect with XML, properties can also be written out as tags instead of attributes. This snippet is the same:
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about="http://bigfractaltangle.com/archive/2003/12/26.jsp" >
<trackback:ping> http://.../mt-tb.cgi/80 </trackback:ping>
<dc:title> RDF intro, part 2 </dc:title>
<dc:identifier> http://.../2003/12/26.jsp </dc:identifier>
<dc:subject> Tangle Yarns </dc:subject>
<dc:description> In my last post, we learned... </dc:description>
<dc:creator> timothy </dc:creator>
<dc:date> 2003-12-26T21:49:46-08:00 </dc:date>
</rdf:Description>
</rdf:RDF>
-->
"Wait a minute," you may say. "All this fuss is about specifying properties? Can't we do this with a dozen other 'description frameworks', like say SQL or UML or JavaBeans?" Yep. Nothing's new under the sun. From one perspective, RDF's simply another way to describe your average "record" in just about every computer language you've ever heard of. Properties and values, applied to some thing, which this time we're calling a resource. So why bother with RDF? For that, tune in next time...
Comments |
About Me Contact Me being real blogosphere events interconnectedness isabel making money musings olpc photo stories saving the world semantic web squeak etoys tidepool and storymill usability waveplace computer literacy new videos from st john pilot back from st john immuexa turns ten XO donor comments photos from haiti and st john pilots haitian pilot starts give two, keep none story: fall 2007 good press RDF Intro Angela Talk: a semweb introduction W3C Semantic Web Original Road Map SciAm Article SemanticWeb.org RDF Resource Guide SchemaWeb SUMO Full Article Index April 2008 March 2008 February 2008 January 2008 November 2007 October 2007 September 2007 December 2006 September 2006 May 2006 April 2006 March 2006 February 2006 January 2006 December 2005 November 2005 September 2005 August 2005 July 2005 May 2005 April 2005 March 2005 January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 link to this site
![]()
|
||||||||
![]() |
|||||||||
|
"Big Fractal Tangle" is a phrase used by Tim Berners-Lee at ISWC 2003
to describe his vision of the Semantic Web (used with permission) "Tidepool" and "Storymill" are trademarks of Immuexa Corporation. Website design copyright © 2003-2004 by Immuexa. |
|||||||||