W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > February 2011

Re: ISSUE-83 (CURIEs must require colon): CURIEs are dangerous when used in combination with @vocab and @about [LC Comment - RDFa Core 1.1]

From: Nathan <nathan@webr3.org>
Date: Sun, 06 Feb 2011 00:02:41 +0000
Message-ID: <4D4DE521.2020206@webr3.org>
To: RDFa Working Group WG <public-rdfa-wg@w3.org>
CC: Shane McCarron <shane@aptest.com>, Manu Sporny <msporny@digitalbazaar.com>
RDFa Working Group Issue Tracker wrote:
> ISSUE-83 (CURIEs must require colon): CURIEs are dangerous when used in combination with @vocab and @about [LC Comment - RDFa Core 1.1]
> 
> http://www.w3.org/2010/02/rdfa/track/issues/83

Note, this also affects @resource - there's more on the issue here:

  http://lists.w3.org/Archives/Public/public-rdfa-wg/2011Feb/0032.html

I've went through some different approaches and the one thing that 
appears to clear up both this issue, and the others mentioned, is to 
change the definition of CURIE so that the ':' is always present.

Here's some proposed text for the CURIE syntax section:

[[
The key component of RDF is the URI, but these are usually long and 
unwieldy. RDFa therefore supports a mechanism by which URIs can be 
abbreviated, called 'compact URIs' or simply, CURIEs.

A CURIE is comprised of two components, a prefix and a reference. The 
prefix comprises an optional prefix_name and always ends with a single 
colon (:).

The general syntax of a CURIE can be summarized as follows:

   prefix_name  ::=   NCName
   prefix       ::=   [ prefix_name ] ':'
   reference    ::=   irelative-ref (as defined in [RFC3987])
   curie        ::=   prefix reference
   safe_curie   ::=   '[' prefix reference ']'

Note: The prefix_name consisting of the single char '_' is reserved for 
usage with BlankNodes and has special meaning, implementations MUST NOT 
allow this prefix to be associated with a URI.

In normal evaluation of CURIEs the following context information would 
need to be provided:

- a set of mappings from prefixes to URIs;
- a mapping to use with the default prefix (for example, :p);
- a mapping to use with the '_' prefix, which is used to generate unique 
identifiers (for example, _:p).

In RDFa these values are defined as follows:

- the set of mappings from prefixes to URIs is provided by the current 
in-scope prefix declarations of the current element during parsing;
the mapping to use with the default prefix is the current default prefix 
mapping;

- the mapping to use with the '_' prefix, is not explicitly stated, but 
since it is used to generate bnodes, its implementation needs to be 
compatible with the RDF definition and rules in Referencing Blank Nodes. 
A document should not define a mapping for the '_' prefix. A Conforming 
RDFa Processor must ignore any definition of a mapping for the '_' prefix.

If there is no in-scope mapping for a prefix, then the value is not a CURIE.

Note that the resulting URI must be a syntactically valid IRI [RFC3987]. 
For a more detailed explanation see CURIE and URI Processing. Also note 
that while the lexical space of a CURIE is as defined in curie above, 
the value space is the set of IRIs.

]]

This ensures all prefixes include the ':', removes the "no prefix" 
mapping (which @vocab set), ensures that prefixes are defined in the 
same way as the other specs, and also means that CURIEs and Terms are 
now unambiguous, such that:

   ':' valid CURIE
   ':me' valid CURIE
   'foaf:me' valid CURIE
   'name' valid Term.

Note that some other minor text changes may need to be made to the draft 
if this were accepted, and that the definition of @prefix would need to 
change to:

  prefix
   a white space separated list of prefix-name URI pairs of the form
   prefix ' '+ xs:anyURI

Which would also allow people to then do:

   prefix=": http://example.org/foo#"

(which they can't currently)

Best,

Nathan
Received on Sunday, 6 February 2011 00:04:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:08 GMT