cubicweb #509109 transitivity of relationships [open]
A relation R is transitive if R(a,b) and R(b,c) implies R(a,c). Having a 'transitive' property for relations would make it easier to deal with hierarchies for example. We would say "descendant_of: subject='Keyword', object='Keyword', transitive=True" and there would be no need to define the hooks that compute all the implications of a new relation as we do now. | |
priority | normal |
---|---|
type | enhancement |
done in | <not specified> |
load | 2.000 |
load left | 2.000 |
closed by | <not specified> |
Comments
-
2009/11/09 14:38
-
2009/11/09 16:54, written by nchauvat
-
2010/07/21 13:40, written by acampeas
add commentI've changed child_of to descendant_of in the example above (better suited to the examples : my grandchildren are not my children).
I think that we need to be careful here. Transitivity is wonderful in math but ends up being tricky in real life. If you define a truly transitive relation, won't you need pretty soon to be able to restrain it to a single depth level? For instance in a classification scheme such as:
I think it's only when searching that transitivity comes into play: when working with my hierarchy I'm mostly interested by the immediate neighbour levels (above and under the level in use) : I don't want to see that my category is ultimately in the top-level category of my ontology, nor am I interested in all the sub-sub...categories.
yes, making a difference between _descendant_of (the relation in the schema, that you call child_of above) and descendant_of (the computed relation) is needed:
Any Y WHERE Y transitive_closure_of(child_of) X ? :)