[topicmapmail] TMDM serialization
Lars Heuer
heuer at semagia.com
Thu Sep 20 08:50:34 EDT 2007
Hi Borislav,
Please start another thread if you start another topic. Thanks. :)
> 1) The id attribute of the topic tag found in the original file gets bundled
> into an item identifier in the TMDM. Given that a topic may have multiple
> item identifiers, how to recover the original id during export?
As you said, the id attribute becomes an item identifier. The id is
resolved against the document IRI and you get back an absolute IRI
which is added to the [item identifiers] property of the topic.
If you export the file you can use the same id, iff you use the same
document IRI. You can cut off the document IRI and use the <id> part
of the fragment "#id" as topic id.
If you export the topic map to another document IRI, you may want to
use another identifier. If you read the topic map, you'll end up with
a topic which has one item identifier more than the original one,
true.
> 2) Similarly, when I have to include an href attribute in, say, a topicRef
> tag during export, which of the possible subject identifiers or item
> identifiers to output?
You shouldn't use a subject identifier in within the href, you must
use an item identifier. You can, for example, use the internal
identifier, you've used as value of the id attribute of the other
topic or you use one of the item identifiers of the topic (which one
is not important), which has a fragment identifier (i.e.
http://www.example.org/map.xtm#example).
> I guess that any one of them would be valid, but is
> there a preference (e.g. for an item identifier whose IRI has the topic
> map's base IRI as a prefix)?
I guess, the identifier, which is used within a topic element as id
attribute is preferred, but you won't make a mistake if you use an
absolute item identifier (which contains a fragment identifier).
> The only thing that bugs me a little bit is the fact the topic id attribute
> is mandatory in XMT 2.0, but then it's not even part of the data model!
Yes, the id attribute of the topic element sucks but it is part of the
data model, since it represents an item identifier.
Best regards,
Lars
--
http://www.semagia.com
http://www.topicmaps.de/mailinglist/ German Topic Maps mailinglist
More information about the topicmapmail
mailing list