W3C home > Mailing lists > Public > www-archive@w3.org > June 2001

Re: relativeURI Patch

From: Dan Connolly <connolly@w3.org>
Date: Mon, 25 Jun 2001 01:37:43 -0500
Message-ID: <3B36DC37.C5C99488@w3.org>
To: Aaron Swartz <me@aaronsw.com>
CC: Tim Berners-Lee <timbl@w3.org>, www-archive+n3bugs@w3.org
Aaron Swartz wrote:
> 
> Please apply this patch to fix problems with the relativeURI
> function in notation3.py (thanks to Dan Connolly for the fix):

fixed in
 $Id: notation3.py,v 1.83 2001/06/25 06:35:50 connolly Exp $

see also test case

| cwm_test reluri-1.rdf "test generation of relative URIs" reluri-1.n3
--rdf

The patch below only fixed part of the problem, btw...

> diff -u -r1.82 notation3.py
> --- notation3.py        2001/06/01 07:52:40     1.82
> +++ notation3.py        2001/06/22 03:49:49
> @@ -1025,8 +1025,8 @@
>       if uri[i:i+1] =="#": return uri[i:]  # fragment of base
>       while i>0 and uri[i-1] != '/' : i=i-1  # scan for slash
> 
> -    if i == 0: return uri  # No way.
> -    if string.find(base, "//", i)>0: return uri # An unshared "//"
> +    if i < 3: return uri  # No way.
> +    if string.find(base, "//", i-2)>0: return uri # An unshared "//"
>       if string.find(base, ":", i)>0: return uri  # An unshared ":"
>       n = string.count(base, "/", i)
>       return ("../" * n) + uri[i:]
> 
> --
> [ "Aaron Swartz" ; <mailto:me@aaronsw.com> ; <http://www.aaronsw.com/> ]

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Monday, 25 June 2001 02:37:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:13 GMT