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

Re: default prefix without using base/BASE in turtle document

From: Andy Seaborne <andy@seaborne.org>
Date: Mon, 20 Jul 2015 18:22:43 +0100
Message-ID: <55AD2E63.7060707@seaborne.org>
To: semantic-web@w3.org


On 20/07/15 17:57, Satrajit Ghosh wrote:
> hi,
>
> is there a way to write a turtle document that uses its own location as
> the base prefix?
>
> say on the server i have:
>
> <base_url>/doc.ttl
> <base_url>/some_file
>
> is there a specification in the language that allows the following
> statement in the doc.ttl file

RFC 3986 (section 5.1) - it covers establishing the base.

>
> :id :location <some_file>
>
> to expand to:
>
> :id :location <base_url>/some_file

It should do that.

>
> without having the *base* keyword in the document.
>
> basically i'm looking for a way to use relative IRIs such that doc.ttl
> and some_file can be moved to any server and still be linked to each
> other through the graph.
>
> according to this:
>
> http://www.w3.org/TR/turtle/#relative-iri
>
> it looks like the specification of base is mandatory.

There is always a base URI - it may come from BASE but that is only one 
way to set the base URI.

It comes from the location (HTTP address) the file is read from (RFC 
3986) up until the point BASE occurs (it need not be at the start of the 
file nor be only used once).

	Andy

>
> cheers,
>
> satra
Received on Monday, 20 July 2015 17:23:13 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:41:48 UTC