Search
 
Archives
Categories
Blogroll
Meta
Wetter
Today
Quelle: ETHLife
Weblog
« Introducing Jsaurus v0.1
The BIOZ-Syndrom: Or There and Back Again »
 

November 27th, 2006
Creating sitemaps with JSaurus

A graph is nothing else then a thesaurus: Both contains nodes and connections or relations. Therefore I thought about visualizing the link relations between a homepages websites. I took my own homepage cPOEt.net as test data set to create a sitemap with JSaurus, a JavaScript software to visualize a graph or thesaurus.

The node sites have some antigravitation that lets them go as far as possible from other nodes. Only node sites are forced to stay together that are connected by link to each other. This force is calcualted with spring force. It is quite interesting how all the site nodes automatically reorganizes themselves looking for the most optimal distribution in respect to the forces working.

To create a graph or a thesaurus, JSaurus only needs some XML, where the nodes are defined with a set of meta informations. You have to define node tags with some attributes only. You have to add some nodes in the subsection for every link on the nodes site. Every node tag has at least 2 attributes (i.e., ID, title). The title attribute describes the title or the content of this site. The ID tag contains a unique ID to identify each node site. The links are predestined for the use as ID, because they identify a site best. The use of IDs is important to define relations to an already defined node site. I’ll explain that in a short instant. But before, I want to show you an example of a simple XML file for a sitemap. The sites doesn’t have any links backwards to sites comming from.

  • <node id=”http://www.cpoet.net” title=”cPOEt.net”>
    • <node id=”http://www.cpoet.net/studium” title=”Study”>
      • <node id=”http://www.cpoet.net/paper” title=”Paper”>
        • <node id=”http://www.cpoet.net/paper.pdf” title=”Download”></node>
      • </node>
    • </node>
    • <node id=”http://www.cpoet.net/blog” title=”Blog”></node>
  • <node>

You were asking how it is possible to define graph circles with a tree structured XML file? Well, it’s easier then you imagine. As ment befor, every node has an unique ID. If a node is going to be inserted into the thesaurus of JSaurus, its ID of the XML is taken to check if it has been inserted already. If it’s the case, the already inserted node is taken to create a relation with the parent node of the XML that exists in the thesaurus already. That’s the whole magic. In the following example the paper site has a link back to the main site. The ID tag is taken to identify the nodes.

  • <node id=”http://www.cpoet.net” title=”cPOEt.net”>
    • <node id=”http://www.cpoet.net/studium” title=”Study”>
      • <node id=”http://www.cpoet.net/paper” title=”Paper”>
        • <node id=”http://www.cpoet.net/paper.pdf” title=”Download”></node>
      • <node>
      • <node id=”http://www.cpoet.net” title=”cPOEt.net”></node>
    • </node>
    • <node id=”http://www.cpoet.net/blog” title=”Blog”></node>
  • </node>

For the sitemap if written a XML loader to read data from a XML file and insert elements into the thesaurus of JSaurus. But it is conceivablly to write different loaders that handles the import of different formats.

You can follow the comments to this entry by Du kannst die Kommentare zu diesem Eintrag durch RSS 2.0 feed. You can write a comment, or create a Trackback on your site.

top

Kommentar schreiben

×Name:  
×Mail wird nicht veröffentlicht
Website:  
Kommentar:  
×: notewendige Felder



© 2004 - 2008 by Amancio Bouza