[topicmapmail] How about having a language to describe the display of topics

Kal Ahmed kal@techquila.com
Fri, 13 Dec 2002 10:00:56 +0000


On Thursday 12 December 2002 17:15, Lars Marius Garshol wrote:
> * Kal Ahmed
>
> | I have found that using a template-based system (actually using
> | Jakarta Velocity) with a simple driver program that selects the
> | template to use based on the topic type works pretty well. I think
> | that you could also do something similar with XSLT.
>
> Some people use XSLT, but it doesn't work particularly well. The
> vendors have solutions that make this easier, but those cost money, of
> course.
>

I always thought that XSLT wouldn't work particularly well for topic map=20
presentation, but recently I tried a slightly different approach, using a=
n=20
XSLT stylesheet to work on a mini-topicmap extracted from a larger topic =
map.=20
By doing this extraction, I can force the extracted "fragment" to be a=20
consistent topic map (as defined by XTM) and furthermore ensure that=20
references are "normalized" to topicRefs. Then I have a small topic map t=
hat=20
can be far more easily processed by XSLT.

And it was all done with TM4J & Saxon...so cost is not an issue ;-)

> | Would it be worth standardising such a page description language
> | specifically for topic maps?
>
> One of the open issues with the TMQL requirements is whether an output
> language should be part of TMQL (in much the same way that XSLT and
> XPath fit together).
>
Are you suggesting something like XSLT or something more like the XQuery =
model=20
? I can see that an XQuery model could be really useful - combined with a=
=20
topic-type based templating system it would be quite flexible. In fact, I=
 am=20
pretty sure that using a combination of tolog, the topic map extraction=20
algorithm I have for my XSLT transforms and a bit of XSLT magic you could=
=20
produce something really cool.

> Personally, I think it should. Using XSLT and similar things is really
> awful compared to using a language that is specially designed for
> transforming topic maps. Ontopia already has such a language, and we
> are very happy with it, but some people are concerned that it is not
> standardized.
>
> I think they are right to be concerned, and at the same time I think
> the custom language approach is the right one.
>

Until this conversation, I hadn't really thought about the XQuery style o=
f=20
doing things, but I think that it could have alot of mileage. A pipeline =
of:
XML template with embedded TMQL -> TMQL processor -> XSLT processor -> Ou=
tput=20
format
would be pretty flexible.

> | Firstly, it would be a lot of effort to try and create a
> | templating/layout scheme specifically for topic maps - and if 80% of
> | the work is done already then why repeat that ?
>
> Actually, I think such a scheme could be done surprisingly easily. You
> don't really need all that much machinery. The hard part is the query
> language, not the templating system above it.
>
> | Secondly, it would be yet another thing for topic map application
> | developers to learn - I think it would be much better if an XSLT
> | whizz could just sit down with a set of documented XSLT templates
> | for extracting information from a topic map and come up with the
> | stylesheets using the language (s)he knows.
>
> Well, it certainly would mean yet another thing to learn, but I think
> compared to using XSLT it would definitely be worth it. The language
> Ontopia has defined can be learned in a day, and I don't think a
> standard language would have to be any more complex.

Perhaps the application of TMQL in the manner described above would actua=
lly=20
eliminate the need for a templating language. One less thing to learn is =
a=20
Good Thing.

Cheers,

Kal

--=20
Kal Ahmed, techquila.com
XML and Topic Map Consultancy

e: kal@techquila.com
p: +44 7968 529531
w: www.techquila.com