Re: RDF's relative IRI resolution is ambiguous

Hi Richard,

> The Turtle spec says to use the algorithm in Section 5.2 of RFC 3986. In what way is that not conclusive?

Actually, the Turtle spec says:

   Relative IRIs are resolved with base IRIs as per RFC3986
   using only the basic algorithm in section 5.2 [3].

However, there is no such thing as "only the basic algorithm" in RFC3986.

> Why can’t you simply do what the Turtle spec says and apply the algorithm in RFC 3986?

Because it is ambiguous, which is why I started this thread.
If we interpret "only the basic algorithm" as "the entire algorithm in RFC3986 5.2", then
    @base <http://example.org/xxx/yyy/zzz/../../../>.
    <> <a> <../../../a>.
would result in
    <http://example.org/xxx/yyy/zzz/../../../> <http://example.org/a> <http://example.org/a>.
which is not what all existing parsers do.

For example, SERD and cwm parse the above as
    <http://example.org/xxx/yyy/zzz/../../../>     <http://example.org/xxx/yyy/zzz/../../../a> <http://example.org/xxx/yyy/zzz/a>.
EYE instead parses it as
    <http://example.org/xxx/yyy/zzz/../../../> <http://example.org/xxx/yyy/zzz/../../../a> <http://example.org/xxx/yyy/zzz/a>.
EasyRDF parses it as
   <http://example.org/> <http://example.org/a> <http://example.org/a> .
while Raptor produces the strict application of RFC3986.

Which one is right cannot be determined without an interpretation of "the basic algorithm".

>> because IRI normalization under the RDF model leads to a different graph.
> 
> Different from what?

Different from that graph without normalization.
In other words: the 4 different parsings above are 4 different graphs indeed.

> And why do you think that this difference prevents you from applying IRI normalisation as demanded by RFC 3986?

It does not prevent me; it's just not clear what the correct result of parsing the above Turtle should be.

> And what does “under the RDF model” mean?

I meant that, under the RDF model, these are all different graphs

GRAPH []  { <http://example.org/xxx/yyy/zzz/../../../> <http://example.org/a> <http://example.org/a>. }
GRAPH []  { <http://example.org/xxx/yyy/zzz/../../../>     <http://example.org/xxx/yyy/zzz/../../../a> <http://example.org/xxx/yyy/zzz/a>. }
GRAPH []  { <http://example.org/xxx/yyy/zzz/../../../> <http://example.org/xxx/yyy/zzz/../../../a> <http://example.org/xxx/yyy/zzz/a>. }
GRAPH []  { <http://example.org/> <http://example.org/a> <http://example.org/a>. }

Yet they all are the result of parsing the same Turtle file,
under different interpretations of what "the basic algorithm in RFC3986" means.

Best,

Ruben

Received on Thursday, 27 August 2015 14:58:10 UTC