You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Rogier Peters <Ro...@hippo.nl> on 2003/10/01 15:16:07 UTC

Related Documents, MapTransformer and Topic Maps

Hi all,

We have a client who required a website with a related document
function. 
This means that each document in a collection contains keywords, and
when the document is displayed, it also shows a list of other documents
that contain one or more of the same keywords. 

There are a lot of documents in this collection, and although they are
stored in an XML database, I didn't really feel like querying them in
real-time. I really wanted something lean and mean. So in XP fashion, I
picked the simplest datatype to express relations, java.util.Map, and
went from there. The keys in the map are the keywords from the document
collection, the values it returns are URLs pointing to the documents
that contain this keyword.

So I ended up with two components:
- MapManager - initializes one or more maps from a ( cocoon )
xml-source, which is constructed according to a specific DTD. The
datatype stored in the map can currently be one of String, Set or
SortedSet ( in case results are sorted by relevance ).
- MapTransformer - looks for <key> elements in a specific namespace, and
transforms the value(s) returned by the map into the <key> element.

The names are a little confusing because the use of 'map' in cocoon
usually refers to the sitemap, but a change is just a simple refactoring
away. 

If anyone is interested in this functionality I'd be happy to donate it.
If you think this is not the right way, or there are other ways to do
this in Cocoon, let me know.

---
[RT]

I tried to make this mapping very generic. It could be keyword > related
document, keyword > explanation, document > related document, or url >
metadata. A first extension would be keys with wildcards or RE's
although that would force me to loose the map model.
Googleing xml and relations quickly brought me another subject that I
haven't seen discussed much here - XML topic maps. On of the big
advantages of topic maps over my simple mapping is the amount of
semantics that topic maps allow. Topic maps allow one thing to be
related to another, and also describe what the one thing is, what the
other thing is, and what kind of relation they have. 
So the next step would be to implement a topic map transformer. There is
a apache-license topic map project at
http://sourceforge.net/projects/tm4j. I'm definitely going to look into
it myself, but need to do some reading first, and I would like to
discuss it. By the way, if you don't like topic maps, I would like to
know too - I wasn't able to find any criticism on the matter (googleing
'why topic maps are bad' or 'topic maps suck' didn't help)


With kind regards / Met vriendelijke groeten,

Rogier Peters
---------------------------------------------------------
Content Management Department
Hippo Webworks
Rogier(at)hippo(dot)nl / www.hippo.nl 

Re: Related Documents, MapTransformer and Topic Maps

Posted by Upayavira <uv...@upaya.co.uk>.
Conal Tuohy wrote:

>Rogier Peters wrote:
>
><snip/>
>
>  
>
>>Googleing xml and relations quickly brought me another subject that I
>>haven't seen discussed much here - XML topic maps. On of the big
>>advantages of topic maps over my simple mapping is the amount of
>>semantics that topic maps allow. Topic maps allow one thing to be
>>related to another, and also describe what the one thing is, what the
>>other thing is, and what kind of relation they have. 
>>So the next step would be to implement a topic map 
>>transformer. There is
>>a apache-license topic map project at
>>http://sourceforge.net/projects/tm4j. I'm definitely going to 
>>look into
>>it myself, but need to do some reading first, and I would like to
>>discuss it. By the way, if you don't like topic maps, I would like to
>>know too - I wasn't able to find any criticism on the matter 
>>(googleing
>>'why topic maps are bad' or 'topic maps suck' didn't help)
>>    
>>
>
>I've done some experimental work with Topic Maps in Cocoon - using XSLT to
>harvest TMs from other data sources, merge them, and then to render them as
>web pages with "related links". See for example
>http://www.nzetc.org:8080/tm/corpora.html for a TM-based view of some of our
>website that shows some of these relations but virtually no actual content
>(warning: it's very slow).
>
>I think the technology holds a lot of promise, and could be particulaly
>useful in things like Forrest, but we will need some extra components before
>they will be readily used in Cocoon, particularly a
>TopicMapMergeTransformer, and some kind of TM-oriented templating
>transformer for rendering. I haven't had a chance yet to deal with it, but
>it's on my list of things to do :-)
>
>By the way, did you realise that the tm4j project actually already includes
>some Cocoon components?
>
>Cheers
>
>Con
>  
>
The chap leading a project (probably that one) on topic maps was active 
on the Forrest-dev list recently.

Regards, Upayavira


RE: Related Documents, MapTransformer and Topic Maps

Posted by Conal Tuohy <co...@paradise.net.nz>.
Rogier Peters wrote:

<snip/>

> Googleing xml and relations quickly brought me another subject that I
> haven't seen discussed much here - XML topic maps. On of the big
> advantages of topic maps over my simple mapping is the amount of
> semantics that topic maps allow. Topic maps allow one thing to be
> related to another, and also describe what the one thing is, what the
> other thing is, and what kind of relation they have. 
> So the next step would be to implement a topic map 
> transformer. There is
> a apache-license topic map project at
> http://sourceforge.net/projects/tm4j. I'm definitely going to 
> look into
> it myself, but need to do some reading first, and I would like to
> discuss it. By the way, if you don't like topic maps, I would like to
> know too - I wasn't able to find any criticism on the matter 
> (googleing
> 'why topic maps are bad' or 'topic maps suck' didn't help)

I've done some experimental work with Topic Maps in Cocoon - using XSLT to
harvest TMs from other data sources, merge them, and then to render them as
web pages with "related links". See for example
http://www.nzetc.org:8080/tm/corpora.html for a TM-based view of some of our
website that shows some of these relations but virtually no actual content
(warning: it's very slow).

I think the technology holds a lot of promise, and could be particulaly
useful in things like Forrest, but we will need some extra components before
they will be readily used in Cocoon, particularly a
TopicMapMergeTransformer, and some kind of TM-oriented templating
transformer for rendering. I haven't had a chance yet to deal with it, but
it's on my list of things to do :-)

By the way, did you realise that the tm4j project actually already includes
some Cocoon components?

Cheers

Con