W3C home > Mailing lists > Public > uri@w3.org > February 2004

Calculating relative URIs

From: Graham Klyne <gk@ninebynine.org>
Date: Fri, 20 Feb 2004 00:03:03 +0000
Message-Id: <>
To: Dan Connolly <connolly@w3.org>
Cc: <uri@w3.org>


In an message about a year ago [1], you said:

TimBL prefers root-relative paths, i.e. "/x%2Fabc"
to "../../x%2Fabc"
Both are correct relative paths from here to there,
but our code currently does "/x%2Fabc".

I don't really like it; it doesn't support moving
filesets around as well as it could. But I haven't
convinced timbl, nor have I completely debugged
an algorithm for returning "../../x%2Fabc".

The approach I've taken is to calculate leaf-relative form is the two URIs 
have at least one leading path segment in common, and I think I have an 
algorithm that does this fairly reliably (i.e. passes lots of test cases).

When I get time, my revised code will be on the web.


[1] http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html

Graham Klyne
For email:
Received on Thursday, 19 February 2004 19:04:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:07 UTC