[sc34wg3] Problem with wildcards

Robert Barta rho at devc.at
Tue Mar 3 12:46:31 EST 2009

On Tue, Mar 03, 2009 at 05:21:29PM +0100, Lars Heuer wrote:
> 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.

No, I meant "map A 'imports' map B".

> > 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.

Ok, that approach is simply asking for troubles.

My point here is that (a) there is a syntactic way to "merge in" TM
content (that I thought to be 'include') and a semantic way.

In the syntactic way there would be no resolving against a the
included file's IRI. The user has to decide what he/she wants.

> 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.

So far so clear.

> 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.

And I would say "that is exactly how it should be". So if I use
'include' I get the ?capital to be locally active.

If I use 'import' (or was it another name?), then the ?capital would
be treated locally as both maps are loaded independently and are then
merged together. With an 'import' you would NOT get any templates.


More information about the sc34wg3 mailing list