Re: Quick TMQL question re namespaces
Lars Heuer <[email protected]>
| Newsgroups | gmane.text.xml.xtm.general |
|---|---|
| Organization | Semagia |
| Message-ID | <[email protected]> |
Hi Andrew,
> After thinking about TMQL and path navigation in general quite a
> bit this week, how would you resolve conflicts with pre-defined axis
> names vs. user-defined role names? In TMQL as it stands, since it's
> really based on a particular TMRM->TMDM mapping, can this happen?
I wouldn't be afraid of namespace clashes since it's always possible
to use your own namespace:
proxy/mytmrm:instance-of
Well, a default TMQL engine would interpret it as (Python pseudo-code):
for x in (proxy/occurrence::mytmrm:instance-of,
proxy/name::mytmrm:instance-of,
proxy/role::mytmrm:instance-of):
yield x
In plain words: Iterate over all occs, names, and roles played with
the type "mytmrm:instance-of".
> I know I currently have only two places where this is an issue in
> my TMRM-based system, but, if I were to implement TMQL on top of it,
> I would ideally like to be able to do so without the TMDM baggage
> and operate more directly on the proxy roles themselves.
Where do you see the issues?
BTW, probably the proposal at [1] wouldn't suffer that much from
(default) namespace/path/axis issues since it uses another syntax for
axes than for topic identifiers. If I understood it correctly, all
axes use the following notation:
axis ::= <axis-name> '::' <topic-identifier> | '*'
so there is a clear distinction between axes and topic identifiers.
The current draft seems to make no distinction. Having a distinction
would make extensions to TMQL easily possible and may solve your TMRM
vs. TMDM problem, since
proxy/mytmrm:instance-of::*
can never be interpreted as a topic identifier. It would always be
interpreted as axis name (and probably rejected by a default TMQL
engine since it does not know the axis name "mytmrm:instance-of").
So, the "::" notation from the older draft seems to have it's value
even if it means that the author to be type a bit more.
[...]
> I had an admittedly brief skim through the latest slides, the CTM
> spec and the previous TMQL drafts, but I couldn't really see any
> support for doing something like this.
In CTM/TMCL the 'default' 'namespace' is the document address. If you
write
this isa topic.
and the topic map is stored at http://www.example.org/tms/ the
identifiers are resolved as follows:
^<http://www.example.org/tms/#this>
isa ^<http://www.example.org/tms/#topic>
.
(the "^" is an indicator for item identifiers). The same works for the
topics specified by subject identifiers and subject locators:
=<#this> isa <#topic>.
Result:
=<http://www.example.org/tms/#this>
isa <http://www.example.org/tms/#topic>
.
[1] <http://www.itscj.ipsj.or.jp/sc34/open/1536.pdf>
Best regards,
Lars
--
Semagia
<http://www.semagia.com>
<https://twitter.com/larsheuer/> Twitter
<http://www.topicmaps.de/mailinglist/> German Topic Maps mailing list
<http://tinytim.sourceforge.net/> Open Source Topic Maps engine
<http://mappa.semagia.com/> Mappa - Python Topic Maps engine