W3C home > Mailing lists > Public > semantic-web@w3.org > July 2010

Re: RDF 2.0 Wishlist - Legal RDF which I can't SPARQL

From: Damian Steer <pldms@mac.com>
Date: Thu, 29 Jul 2010 13:51:07 +0100
Cc: Semantic Web <semantic-web@w3.org>
Message-id: <AF4C2711-FC29-4872-A22E-AD0FD1E6EEC8@mac.com>
To: Mischa Tuffield <mischa.tuffield@garlik.com>

On 29 Jul 2010, at 12:20, Mischa Tuffield wrote:

> Hi All, 
> 
> I know this is a known problem, but I have been bitten by the fact that there are legal RDF documents which I can't query using the SPARQL query language. And perhaps this should be looked at any future revision of RDF or SPARQL. 
> 
> The issue arises because turtle doesn't forbid the use of certain characters, for example the backtick " ` " (%60), where as SPARQL does forbid it. Which means that I can write legal turtle, import it into my triplestore, but I wont be able to ever query that data via SPARQL.
> 
> For example, the following turtle is legal : 
> 
> <http://example.com/mylamefoafdocument`uri> a foaf:Document . 
> <http://example.com/mylamefoafdocument`uri> foaf:primaryTopic  <http://example.com/mylamefoafdocument`uri#me> .
> 
> But I cant write the following SPARQL query: 
> 
> SELECT * WHERE { <http://example.com/mylamefoafdocument`uri> ?p ?o}
> 
> I thought this was due to the fact that the RDF spec [1] was written before the RFC which defined URIs [2], but I can't find a link to an RDF spec which pre dates 1998.

RDF core was working in parallel with the IRI [1] work. URIRef [2] (as I understand it) was trying to anticipate what IRIs would be. URIRef and IRI are pretty close (but see below), and I think the general recommendation is that you should read 'URIRef' as 'IRI'.

SPARQL syntax is defined in terms of IRIs, although I'm not sure syntax is identical (it uses ([^<>"{}|^`\]-[#x00-#x20])*), but it seems close enough.

Looking at the IRI spec ` is not permitted, however URIRef does allow it. 'Pretty close', but not close enough. Turtle, it seems, is in the URIRef camp.

It also doesn't seem to be permitted in URIs, [3] which makes URIRef feel like it's outside the mainstream.

Personally I would follow IRI and fix turtle. Why should RDF have its own URL/URI/IRI-ish syntax?

As for "http://washington-press-release.com/41/Study%20Addresses%20`Cross-Selling`%20Within%20the%20Dating,%20Adult%20Dating%20Arena.php'", that does work when encoded.

Disclaimer: I may have got some or all of this wrong. Do not trust my assertions regarding the RFCs.

Damian

[1] <http://www.ietf.org/rfc/rfc3987.txt>
[2] <http://www.w3.org/TR/rdf-concepts/#dfn-URI-reference>
[3] <http://www.ietf.org/rfc/rfc2396.txt>
Received on Thursday, 29 July 2010 12:52:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 07:42:21 UTC