How do you accurately represent a hierarchy?

Forum is for miscellaneous user help requests.

How do you accurately represent a hierarchy?

Postby clemp » Mon Jan 28, 2013 4:27 am

IS there a preferred way to represent a hierarchy in a topic map in Wandora? I extracted a folder tree and noticed that it used the Superclass-subclass association but that results in each folder showing up in two places in the tree, once as a superclass of the lower level folders/files and once as a subclass of it's parent. Is there a way to represent a hierarchy in a way that Wandora shows it in a form that matches the original structure?

Thanks.
clemp
 
Posts: 10
Joined: Tue Nov 23, 2010 6:59 am

Re: How do you accurately represent a hierarchy?

Postby akivela » Mon Jan 28, 2013 1:21 pm

Hi Clemp

No, there is no preferred way of representing a hierarchy in Wandora. It really depends on your hierarchy which association type and roles suit you best.

In this particular case you have used File > Extract > Simple files > Directory structure extractor and the extractor really uses superclass-subclass relation to mark a file or a folder is inside a folder. As folder structures rarely contain loops, the resulting superclass-subclass structure is really a tree like hierarchy. Addition to this superclass-subclass relation Wandora adds a Directory type topic to each topic representing a directory and a File type topic to each topic representing a file. These type topics are there just to distinguish files from directories. Also, typing is flat i.e. it really doesn't store information about where the the file or directory locates.

In this particular case the superclass-subclass relation really stores the information about file and directory location in your file system -- if you think the file system structure as the original structure. Unfortunately the extractor doesn't mark the root directory anyhow and you need to locate it manually under Directories. Then you can start browsing it's subclasses as if they were subfolders of the root.

If you are not happy using the superclass-subclass relation to mark a file or a folder is inside a folder, you can always use Change type... and Change role... tools to change these (after extraction). Also, if you want to play with Wandora's source code, you'll find the DirectoryStructureExtractor in package org.wandora.application.tools.extractors.files, and is should be very easy to change used relations.

Did I manage to answer your question?

Kind Regards,
Aki / Wandora Team
akivela
Site Admin
 
Posts: 260
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Re: How do you accurately represent a hierarchy?

Postby clemp » Mon Jan 28, 2013 4:29 pm

Hello Aki:
Yes, you answered the question I asked but I don't think I asked the right question. :)
Wandora has a Tree-View control built in and it has a way to add new tabs based on a configurable association.
This would be very handy for exploring my intended data model from different perspectives. However, when using the tree-view control to view a structure I already understand (the folders on my hard-drive)
Root_Folder
A_Sub_Folder
File_1
File_2
I noticed that folders show up in the tree-view twice: Once because they have a superclass association to the files they contain and once because they have a subclass association to the parent folder that contains them. The tree-view shows:
Folders
[b][u]A_Sub_Folder[/u][/b]
Root_Folder
[b][u]A_Sub_Folder[/u][/b]
Files
File_1
File_2
Is there a way to configure the tree-view control that would allow me to reproduce only the original structure in the tree-view?

In trying to answer that question myself, I tried setting up the Custom tab to be a duplicate of the Topics tab and then I edited the Custom tab by using the Configure Types context menu. It appears that the changes I made there are not just to the Custom Tab but to all Tree representations in Wandora. I changed the SuperClass-Subclass entry in that dialog and now "Wandora Class" is the only thing that shows up in any tree (even the ones in the popup dialogs) so I can't get back to where I was. I can always reinstall Wandora but I figured I'd ask about the right way to configure a tree-view before I do. :)

Carl
clemp
 
Posts: 10
Joined: Tue Nov 23, 2010 6:59 am

Re: How do you accurately represent a hierarchy?

Postby aki » Tue Jan 29, 2013 1:23 pm

Hi Carl

I see. I assume the Directory and File topics make the picture a bit confusing. The file and folder structure is already in Wandora's topic map but you have dig it up a little. You can create new topic tree tab to do that -- or you can modify the topic map to clear up the view. I'll next go through both these paths step by step. But, if you have messed the default topic tree structure, please restore it either by a fresh Wandora installation (we released a new version yesterday, by the way) or replace the options.xml in resources/conf with a fresh copy.

Let's go through the option of creating new topic tree tab first. I assume you have just performed a Directory Structure extraction successfully and Wandora's default topic tree views both Directory and File topics below Wandora class.

  • Right mouse click the Topics tab above the topic tree. A context menu should pop up.
  • Select context menu option Create new tab. A dialog window opens with a title Create New Topic Tree Tab.
  • In the dialog window give your tab a name, My folders, for example.
  • In the dialog window press No topic button beside label Root and select the root folder where you started the Directory Structure extraction. You'll find the root folder topic under topic Directory.
  • In the dialog window tick checkbox labeled as Subclasses. As Wandora models the file and folder inclusion using superclass-subclass relations we need to view only subclasses in our new tab.
  • Close dialog window by mouse clicking button OK.
  • Wandora creates a new topic tree and views the root folder topic as a root of the tree. You can open topics under it and topics should respect the original folder structure.

Ok, lets see the other path of modifying topics and associations in a way that clears up the default topic tree. Again, I assume you have just performed successfully Directory Structure extraction and Wandora's default topic tree views both Directory and File topics below Wandora class.

  • Open the topic that represents the root folder of your file system. You should find it under Directory topic. Open the topic by double clicking it. Wandora views the topic in topic panel.
  • Select menu option Topics > Add to topic > Add class... Wandora opens up a topic selection dialog.
  • In the topic selection dialog select topic Wandora class and click button Select. Now your root folder topic appears in the default topic tree and you can browse it like it was a file system explorer.
  • File and Directory topics still remain in the default topic tree. If these topics make you uneasy, you can continue and remove them like this.
  • Double click the topic Directory. Wandora opens up the topic in topic panel.
  • Locate topic's associations. Topic Directory should have only one association typed as Superclass-Subclass. Select the association by clicking either of the player topics in association.
  • Right mouse click and select context menu option Delete association...
  • Wandora confirms deletion. If you confirmed the deletion, topic Directory disappears in the topic tree.
  • Do the same for topic File. Double click it in the default tree, locate topic's associations and remove topic's Superclass-Subclass association. Topic File disappears in the default topic tree.

And that is about it.

Please do drop a line if I was not clear enough -- or missed something.

Kind Regards,
Aki / Wandora Team
aki
 
Posts: 12
Joined: Mon Jun 28, 2010 2:40 pm

Re: How do you accurately represent a hierarchy?

Postby clemp » Tue Jan 29, 2013 3:56 pm

Thank you for the detailed instructions. It was all perfectly clear.
Now that I have a small Topic Map with a known structure and a view I can relate to, I should be able to experiment and figure some things out.

Thanks again.
clemp
 
Posts: 10
Joined: Tue Nov 23, 2010 6:59 am


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 29 guests

cron