Re: definition problem?: appending "#foo" without removing "#" from base URI

On Mon, 12 Jan 2004 13:59:46 -0500
Daniel Barclay <daniel@fgm.com> wrote:

> 
> 
> The RDF/XML Syntax Specification (Revised), in section 5.3, Resolving
> URIs, says:
> 
>     ...XML Base...and RFC 2396...do not specify an algorithm for
>     resolving a fragment identifier alone, such as #foo, ...into
>     an RDF URI reference. In RDF/XML, a fragment identifier is
>     transformed into a RDF URI reference by appending the fragment
>     identifier to the in-scope base URI.
> 
> Does any fragment component in the base URI need to be removed before
> appending the fragment identifier being resolved?

Yes, because ...

> I can't quite tell if the base URI is already restricted to being a
> "pure" URI (as opposed to a URI reference) or not.  (RFC 2396 mostly
> implies that there is no fragment identifier, but also says "the...
> fragment component[] [is]...not inherited from the base URI," which
> implies that the base URI might have had a fragment component.))
> 
> If the base URI cannot contain any fragment identifier, then there is
> no problem with the RDF/XML spec.

The base URI from xml:base as used here, cannot contain a fragment
identifier.  We used the phrase "in scope base URI" deliberately - it
cannot be a URI reference with a fragment and applications must
use it without such a fragment.

We confirm this in the RDF test cases for parsing RDF/XML and any
conformant RDF/XML parser must remove any fragment it finds from the
xml:base in order to pass.

The test in question is:
http://www.w3.org/2000/10/rdf-tests/rdfcore/xmlbase/Manifest.rdf#test013

input:
  Description: With an xml:base with fragment the fragment is ignored. 
  http://www.w3.org/2000/10/rdf-tests/rdfcore/xmlbase/test013.rdf
output:
  http://www.w3.org/2000/10/rdf-tests/rdfcore/xmlbase/test013.nt

This is passed by at least 4 parsers as recorded at
  http://www.w3.org/2003/11/results/rdf-core-tests
(search for xmlbase-test013)

> However, if the base URI can be a URI reference, then it might already
> contain a fragment identifier.  Appending another fragment identifier
> would yield an invalid URI reference (e.g., taking "http://h/path#"
> and appending "#foo" would yield "http://h/path##foo").
> 
> If that second case is possible, then RDF/XML should specify that any
> fragment component in the base URI be removed before appending the
> given fragment identifier.

As described above, this is not the case and we specify and test for
this.

Thanks for your feedback

Dave

Received on Monday, 12 January 2004 14:50:15 UTC