[topicmapmail] TMDM serialization
Borislav Iordanov
borislav at kobrix.com
Thu Sep 27 20:54:26 EDT 2007
Hi Lars,
Thanks for the response! This sort of confirms my understanding and it's all
reasonable. By "same" XML, I mean something that would create a comparable
DOM model (modulo element ordering, comments and the like). Part of the
usefulness of XML stems from its readability by humans and I thought the ID
attribute of topics serves mainly that purpose (otherwise, what else?). So
the lack of unambiguous means to retrieve it from the TMDM seemed like a
shortcoming. But a shortcoming I can live with ;)
Regards,
Boris
> -----Original Message-----
> From: topicmapmail-bounces at infoloom.com [mailto:topicmapmail-
> bounces at infoloom.com] On Behalf Of Lars Marius Garshol
> Sent: Thursday, September 27, 2007 11:01 AM
> To: TopicMapMail
> Subject: Re: [topicmapmail] TMDM serialization
>
>
> * Borislav Iordanov
> >
> > I have a couple of question regarding XML serialization of topics
> maps
> > represented in TMDM 2.0. I'm working on a topic maps implementation
> > and I'd like the implementation to be able to read an XMT 2.0 file,
> > store it and then export the exact same file.
>
> I should emphasize here that this is very much *not* a goal of TMDM.
> If we were to support this we'd have to basically preserve the entire
> XTM file byte-by-byte, and we would have no model.
>
> Consider things like:
>
> - number of <topic> elements and what was inside each,
> - comments,
> - character encoding,
> - upper vs lower case in character references (¯ vs ¯),
> - ...
>
> and you quickly realize that, well, this is not a reasonable
> requirement. At least not the way you stated it. You may of course
> have meant something slightly different.
>
> The requirement that the specifications *do* support is that if you
> import an XTM 2.0 file, then export and reimport, you can be sure
> that the two imports will give equal TMDM instances. In other words:
> TMDM implicitly defines what information in an XTM 2.0 file is
> relevant, and which information is not relevant.
>
> So:
>
> > 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?
>
> According to the TMDM there is no concept of an "original id". In
> other words: you don't need to do this, because it has no consequence
> which ID you choose.
>
> > 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?
>
> Same thing here.
>
> > I guess XML serialization is considered implementation dependent so
> > I'm free to do whatever seems best, right?
>
> Yes, so long as a reimport will give the same TMDM instance you
> started with.
>
> > 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!
>
> It's there. It's just one of the item identifiers.
>
> --Lars M.
> _______________________________________________
> topicmapmail mailing list
> topicmapmail at infoloom.com
> http://www.infoloom.com/mailman/listinfo/topicmapmail
More information about the topicmapmail
mailing list