As I managed the first step for a touchgraph specialpage (yet only for Category:pages), I start a new thread.
I - Refactoring in 1.5 ?
On a previous thread (don't ask me where), Rowan Collins (as far as I remember) wrote that in the 1.5 version, the database would be totally refactured. Is the map already available? Will it affect a lot the "links" and "categorylinks" tables?
II - Touchgraph coding
1)Touchgraph Architecture
The touchgraph engine feeds the applet with an xml file containing two parts: - All the nodes (id, label, colors, mouseover hint-html-...) - All the edges(links) (from_id, to_id)
REMARK: ------- The problem is that it works if a node has no edges, but it dies if it exists an edge with an id of a node which doesn't exist.
2) Mysql queries
a)To produce the list of nodes I used:
$sql = "SELECT cur_id,cur_namespace,cur_title,cur_is_redirect FROM cur WHERE cur_namespace=14 OR cur_namespace=0 ORDER BY `cur_id` DESC";
b)To produce the list of edges I used:
$sql="select cfrom.cur_id AS bfrom, cto.cur_id AS bto FROM categorylinks INNER JOIN cur AS cfrom ON (cfrom.cur_id = categorylinks.cl_from AND cfrom.cur_namespace=14) INNER JOIN cur AS cto ON (cto.cur_title = categorylinks.cl_to AND cto.cur_namespace=14)";
As I said to Richard Holton (cf. "need mysql geek"), a simple query wasn't enough because I need to be sure that the edges are BOTH existing nodes in the cur table. Otherwise the engine dies.
QUESTIONS
a)Has anybody got an idea of the queries for the normal pages d:-D) ?
b)The file is already very heavy. For a use in production (I mean in a public wikipedia site), can someone think of the type of indexes which could be useful ? - I thought for example of a listing on a limited level of links: give the starting page, and the engine will produce a listing of nodes up to three nodes level away from the starting page.
c)Can someone recode in Java the engine to get something more like the two frames tikiwiki extension
REFERENCES
http://www.touchgraph.com/ (touchgraph official page) http://www.fxparlant.net/Special:Touchgraph (my demo on my mediawiki category pages)
François