W3C home > Mailing lists > Public > www-rdf-interest@w3.org > May 2001

RE: RDF and xml:base

From: Graham Klyne <GK@ninebynine.org>
Date: Wed, 23 May 2001 11:17:08 +0100
Message-Id: <5.0.2.1.2.20010523105939.0386b6b0@joy.songbird.com>
To: "Ron Daniel" <rdaniel@interwoven.com>
Cc: "Aaron Swartz" <aswartz@swartzfam.com>, "RDF Interest" <www-rdf-interest@w3.org>
FWIW, I think xml:base helps RDF out in what is otherwise a problem area.

Background:
- This is based on my work with CC/PP.
- I haven't studied xml:base in great detail, so I might have overlooked 
something.

Not every RDF statement is necessarily contained in a Web resource;  i.e. 
may be not contained in a URI-addressable document.  Specifically, RDF 
statements may be contained in a transient protocol element.  (Similar 
considerations may apply if RDF is read from a pipe or TCP connection.)

Under these circumstances, there is some confusion about the meaning and 
usability of rdf:ID= to identify an RDF resource.  I think the confusion 
can be resolved if an xml:base attribute is used to create a base URI for 
such cases.  It may be necessary to check the definition of rdf:ID to be 
sure that xml:base applies.

I think it works OK.  http://www.w3.org/TR/REC-rdf-syntax/ says, in section 6:

[[[
When about is specified with Description, the statements in the Description 
refer to the resource named in the about. A Description element without an 
about attribute represents an in-line resource.
 >>>
This in-line resource has a resource identifier formed using the value of 
the base URI of the document containing the RDF statements plus an anchor 
id equal to the value of the ID attribute of the Description element, if 
present.
<<<
When another Description or property value refers to the in-line resource 
it will use the value of the ID in an about attribute. When the other 
Description refers to the Bag of resources corresponding to the reified 
statements it will use the value of bagID in an about attribute. Either ID 
or about may be specified on Description but not both together in the same 
element. The values for each ID and bagID attribute must not appear in more 
than one such attribute within a document nor may the same value be used in 
an ID and a bagID within a single document.
]]]

There is a certain messiness around schema definitions because the document 
base URI must not include the fragment '#', but a namespace used to access 
the value via Qname syntax must; e.g.

   <rdf:RDF xml:base="http://example.com/foo" ...>
     <rdf:Property ID="bar">
       ...
     </rdf:Property>
   </rdf:RDF>

and in another document:

   <rdf:RDF xmlns:foo="http://example.com/foo#" ...>
     <rdf:Description about="http://example.com/someresource">
       <foo:bar>value of 'bar' property</foo:bar>
     </rdf:Description>
   </rdf:RDF>

This messiness isn't specific to xml:base, but it becomes more visible.  I 
suspect it's beyond repair at this time.

...

In a revision of the RDF specification, should we *require* rdf parsers to 
support xml:base?

#g
--

At 12:59 PM 5/9/01 -0700, Ron Daniel wrote:
>Aaron asks:
>
> > I'm unaware of how xml:base should be used in RDF. Are their any
> > thoughts on
> > this as an interoperability consideration, etc.?
>
>Sure. First, the RDF community needs to see if XML Base has any
>special impact on us. If it has a special impact on us, then we
>need to start yelling. If it does not, then it is really an XML
>feature that is almost orthogonal to our concerns. In that case,
>I don't think we need to put special provision for it into any
>revision of the model, unlike xml:lang, which may have
>a need for being reflected in the model.
>
>If we find that xml:base has no SPECIAL impact on us, we should
>just do the typical steps of:
>1) putting examples of its use into a future revision of the
>    Syntax spec.
>2) encouraging parser writers to add support for it to their
>    software.
>3) cautioning creators of descriptions that use of the xml:base
>    attribute may harm interoperability for the next year or so until
>    parsers that deal with it are more widespread. However, they are
>    free to use it if they want.
>
> > What parsers implement this?
>
>Right now? None that I know of, although adding it to RDFFilter
>looks fairly straightforward.
>
>
>
>All of this is contingent on the question of whether the XML Base
>proposal has any special impact on RDF. So let's talk about that.
>
>I currently believe that xml:base does not have any special impact
>on RDF, although it may be of limited utility.
>
>All that the XML Base proposal does is
>give a way of setting a base URI to use when absolutizing relative
>URI references in XML documents. While RDF documents are rife with
>URI references, few of them are relative. For example, the description
>
>   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>            xmlns:dc="http://purl.org/dc/elements/1.1/">
>     <rdf:Description rdf:about="huh.txt">
>       <dc:creator>J. Smith</dc:creator>
>       <dc:subject rdf:resource="http://example.com/codes#foo"/>
>       <dc:subject rdf:resource="http://example.com/codes#bar"/>
>     </rdf:Description>
>   </rdf:RDF>
>
>contains 1 relative reference ("huh.txt"), 6 QNames which are
>URI references according to the RDF concat rule (rdf:RDF,
>rdf:Description, rdf:about, dc:creator, dc:subject, rdf:resource),
>and four absolute URI references (the two namespace URIs, plus
>"http://example.com/codes#foo/" and "http://example.com/codes#bar/").
>
>The one relative reference requires a base be established. Typically
>the base is the current document, see RFC 2396 for the 4 rules on
>how to come up with a base URI. So this description assumes it is in
>a file in the same directory as huh.txt.
>
>We could use xml:base to eliminate the duplicate URI in the /foo
>and /bar subject codes - ala
>
>   <rdf:Description xml:base="http://example.com/codes" ...
>      ...
>      <dc:subject rdf:resource="foo"/>
>      <dc:subject rdf:resource="bar"/>
>      ...
>
>The problem here is that the only places to hang a single xml:base
>attribute so we can eliminate the duplication will also make it apply
>to the value of the rdf:about attribute - which makes life hard when
>trying to say what file something applies to.
>
>On the other hand, if someone wanted to model their problem as
>having one subject arc with a Bag of values, then xml:base is
>more useful:
>
>   <rdf:Description rdf:about="huh.txt">
>     ...
>     <dc:subject xml:base="http://example.com/codes">
>       <rdf:Bag>
>         <li  rdf:resource="foo"/>
>         <li rdf:resoruce="bar"/>
>       </rdf:Bag>
>       ...
>
>So - I think xml:base is not harmful but will have limited value in
>many RDF descriptions. No need to preclude, but no need to accelerate.
>
>Regards,
>
>Ron Daniel Jr.
>Standards Architect
>Tel: +1 415 778 3113
>Fax: +1 415 778 3131
>Email: rdaniel@interwoven.com
>
>Visit www.interwoven.com
>Moving Business to the Web

------------
Graham Klyne
GK@NineByNine.org
Received on Wednesday, 23 May 2001 09:57:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:49 GMT