Re: [TTL] Standardizing N-Triples

> The headache (for me at least) isn't resolving the relative IRIs, it's
> picking a base IRI to resolve against when one isn't readily available.
>
> I remember being surprised when parsing some Turtle with Jena to find
> that it was emitting IRIs relative to the base directory from which I
> was running the program.  That isn't to pick on Jena

No problem - this is a bit messy as there isn't "right" answer that is 
also user expectation. "file:" URLs do not help.  If you think anything 
is wrong and needs fixing, then let us know.

> -- if you don't
> have a base IRI then the user home directory makes as much sense as any
> other IRI you could arbitrarily choose.  The point is that you have to
> make that choice, and not all systems do so consistently.

The base is (should be!) the file you are parsing, <file:///dir/file>. 
If you write <x> then you will get <file:///dir/x>.
If you write <#x> then you will get <file:///dir/file#x>.

/home/afs/tmp/X.ttl:
---------
<x> <#y> <../z> .
---------
==>

<file:///home/afs/tmp/x> <file:///home/afs/tmp/X.ttl#y> 
<file:///home/afs/z> .

The official rules are in RFC 3986:
http://www.apps.ietf.org/rfc/rfc3986.html#sec-5.1

and we're applying 5.1.3 "URI used to retrieve the entity"

5.1.1. is @base.

	Andy

Received on Saturday, 2 April 2011 18:55:38 UTC