[Cubicweb] Reciprocal Relations

Sylvain Thénault sylvain.thenault at logilab.fr
Sun Dec 12 22:45:42 CET 2010

On 12 décembre 18:54, Fletcher, John P wrote:
> I very much appreciate the symmetrical relation 'see also' which creates both links.
> I would be very interested if there was an implementation of a reciprocal pair relation e.g. parent/child
> where creation of one implied a reciprocal one in the other direction.
> It would be very nice indeed if that was implemented as a tool which could be replicated with a pair of names
> as tag can be used without having to modify the code.
> Something similar exists in SemanticMediaWiki where pairs such as 'author of'/'written by' can be easily put together.

As I understand it, you describe standard cw's relations. You define it one
way in the schema, but provide two translation for a relation definition, for cases
where it's readen from left to right and the other side. Eg if you add a children to
a folder, navigate to this children and you'll see the parent folder as 'parent'.
However the relation is stored in the database as you described it in your schema,
hence the reciprocal (implicit) relation isn't queryable through RQL. But from a UI
point of view, it's totally transparent.
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Cubicweb mailing list