Re: [TF-LIB] Encoding for IRIs


On 29 Jul 2010, at 20:22, Andy Seaborne wrote:

> fn:encode-for-uri encodes a string for use as a path segment in
> "http://example/00/Weather/CA/Los%20Angeles#ocean"
> ==>
> "http%3A%2F%2Fexample%2F00%2FWeather%2FCA%2FLos%2520Angeles%23ocean"
> which as F&O puts it: "This is probably not what the user intended because all of the delimiters have been encoded."
> Do we want to have a similar function that encodes for an IRI?
> If so, we have introduced a new function - to date, the TF-LIB list is the functions from F&O that make sense.  We have no new functions except the term constructors IRI, BNODE, STRDT, STRLANG, which are fundamental.  Adding new functions that are practically motivated gets slightly tricky as to where to stop.
> We could make IRI() do that but I don't think that is a good idea. Currently, it captures the concept of turning strings into IRIs. Mangling the characters may be incorrect as the app might expect to use the IRI it gets back in a later query to get a match, and it won't.
> 	Andy
> This was triggered by the thread from
> discussing practicalities of working with some bad-IRI data.
> The original question was how to ask a SPARQL query when the data contains:
> <`uri> a foaf:Document .
> > <`uri> foaf:primaryTopic <`uri#me> .
> which is legal Turtle in the sense it bases the basic syntax grammar rules.  The Turtle grammar allows anything in <> except '>' and #x3E which is '>' encoded. The Turtle test suite has positive tests for Turtle documents having bad IRIs e.g. \n.

Given that Turtle is not a Rec, it should be noted that my reading of the RDF/XML Rec is that it too also allows for the following bad-IRI to be used as a URI :`uri

My reading (excuse me if I am wrong here), is that RDF/XML talks about the use of 'RDF URI references' in "Section 5.2 Identifiers" of the rec [1] which in turn points to section 6.4 of the RDF Abstract Syntax [2] which seems to allow for the backticks to be used in URIs in RDF/XML. 




> The issue for TF_LIB does not address the original question from Mischa but it does bring up this nearby issue.

Mischa Tuffield PhD
Homepage -
Garlik Limited, 1-3 Halford Road, Richmond, TW10 6AW
+44(0)845 645 2824
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD

Received on Thursday, 29 July 2010 19:32:32 UTC