Re: trying to enforce IRI syntax

On 18/05/12 17:26, Richard Cyganiak wrote:
> On 18 May 2012, at 16:40, Sandro Hawke wrote:
>> On Fri, 2012-05-18 at 14:03 +0100, Richard Cyganiak wrote:
>>> 1) I will formally object to any notion of fixing-up-data-by-trying-to-guess-their-intent that is applied only to a single RDF syntax.
>>> 2) A general fixing-up-data-by-trying-to-guess-their-intent framework for all of RDF is out of scope for this WG.
>>> 3) Turtle validator. Think about it.
>>
>> Hmmm.  What do other RDF syntaxes do with bad-syntax IRIs?
>>
>> Quick check of the W3C RDF/XML validator show it doesn't even warn about
>> an IRI with "|" in it.
>
> Because it checks for RDF/XML 2004 and this was valid in 2004.

RFC 2396:
  unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

Slightly more complicated: if the | is in a property, then the (XML) 
namespace end with a "|" which causes

WARN  {W124} Non-ascii characters in a namespace URI may not be 
completely portable: <http://example/a|>. Resulting RDF URI references 
are legal.

(OK - non-ascii is a bit wonky but it's 'unwise' and it's an XML matter).

<rdf:RDF
     xmlns:j.0="http://example/a|"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
   <rdf:Description rdf:about="http://example/s">
     <j.0:b rdf:resource="http://example/o"/>
   </rdf:Description>
</rdf:RDF>

(kudos to Jeremy)

	Andy

Received on Friday, 18 May 2012 16:52:34 UTC