How can you find all all topics in a Topic Map

Forum is for miscellaneous user help requests.

How can you find all all topics in a Topic Map

Postby clemp » Fri Feb 01, 2013 7:14 am

This is something I ran into a couple of years ago when I first discovered Wandora and now I ran into it again in a slightly different context. A Topic Map can contain topics that are used but are not visible. For example, after running the Directory Structure Extractor I can easily see that it extracts readable-file and writable-file. However, until I ran a script in the Processing panel, I did not know that it also created an "Accessibility" Association Type and both Readable-File and Writable-File are associations of that type. The only way to see that is to search for "accessibility" and open it in the topic panel. Accessibility does not show up in the tree under Association Type. I assume this is because it is not explicitly tied to that topic. It also does not show up under the readable-file or writable-file topic. I assume this is because there is no section of the panel that searches back from an association to an association type. After that long-winded background, my questions are these:
If I open a topic map someone else built, is there an easy way to get a list of all the topics in the map? Or better yet, a filtered list of all topics so I can narrow things down to find topics that might be related to my task at hand? Is there a way to view the entire schema even if it contains fragments that are not tied back into the Schema Type tree? The search works for finding a topic but I have to know what name to search for before-hand.

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

Re: How can you find all all topics in a Topic Map

Postby akivela » Fri Feb 01, 2013 5:21 pm

Hi Carl

Finder beside the topic tree accepts regular expressions and lists all topics if your query is a single dot character (.)

Search dialog at Edit > Search accepts also regular expressions.

Regular expression search works if your topic map is relatively small. Beyond that you need to use other methods to locate unconnected topics.

I suppose one could write a query script [1] that would return topics that have no associations nor instances nor classes. That would be something like

Code: Select all
importPackage(org.wandora.query2);
importPackage(org.wandora.topicmap);
new Count(
  new Union(
    new Types(),
    new Instances(),
    new Players()
  )
).as("#count").from(new AllTopics().as("#topic"))
.where(new Of("#count"),"=","0");


You can execute the query in the Query script tab of search dialog. Use Rhino engine.

Also, I think the Layers > Statistics > Asset weights... tool can be used to detect alone topics. The more connected a topic is the higher it's asset weight value is. If asset weight is one (using default settings), the topic is not connected anyhow to other topics.

But in general you are right. It is rather difficult to spot separate topics and even more difficult to spot separate topic islands.

Kind Regards,
Aki / Wandora Team

[1] http://www.wandora.org/wandora/wiki/ind ... y_language
akivela
Site Admin
 
Posts: 260
Joined: Tue Sep 18, 2007 10:20 am
Location: Helsinki, Finland

Re: How can you find all all topics in a Topic Map

Postby clemp » Sat Feb 02, 2013 1:23 am

Thanks for all the suggestions. Both the query and Asset Weights showed 4 disconnected topics, including the one I found accidentally.

Regards,

Carl
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 1 guest