[whatwg] RDFa Features
msporny at digitalbazaar.com
Wed Aug 27 10:18:20 PDT 2008
Kristof Zelechovski wrote:
> Has anyone considered having an URI in an entity in order to avoid typing it
> over and over?
> <!DOCTYPE html
> <!ENTITY myVocab "http://www.example.com/vocab/" >
> And later
Yes, we did discuss this at great length in the RDFa community and to a
lesser extent in the Microformats community. The Microformats community
decided to not use namespaces at all, and the RDFa community ended up
using CURIEs for URI expression. RDFa specifically did not choose QNames
for the following reasons:
1. We believe QNames should not be used in attribute values.
2. QNames are really restrictive in what can be used as a "reference".
3. Qnames do not expand to URIs, they map to a tuple and RDFa (and many
other approaches that use URIs as resources) need things to map to
The CURIE spec, which is a really cool solution to the problem of
compact URI expression in all HTML family languages, explains these
points in more detail:
To answer your question more directly, there were several issues with
the ENTITY approach for defining prefixes:
1. The markup is ugly and would be difficult for most regular web folks
to grasp. Not many people that modify web pages have to deal with
entity declarations, or using entities outside of the < >:
realm. This would harm adoption.
2. It is becoming more and more common, when using online blogging,
CMSes, and publishing software that you don't have access to the
entire HTML document as you edit it. The @xmlns:NAMESPACE and @prefix
approach takes this limitation into account. It allows one to do the
...JANE'S BLOG POST...
...BOB'S BLOG POST...
...MY BLOG POST
<div xmlns:foaf="http://xmlns.com/foaf/0.1/" about="#me">
This is my blog entry. My name is
<span property="foaf:name">Křištof Želechovski</span>.
...END MY BLOG POST...
Keep in mind that we still must modify the systems described above to
not strip out RDFa attributes from elements, but that work is merely
a small code change to the HTML processing code in most publishing
3. We needed a solution that would map cleanly to non-XML family
languages. In hindsight, we should have picked @prefix instead of
@xmlns to define prefixes, but that ended up going through. We're
looking at alternative mechanisms, such as having a @prefix
attribute, to declare prefixes in RDFa 1.1.
President/CEO - Digital Bazaar, Inc.
blog: Bitmunk 3.0 Website Launches
More information about the whatwg