Topic map connections

Forum is for miscellaneous user help requests.

Topic map connections

Postby Intersoul » Sun Jan 05, 2014 2:47 am

hi, i am new at the forum but i have been testing wandora for a while now.
i have two questions, a search a topic with an extractor, by example the new york times, and a several of topics are created, some of them are not so important, actually they are not about the search that i did, some of them are random dates, also a lot of names that are not important, some things like that...
now when i use the server in mode d3graph, a lot of nodes are showed almost all have connections between each other, but some of them are just there, floating around with no relationship to the topic...

https://www.dropbox.com/s/jy6nhcmra47epfa/Screenshot%20from%202014-01-04%2017%3A23%3A21.png
so the questions are, if it's possible to select what, in specific, i want to appear in the d3graph of the server?
other question is that i saw that exist a tools of statistics in wandora, the topic map connections statistics, that one tells me, how many topics have n connections. so i want o erase the topics that have no connections, I will be very grateful if you tell how i do that?

https://www.dropbox.com/s/3vmooh4od93ln2h/Screenshot%20from%202014-01-04%2017%3A40%3A45.png
Intersoul
 
Posts: 2
Joined: Sun Jan 05, 2014 2:05 am

Re: Topic map connections

Postby aki » Mon Jan 06, 2014 7:49 pm

Hi Intersoul

Thanks for using Wandora.

D3graph is a ready-made service in Wandora's embedded HTTP server. It views topics and their relations as a graph. Unfortunately the current implementation of the d3graph doesn't allow any filtering of topics nor associations. D3graph views all topics and all associations. However, it is rather easy to expand the current implementation. The d3graph service locates in the directory /build/resources/server/d3graph. Next instructions implement a code-change that filters all unconnected nodes from the graph.

  • Look at the directory /build/resources/server/d3graph/templates. It contains a file named as d3graph.vhtml. Open the file in a text editor.
  • Look at the line number 49. It contains code line
    Code: Select all
    #set( $topics = $topicMap.getTopics() )

    Replace the line with next code lines:
    Code: Select all
    ## -------------------------------------------------------
    #if( !$request.getParameter("draw_all_topics") )##
    #**##set( $topics  = $listmaker.make() )##
    #* *### -------------- Collect association player topics
    #* *##foreach( $association in $topicMap.getAssociations() )##
    #*  *##foreach( $role in $association.getRoles() )##
    #*   *##if( !$topics.contains( $association.getPlayer( $role ) ) )##
    #*    *##set( $temp = $topics.add( $association.getPlayer( $role ) ) )##
    #*   *##end##
    #*  *##end##
    #* *##end##
    #* *### --------------- Collect type and instance topics
    #* *##foreach( $topic in $topicMap.getTopics() )##
    #*  *##foreach( $type in $topic.getTypes() )##
    #*   *##if( !$topics.contains( $type ) )##
    #*    *##set( $temp = $topics.add( $type ) )##
    #*   *##end##
    #*   *##foreach( $instance in $topicMap.getTopicsOfType( $type ) )##
    #*    *##if( !$topics.contains( $instance ) )##
    #*     *##set( $temp = $topics.add( $instance ) )##
    #*    *##end##
    #*   *##end##
    #*  *##end##
    #* *##end##
    #else##
    #**##set( $topics = $topicMap.getTopics() )##
    #end##
    ## --------------------------------------------------------
  • Save the changes to the file d3graph.vhtml.
  • Restart Wandora application and open the d3graph service. By default the graph contains now only topics that are association players or types/instances. If you add the d3graph service URL address a parameter draw_all_topics i.e. your service URL address looks something like http://127.0.0.1:8898/d3graph/?draw_all_topics, the graph views also unconnected nodes.

This change will be included in the next release of Wandora application. I'll write another post to answer your second question.

Kind Regards,
Aki / Wandora Team
Last edited by aki on Mon Jan 06, 2014 8:25 pm, edited 1 time in total.
aki
 
Posts: 12
Joined: Mon Jun 28, 2010 2:40 pm

Re: Topic map connections

Postby aki » Mon Jan 06, 2014 8:25 pm

Hi Intersoul

This post answers your second question about deleting unconnected topics. Simple answer is that you can delete unconnected topics by right mouse clicking the current layer (located in the bottom left corner of the Wandora application window) and select menu option Topics > Delete topics > Delete topics without A+C+I.... The option deletes all such topics in current topic map layers that have no associations, no classes (types) and no instances.

Yet, the picture is more complex. The connection count feature counts only association players and type/class/instance relations of the topics. Wandora uses topics in association types and roles but counts such association type topics unconnected. Wandora uses topics in name types/scopes but counts such topics unconnected. And finally, Wandora uses topics in occurrence types/scopes but counts such topics unconnected (unless these topics have no other associations). If you delete occurrence type topic, you'll also delete all occurrences that are typed/scoped with the topic. If you delete a role type topic, you'll also delete all associations that have the role type. And so on. Therefore it usually requires some additional work to recognize topics that are unconnected and safe to delete. I recall Wandora usually refuses to delete a topic that is a type/scope in a name or an occurrence. In some cases Wandora may also inform/confirm your deletion has some severe side effects.

Read also the discussion thread at http://www.wandora.org/forum/viewtopic.php?f=3&t=117&sid=9446d9f8655e9630fda70ed8a34a51a5. It contains additional information related to your question.

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

Re: Topic map connections

Postby aki » Mon Jan 06, 2014 8:50 pm

Hi Intersoul

Yet another post. I looked at the screen capture that was linked into your initial post, the one with a fragment of d3graph. Just curious, how did you manage to create a topic with subject identifier

http://www.topicmaps.org/xtm/1.0/language.xtm#television

Did some extractor create it for you? Do you remember which one?

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

Re: Topic map connections

Postby Intersoul » Wed Jan 08, 2014 1:22 am

hey thanks for answering me, it was very helpful
well i am no quiet sure of how i did that, but i think it's for small modifications that i did on some extractors.
Intersoul
 
Posts: 2
Joined: Sun Jan 05, 2014 2:05 am


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 1 guest