W3C home > Mailing lists > Public > public-rdf-comments@w3.org > February 2012

Re: Turtle Test Suite document issues

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Mon, 27 Feb 2012 20:24:08 -0500
To: Henry Story <henry.story@bblfish.net>
CC: "public-rdf-comments@w3.org" <public-rdf-comments@w3.org>
Message-ID: <B344B5EF-1902-49DE-BC1F-87B311289E5A@greggkellogg.net>
On Feb 27, 2012, at 2:49 PM, Henry Story wrote:

> I am now implementing a test suite using the document linked from the spec
> 
>   http://www.w3.org/TR/turtle/tests/
> 
> So first it says 
> 
> [[
> The tests should be performed with an assumed base URI of http://www.w3.org/2001/sw/DataAccess/df1/tests/.
> ]]
> 
> but 
> 
> http://www.w3.org/TR/turtle/tests/base1.ttl
> 
> does not have that base and neither does 
> 
>  http://www.w3.org/TR/turtle/tests/base1.out
> 
> which is the answer to it. Now base is defined with the rules
> 
> 
>   base	   ::=   	BASE IRI_REF
>   <BASE>	   ::=   	"@base"
> 
> but that is not what we find in that file

When I invoke these tests, I tell my processor that the document origin is relative to <http://www.w3.org/2001/sw/DataAccess/df1/tests/>. @base is a mechanism to override
the document source location, so in the absence of @base, <> should expand to the document
origin. In the case of the Ruby parser, it will either use the actual URL from which the document
is loaded as base, which can be overridden by passing a :base_uri option, which is what I
do when running these tests.

Gregg


> -------------8<----------------------
> $ curl -i http://www.w3.org/TR/turtle/tests/base1.ttl
> HTTP/1.1 200 OK
> Date: Mon, 27 Feb 2012 22:43:36 GMT
> Server: Apache/2
> Last-Modified: Mon, 08 Aug 2011 15:58:51 GMT
> ETag: "144-4aa0085f524c0"
> Accept-Ranges: bytes
> Content-Length: 324
> Cache-Control: max-age=21600
> Expires: Tue, 28 Feb 2012 04:43:36 GMT
> P3P: policyref="http://www.w3.org/2001/05/P3P/p3p.xml"
> Access-Control-Allow-Origin: *
> Connection: close
> Content-Type: text/n3; qs=0.89
> 
> # base1 - Resolution of a relative URI against an absolute base.
> # 
> # $Id: base1.ttl,v 1.1 2011/08/08 15:58:52 eric Exp $
> 
> @base foaf: <http://www.w3.org/2010/01/Turtle/tests/> .
> <prefix1.ttl> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#PositiveSyntaxTest> .
> -------------8<----------------------
> 
> 
> here @base foaf: is not parseable, and indeed neither Jena, nor Sesame 
> parse it.
> 
> 
> 	Henry
> 
> Social Web Architect
> http://bblfish.net/
> 
> 
Received on Tuesday, 28 February 2012 01:25:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:59:30 UTC