- From: Dan Connolly <connolly@w3.org>
- Date: Mon, 25 Jun 2001 01:37:43 -0500
- 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 UTC