[sc34wg3] Problem with wildcards

Lars Heuer heuer at semagia.com
Tue Mar 3 11:21:29 EST 2009


Hi Robert,

>> This makes sense to me from the point of view that if the author hasn't
>> created an item identifier explicitly through assigning an ID, it seems
>> wrong to imply one.

> That all seems strange to me.

> I had - up to now - assumed:

[...]
>   - import map

You mean import by your favorite Topic Maps engine? That works as
usual.

> And that does not work?

If you use the include-directive, each topic get two item identifiers:
One is resolved against the master's file document IRI, the other is
resolved against the included file's IRI.

Example:

a.ctm:

    %include <b.ctm>
    topic-a.

b.ctm:

    topic-b.

The result is (IRIs abbreviated):

   ^<b.ctm#topic-b>   # From the included file
   ^<a.ctm#topic-b>.  # From the included file, but "topic-b" is
                      # resolved againt "a.ctm"

   ^<a.ctm#topic-a>.  # From the master file (a.ctm)


You get two topics. The "topic-b" has two item identifiers, one from
the a.ctm, and one from the b.ctm.

Everything works well so far. But if we use templates and
automatically generated item identifiers, we run into problems (taking
Lars Marius' example (abbreviated)):

geo.ctm:

    def capital($country, $name)
       ?capital isa city; - $name .
    end

norway.ctm:
   %include <geo.ctm>
   norway capital("Oslo").

sweden.ctm:
   %include <geo.ctm>
   sweden capital("Stockholm").


?captial generates always the item identifier: <geo.ctm#$__1.capital>
So, if you merge "norway.ctm" and "sweden.ctm", the topic "Oslo" and
the topic "Stockholm" will merge since they have the same item
identifier.

To avoid the problem, we could
a) Drop predictable item identifiers, which causes problems if we want
   to test CTM deserializers (CXTM tests) since we don't know how they
   generate the item identifiers (UUIDs, GUUIDs, ....)
b) Remove the automatically generated item identifier (here
   "geo.ctm#$__1.capital") from the topic and assign only an item
   identifier from the master's document IRI.
   Result:
   In "sweden.ctm" we get "sweden.ctm#$__1.capital" and in "norway" we
   get "norway.ctm#$__1.capital" as item identifier for ?capital. If
   we merge "norway.ctm" and "sweden.ctm", Stockholm and Oslo would
   not merge since they have no item identifier in common.


Best regards,
Lars
-- 
Semagia 
<http://www.semagia.com>



More information about the sc34wg3 mailing list