Reflexive associations

Forum is for miscellaneous user help requests.

Reflexive associations

Postby fsancho » Thu Nov 27, 2008 12:35 am

Hi everybody,

I am trying to create a reflexive association (in the scheme layer, for example, I want an association between authors that express who author "is influenced by" some other author)... but when I am trying to add the same topic playing the role "Role" in the association type, it ignores me...

Is it possible to do that?, must I use one other method? any trick?

Thanks a lot in advance
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm

Postby Olli » Thu Nov 27, 2008 12:14 pm

A topic map can't have two associations of same type with exactly same players. I'm not exactly sure what you're trying to do but if I understood correctly you have "influenced by" topic which is the association type. Then you have some role topic, say "person" and you're trying to add the "person" topic twice as a role for "influenced by" association type. You can't do this because this would result in two equal associations and these are merged automatically.

Also note that even if you could do this, later on you would have no way of telling who has influenced who because they both have same role. There are some cases where such symmetric associations would make sense. However Wandora has some limitations compared to standard topic maps, one of them is that you can't have symmetric associations. More information here.)

What you need to do is create two separate role topics, for example "influences (role)" and "influenced by (role)". Then you can add these as roles for the "influenced by (assoctype)". I added "(role)" and "(assoctype)" in topic names so the two "influenced by" topics won't get merged. It wouldn't be totally bad if they did but it's probably better to keep them separate. If you want to say that players in roles "influences (role)" and "influenced by (role)" should be of type person, you can add a "role class" association in the role topics. Note that you need to add the proper classes for these topics or the association editor in Wandora won't be able to suggest right association types and roles.

I created an example project that does this here. Look for the person topic in Wandora class/Schema type/Content type. It has two instances A and B and an association between them.

If you want to create symmetric associations in Wandora you have to work around the limitation that each player in an association must have a unique role. One way to do this is to cerate two associations for each symmetric association. In this case you would effectively be saying that "A is influenced by B" and "B is influenced by A" with two associations. If you right click on the associations in Wandora, you can select "Create symmetric associations" from the popup menu to automaticall create these. Note that "influenced by" in most cases probably wouldn't be symmetric. After all, A can influence B without B influencing A in any way.

You can also use the new (and still a bit experimental) query topic map layer (see this). This can automatically create kind of virtual associations based on predefined queries. In this case it would create the symmetric associations. I made another example with a query topic map setup like this. Here.

I hope this helps.
Olli
Site Admin
 
Posts: 10
Joined: Wed Sep 19, 2007 9:42 am

Postby fsancho » Mon Dec 01, 2008 12:53 am

Hi Olli,

Thanks a lot for your explanation and example. Now, it's totally clear for me... In my previous examples I always identified topics and roles, and I didn't realized that it is not so good idea.

But I have one question about that; in the first example you sent to me, is it not necessary to add Person to Role Class? (later, you say that Person is the Role Class of the roles defined for that association). I mean, from a theoretical point of view, because I can see that it works fine without doing that.

I hope you can understand my doubt here...

Thanks again for the previous post, and all the best.
fsancho
 
Posts: 11
Joined: Thu May 29, 2008 1:50 pm

Postby Olli » Mon Dec 01, 2008 12:48 pm

You're right, Person probably should be made an instance of Role class. In the current example the association editor won't suggest Person topic for the role class association because it is not an instance of Role class. If you make it an instance of Role class, then the association editor should pick that up and suggest Person topic automatically. This isn't absolutely necessary as you have several options in the association editor to find the topic and you can select it without it being suggested automatically.

One more thing. You're not required to define role classes for each role. If you leave them out, then Wandora will assume that the role itself is also a suitable class for topics playing the role. For example let's say we have an Author association type with roles Author and Book. Without defining any specific role classes for Author or Book, Wandora will assume instances of Author and Book are suitable topics for these roles, which in this case is probably correct.
Olli
Site Admin
 
Posts: 10
Joined: Wed Sep 19, 2007 9:42 am


Return to How to... and problems

Who is online

Users browsing this forum: No registered users and 14 guests