cubicweb-keyword #483269 add new relation ``descendant_of`` to allow recursive search [resolved]

We want to retrieve all the descendants of a Keyword entity by an RQL expression.

  • descendant_of : relation from Keyword to Keyword

Creation

  • When after_add_relation of :

    • K subkeyword_of KK
    • K descendant_of KK

    we want to add a transitive closure of all K children descendant_of KK parents.

    AfterAddSubKeywordOf hook

Deletion

  • When after_delete_relation of :

    • descendant_of an entity Keyword K,

    we delete the relation only.

  • When after_delete_relation of :

    • subkeyword_of an entity Keyword K,

    we delete all the remaining descendant_of relation of the parent Keywords (seems to be reasonable)

    RemoveDescendantOfRelationHook hook

Coherence

  • Don't permit descendant_of cycle (see current subkeyword_of behaviour).

    BeforeAddDescendantOf hook

prioritynormal
typeenhancement
done in1.4.0
load3.000
load left0.000
closed by#5deaa2e20bb7 [F] schema: add new relation ``descendant_of`` to allow recursive search (Closes: #483269)