Proposal for ISSUE-11: Default prefix declarations

One of the criticisms of RDFa 1.0 is that certain snippets may fail
under cut and paste scenarios. This criticism comes from two directions:

1. It has been asserted that the xmlns: syntax for prefix declaration
   is confusing and that authors may not use it correctly.
2. It has been asserted that authors may haphazardly copy-and-paste
   popular RDFa markup such as SIOC, FOAF or Dublin Core terms.

So, for example, an author may take this:

<div xmlns:dc="http://purl.org/dc/elements/1.1/">
   ...
   <div about="/alice/posts/trouble_with_bob">
      <h2 property="dc:title">The trouble with Bob</h2>
      <h3 property="dc:creator">Alice</h3>
      ...
   </div>

and copy-and-paste just this part into their document:

   <div about="/alice/posts/trouble_with_bob">
      <h2 property="dc:title">The trouble with Bob</h2>
      <h3 property="dc:creator">Alice</h3>
      ...
   </div>

This copy-paste error in RDFa 1.0 would result in no triples being
generated because the "dc:" prefix is undefined. The author forgot to
copy the xmlns:dc="..." declaration.

We could address the most common markup errors by defining a list of
default URI mappings, for example:

"""
The list of default URI mappings is:

   rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
   rdfs: http://www.w3.org/2000/01/rdf-schema#
   dc: http://purl.org/dc/terms/
   foaf: http://xmlns.com/foaf/0.1/
"""

We would then modify the initialization of the RDFa Processor in Section
5.5: Sequence[1] from this:

"""
   the list of URI mappings is empty;
"""

to this:

"""
   this list of URI mappings is set to the list of default URI mappings;
"""

The default list of URI mappings can be overwritten during operation of
the processing rules. So, if the author re-defines the "dc" prefix in
the current context to another value, the new value would be used to
generate triples in the current context.

Note that this proposal does not attempt to determine the ideal list of
default URI mappings. That would be best accomplished by using the "top
N list of most commonly requested vocabularies" on prefix.cc[2], getting
prefix usage data from Google or Yahoo, or using another data-driven
approach that can be done at a later time. Preferably, we would wait
until just before Last Call to finalize the list of default URI mappings.

Also note that another benefit of this proposal is that the author will
not need to declare prefix mappings using xmlns: for the most commonly
used RDFa prefixes.

-- manu

[1] http://htmlwg.mn.aptest.com/rdfawg/rdfa-core/#sequence
[2] http://prefix.cc/

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: PaySwarming Goes Open Source
http://blog.digitalbazaar.com/2010/02/01/bitmunk-payswarming/

Received on Monday, 1 March 2010 03:51:49 UTC