advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
Rate this item | 0 users have rated this item.
Email this articleEmail this article
 
Simplifying RDFa Notation
Discover how to use namespace prefixes to define taxonomies and categorization through compact URI encoding (CURIE) to make the semantic web more accessible for web development.  

advertisement
esource Description Framework (RDF) is not the world's most beloved standard. That it is used most often in fairly obscure applications for handling such fundamental concepts as meaning, topicality, and the definition of objects that sound more like philosophy than computer science certainly doesn't help its case. That its use cases generally involve creating both interconnections and abstractions—operations that make most people's eyes glaze over—within external resources (it is the "resource description framework," after all) may have something to do with it too.

Perhaps the biggest problem that RDF faces is those pesky namespaces. The idea is reasonably sound—a term in a vocabulary has meaning only in the context of a given namespace. This idea may seem counterintuitive to the average Joe, but from a computer technology standpoint it makes a lot of sense. A computer has no concept of meaning, unless that meaning is made explicit for it by some formal definition (also known as a binding), with the term in the vocabulary consequently either identifying a given resource or invoking a certain behavior. In a nutshell, creating definitions is what writing programs is all about.

However, in the World Wide Web Consortium (W3C) universe, namespaces are also notable in that they have associated (and more important) unique Uniform Resource Identifiers (URIs). For instance, if you want to describe a vocabulary for electronic business cards, you'd likely end up using something like the vcard specification. The vocabulary namespace is given by http://www.w3.org/2001/vcard-rdf/3.0#, and a term such as a nickname is consequently encoded as http://www.w3.org/2001/vcard-rdf/3.0#NICKNAME.

Clear and unambiguous, right? Maybe. To a computer the syntax is clear, easily parsed into a namespace and its associated term, and it ensures that there isn't ambiguity (which is a big part of the challenge to the semantic web in the first place). However, to a human being http://www.w3.org/2001/vcard-rdf/3.0#nickname is an eye-glazing monstrosity, difficult to read, and even more difficult to type—something that frankly only a writer of mil spec documentation could love.
Anyone who works with such namespaces intrinsically understands the resolution to this issue—using prefixes.

The challenge presented here is how to make it relatively easy to encode contextual metadata into a web document: easy for the content developer, easy for the programmer, and easy for the user of this data. If such a solution can be found, it would simplify processing documents for relevant metadata without the cost of expensive natural language parsers or related tools, and without the overhead of maintaining separate metadata files for every page of a web resource—especially when such resources are themselves constructed from pieces contained in databases or aggregated from XML feeds.

There are shortcuts. You can declare the namespace in one part of an RDF document, and then just refer back to it with the #nickname portion. However, to a web designer especially, this approach treads dangerously close to a different usage of the # operator—specifically the HTML link tag <a href="#nickname">, where a corresponding link target exists: <a name="nickname">.

What's worse, this strategy breaks down whenever you have multiple namespaces in play, and then you're forced into the longer namespace notations to clearly identify the terms in question. While nickname is fairly unambiguous, something like category may be used in any number of different vocabularies, and while each may mean generally the same thing, the attributes that a vcard catalog exposes may be quite different from an Atom category, for example. Nevertheless, having to sling around http://www.w3.org/2001/vcard-rdf/3.0#category and http://www.w3.org/2005/Atom#category all day just doesn't fill one with joy.

Anyone who works with such namespaces intrinsically understands the resolution to this issue—using prefixes. After all, when you create an XSLT style sheet element, you don't generally use the form <http://www.w3.org/1999/XSL/Transform#stylesheet ...>. Instead, you declare a namespace prefix such as xsl, associate it with the namespace, and then use the prefix:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ...>
This solution is generally not that unambiguous, though it does require (especially in the case of default namespaces) that you need to keep track of the namespace stack for subordinate elements.

Not surprisingly, you're beginning to see the adoption of this notation informally in a lot of places beyond the formal qualified names (or QNames) of XSLT elements and attributes. For instance, using a notation like this makes it abundantly clear that the atom attribute specifically indicates the category term that's part of the atom specification, rather than the vcard one:

<div property="atom:category" xmlns:atom="http://www.w3.org/2005/Atom">
Unfortunately, there is a problem here—protocols. Web protocols such as http:, ftp:, mailto:, and so on all make use of the same colon (:) separator between the protocol and the rest of the URI. Additionally, even non-associated protocols, such as schema:, are often used for creating URIs as well. The syntax similarities make it more difficult for parsers to distinguish between a URI protocol and a namespace prefix, a process that significantly reduces the efficiency of any parsing operation.

  Next Page: Rad CURIEs
Page 1: IntroductionPage 4: Unique Taxonomy
Page 2: Rad CURIEsPage 5: The ROI for RDFa
Page 3: Dispersing RDF 
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES