[sc34wg3] xml:base in XTM

Kal Ahmed sc34wg3@isotopicmaps.org
Sat, 23 Oct 2004 18:45:28 +0100


On Sat, 2004-10-23 at 17:21, Lars Marius Garshol wrote:
> * Kal Ahmed
> | 
> | Up until now, TM4J has always resolved ID attribute values against
> | the URL which specifies the location from which the topic map was
> | read (ignoring any xml:base attributes), and resolves all
> | same-document references (of the form '#foo') the same way.
> | References to other documents that use relative URIs are resolved to
> | full URIs using the xml:base value currently in force at the point
> | where the reference is encountered.
> 
> This is what the XTM 1.1 specification says is correct.
>  
> | The RDF/XML spec [1] however says that an rdf:ID attribute of 'foo'
> | should be treated as equivalent to rdf:about="#foo" and that this
> | should then be resolved to a full URI using xml:base value currently
> | in force.  I find this more internally consistent and a lot easier
> | to understand.  The queries from my users indicate that this is the
> | behaviour they expect in XTM files as well.
> 
> We've discussed this a number of times in the committee, actually:
> <URL: http://www.ontopia.net/omnigator/models/topic_complete.jsp?tm=tm-standards.xtm&id=xtm-same-doc-refs >
>  
> The trouble with this is approach is if you have a document A.xtm,
> where A.xtm has an xml:base that does *not* refer to where A.xtm is
> actually located. In that case the <topicRef>s in A.xtm will point out
> of A.xtm to the base location, and you will either get a bad reference
> (if there's nothing there) or read (hopefully) the same document over
> again.
> 
Hmmm...surely not if you have already encountered the xml:base, so if
you have:
<topicMap ... xml:base="http://www.example.com/foo.xtm">
<topic id="a">
  <instanceOf><topicRef xlink:href="#b"/></instanceOf>
</topic>
<topic id="b">...</topic>
</topicMap>

Then surely XTM processing software will know that it is processing a
resource which is re-based to http://www.example.com/foo.xtm and when it
encounters a topicRef to http://www.example.com/foo.xtm#b in the type
list for topic "a", it would not attempt to resolve the reference.

> You also get difficulties if there is a B.xtm in the same directory as
> A.xtm, containing a <topicRef xlink:href="A.xtm#foo"/>, since although
> this correctly references the 'foo' topic in A.xtm the software won't
> actually recognize this ('foo' will have a different source locator),
> and you'll get a broken reference.
> 
That is true, but then I think this is an edge-case that is really a
user-error.

> So to me the current behaviour *seems* like the right one, but I
> wouldn't mind a better discussion of this issue than we've had before.
> 
> | Which is the correct way of resolving same-document references and
> | ID attributes in XTM ? And if its the former method, can we change
> | it to the latter in the next version of the standard ?
> 
> We can, if we want to. This has been discussed extensively, but I'm
> not necessarily against raising it again. We settled this before the
> W3C noticed this problem and cleaned up the base specs that RDF/XML is
> specified on top of. I should have participated in this discussion
> when it was going on, but didn't find the time. :-(

Well, I think we should look again at this in the light of the RDF/XML
specification and ideally make the change for XTM 1.1 if it is something
we can all agree on. IMHO there are tremendous advantages of simplicity
in the new RDF/XML approach.

Cheers,

Kal
-- 
Kal Ahmed, Techquila
Standards-based Information Management
e: kal@techquila.com
w: www.techquila.com
p: +44 7968 529531