RE: note: base problem in inline-rdf in XHTML

> -----Original Message-----
> From: public-grddl-wg-request@w3.org 
> [mailto:public-grddl-wg-request@w3.org] On Behalf Of Jeremy Carroll
> Sent: Wednesday, June 13, 2007 9:50 AM
> To: GRDDL Working Group
> Subject: note: base problem in inline-rdf in XHTML
> 
> 
> 
> (while working on the generic XSLT module ...)
> 
> consider
> 
> GET from
> http://example.org/a/b/c/d/e/f.html
> 
> giving
> 
> <html>
>    <head xml:base="../../foo">
>      <base href="../../foo"/>
>      <rdf:RDF>
>         <rdf:Description rdf:about="">
>            <rdfs:comment>Bar</rdfs:comment>
>         </rdf:Description>
>       </rdf:RDF>
> 
> ....
> 
> annotated correctly to apply inline-rdf transform.
> 
> Currently this does not work correctly (whatever correctly 
> might be), and I cannot see any changes that will make it 
> work correctly.
> 
> I assume the intended triple might be:
> 
> <http://example.org/a/b/c/foo> rdfs:comment "Bar".
> 
> I think a GRDDL aware agent, will currently get
> 
> <http://example.org/a/foo> rdfs:comment "Bar".
> 
> I am minded to simply document the problem.
> 
> I am wondering whether I should make any changes.
> 
> ====
> 
> Part of the underlying problem is that (X)HTML is designed to 
> use the base element, not xml:base, whereas RDF/XML is 
> designed to use xml:base and not html:base element.
> 
> Thus it is unclear how the mechanisms should interact ... (It 
> is unspecified).
> 
> The current behaviour is that:
>   - a top-level xml:base is ignored, i.e. on the html element
>   - an html base is respected by the GRDDL aware agent
>   - lower-level xml:base is copied across to the inline RDF content.
> 
> It may be cleaner to explicitly ignore any xml:base except 
> those inside the rdf:RDF - xml:base is not supported in (X)HTML.
> 
> Alternatively, one could, in the transform, respect all 
> xml:base declaration in the document, and flag an error if 
> the resulting xml:base and an HTML base are both present and 
> both relative. That's probably the best one can do ....
> 
> any thoughts?

Sure.  This is a nice example of the confluence of base URI issues in
XHTML.  I'm going to take a stab at my reading of the various specs on
this issue.  Note that I am assuming that in XHTML, xml:base *is*
supported, since XHTML is a proper XML dialect.  Here we go.

  1. We need to resolve the relative reference ""
     on the `rdf:Description` element.
  2. RFC 3986, section 5.1.1[0], indicates that we
     should first look for a base URI embedded in
     the content.
  3. The rules from xml:base, section 4.2[1]
     indicate that we can look for the base URI
     embedded in the content by looking at the
     xml:base attribute of the parent element
     (recursively), which leads us to the relative
     reference "../../foo" on the `head` element.
  4. In order for this relative reference to serve
     as a base URI, it must be resolved.
  5. There are no more xml:base attributes, so we
     turn to rule 3 from section 4.2 of xml:base,
     which indicates that the base URI should be
     taken from the base URI of the document.
  6. According to section 12.4 of the HTML 4.01
     Recommendation[2], "[t]he BASE element allows
     authors to specify a document's base URI
     explicitly."  The base URI for the document,
     then, is "../../foo".
  7. In order for this relative reference to serve
     as a base URI, it must be resolved.
  8. Now we move up the RFC 3986 relative reference
     resolution stack to section 5.1.3[3], which
     gives us a base URI of
     "http://example.org/a/b/c/d/e/f.html".
  9. We resolve "../../foo" against 
     "http://example.org/a/b/c/d/e/f.html", obtaining
     "http://example.org/a/b/c/foo" as the base
     URI for the document.
 10. We resolve "../../foo" against
     "http://example.org/a/b/c/foo", obtaining
     "http://example.org/a/foo" as the base
     URI for the `head` element.
 11. We resolve "" against
     "http://example.org/a/foo", obtaining
     "http://example.org/a/foo" as the target
     of the URI reference.

[0] http://gbiv.com/protocols/uri/rfc/rfc3986.html#base-content

[1] http://www.w3.org/TR/xmlbase/#granularity

[2] http://www.w3.org/TR/html401/struct/links.html#edef-BASE

[3] http://gbiv.com/protocols/uri/rfc/rfc3986.html#base-retrieval

Take care,

    John L. Clark

===================================




Cleveland Clinic is ranked one of the top 3 hospitals in
America by U.S.News & World Report. Visit us online at
http://www.clevelandclinic.org for a complete listing of
our services, staff and locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.

Received on Wednesday, 13 June 2007 14:23:29 UTC