W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > January 2009

full URIs where a CURIE expected?

From: Dan Brickley <danbri@danbri.org>
Date: Mon, 19 Jan 2009 00:11:41 +0100
Message-ID: <4973B72D.7040206@danbri.org>
To: RDFa <public-rdf-in-xhtml-tf@w3.org>


I'm trying to understand whether there is a subset of legal RDFa where 
namespaces and curie shortcuts aren't used, in other words, where full 
length URIs are used without abbrevation.

http://validator.w3.org seems to think 
http://svn.foaf-project.org/foaftown/2009/rdfa/tests/t4.html is 
reasonable RDFa.

But librdfa/raptor seems to think not.

Here's the commandline check:

Airbag:tests danbri$ rapper -i rdfa t4.html
rapper: Parsing URI 
file:///Users/danbri/working/foaftown/2009/rdfa/tests/t4.html with 
parser rdfa
rapper: Serializing with serializer ntriples
_:bnode0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://xmlns.com/foaf/0.1/Person> .
_:bnode0 <http://xmlns.com/foaf/0.1/homepage> <http://example.com/eve/> .
_:bnode0 <http://xmlns.com/foaf/0.1/name> "Eve"@en .
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://xmlns.com/foaf/0.1/Person> .
_:bnode1 <http://xmlns.com/foaf/0.1/homepage> <http://example.com/manu/> .
_:bnode1 <http://xmlns.com/foaf/0.1/name> "Manu"@en .
rapper: Parsing returned 6 triples
Airbag:tests danbri$ rapper -i rdfa t1.html
rapper: Parsing URI 
file:///Users/danbri/working/foaftown/2009/rdfa/tests/t1.html with 
parser rdfa
rapper: Serializing with serializer ntriples
_:bnode0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://xmlns.com/foaf/0.1/Person> .
_:bnode0 <http://xmlns.com/foaf/0.1/homepage> <http://example.com/bob/> .
_:bnode0 <http://xmlns.com/foaf/0.1/name> "Bob"@en .
_:bnode1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://xmlns.com/foaf/0.1/Person> .
_:bnode1 <http://xmlns.com/foaf/0.1/homepage> <http://example.com/eve/> .
_:bnode1 <http://xmlns.com/foaf/0.1/name> "Eve"@en .
_:bnode2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://xmlns.com/foaf/0.1/Person> .
_:bnode2 <http://xmlns.com/foaf/0.1/homepage> <http://example.com/manu/> .
_:bnode2 <http://xmlns.com/foaf/0.1/name> "Manu"@en .
rapper: Parsing returned 9 triples
Airbag:tests danbri$


Here's the main markup. The question is whether the 'Bob' section is wrong.

<div xmlns:foaf="http://xmlns.com/foaf/0.1/">
    <ul>
       <li typeof="http://xmlns.com/foaf/0.1/Person">
         <a property="http://xmlns.com/foaf/0.1/name" 
rel="http://xmlns.com/foaf/0.1/homepage" 
href="http://example.com/bob/">Bob</a>
       </li>

       <li typeof="foaf:Person">
         <a property="foaf:name" rel="foaf:homepage" 
href="http://example.com/eve/">Eve</a>
       </li>
       <li typeof="foaf:Person">
         <a property="foaf:name" rel="foaf:homepage" 
href="http://example.com/manu/">Manu</a>
       </li>
    </ul>
</div>


I looked in the RDFa test cases and couldn't find one that checked this, 
though I may have missed something. Reading 
http://www.w3.org/TR/rdfa-syntax/#s_curieprocessing I have almost 
persuaded myself that the long form is acceptable:

[[
  Many of the attributes that hold URIs are also able to carry 'compact 
URIs' or CURIEs. A CURIE is a convenient way to represent a long URI, by 
replacing a leading section of the URI with a substitution token. It's 
possible for authors to define a number of substitution tokens as they 
see fit; the full URI is obtained by locating the mapping defined by a 
token from a list of in-scope tokens, and then simply concatenating the 
second part of the CURIE onto the mapped value.
]]

...on the reading that if we don't declare any namespaces/CURIE 
bindings, we can say the list of substitution tokens is empty, and just 
put the full thing in as the 'CURIE'.

http://www.w3.org/TR/rdfa-syntax/#s_curies seems to make this reading 
harder though.

curie       :=   [ [ prefix ] ':' ] reference

prefix      :=   NCName

reference   :=   irelative-ref (as defined in [IRI])



Nevertheless, I get 
http://validator.w3.org/check?uri=http%3A%2F%2Fsvn.foaf-project.org%2Ffoaftown%2F2009%2Frdfa%2Ftests%2Ft4.html&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.606 
from the validator.

What's up? If there's a way of squeezing thru the interpretation that 
full URIs are acceptable, this could help with identifying a subset that 
works easily in HTML5.

cheers,

Dan

--
http://danbri.org/
Received on Sunday, 18 January 2009 23:12:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 18 January 2009 23:12:24 GMT