[topicmapmail] xml:base and #foo URIs

Murray Altheim m.altheim@open.ac.uk
Thu, 24 Apr 2003 00:44:26 +0100


Thomas B. Passin wrote:
[...]
> and I thought that a bare frag ID would be covered by this too, but
> apparently not, if we put more credance in RFC Section 4.2.  Personally, I
> would be happy to get rid of the possibility of using xml:base to affect
> bare frag IDs. Is anyone actually using xml:base in an xtm file to modify
> the URI of a bare frag ID?  If not, what other uses in xtm have people found
> for xml:base?  Just to shorten URIs in resourceRefs and
> subjectIndicatorRefs?

Well, XTM 1.0 (in both the topicmaps.org and ISO versions) only
declares xml:base on the <topicMap> element, so it's only at a
document level that it even *can* be declared.

It occurs to me that we (or at least I) have been talking about
two different things here, or at very least *I* may have been
confused about two different things. So, to clarify...

   1. First, there's IDs within XTM documents:

       <topicMap xmlns="http://www.topicmaps.org/xtm/1.0/"
                 xmlns:xlink="http://www.w3.org/1999/xlink"
                 xml:base="http://www.altheim.com/psi/fruit.xtm">
*        <topic id="fruit">
             ...
          </topic>
*        <topic id="orange">
             ...
          </topic>
*        <topic id="apple">
             ...
          </topic>
       </topicMap>

   2. Secondly, there's fragment IDs (IDREFs in a sense) within
      XTM documents:

       <topicMap xmlns="http://www.topicmaps.org/xtm/1.0/"
                 xmlns:xlink="http://www.w3.org/1999/xlink"
                 xml:base="http://www.altheim.com/psi/fruit.xtm">
          <topic id="fruit">
             ...
          </topic>
          <topic id="orange">
             <instanceOf>
*             <topicRef xlink:href="#fruit"/>
             </instanceOf>
          </topic>
          <topic id="apple">

          </topic>
       </topicMap>

Now, there's hopefully little or no confusion about the former, and
we're only talking about the latter, right?

As regards xml:base being used in PSI sets (as in the above example),
the resolution of "#fruit" in the <topicRef> would resolve to an
absolute URI of

     http://www.altheim.com/psi/fruit.xtm#fruit

given the presence of the xml:base URI. This to me makes sense,
as (let's say) I put the document at a local directory on my
laptop

     file:/home/altheim/work/psi/fruit/fruit.xtm

I certainly don't want my apples' and oranges' types to be

     file:/home/altheim/work/psi/fruit/fruit.xtm#fruit

The xml:base is IMO doing its job.

Murray

......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

                                                Moonlight slanting
                                                  through all the
                                                  bamboo forest...
                                                and nightingale song
                                                          -- Basho