jamesaoverton / cmi-pb-terminology

CMI-PB Controlled Terminology
0 stars 0 forks source link

Prototype `under` structure #29

Closed jamesaoverton closed 2 years ago

jamesaoverton commented 2 years ago

Building on #28, we use tree() by specifying an under(table.column, value) structure. The 'table.column' points to the definition of the tree(). The 'value' specifies a node X in the tree. When validating a value Y, X must be identical to Y or X must be an ancestor of Y in the tree.

I think we should have at least these two different validation error cases/messages:

  1. Y is not in the tree
  2. (Y is in the tree but) Y is not under X

In previous VALVE implementations the whole tree was held in memory. This time we would prefer not to keep in memory, and instead use a WITH RECURSIVE query similar to this: https://github.com/ontodev/gizmos/blob/master/gizmos/tree.py#L806

lmcmicu commented 2 years ago

Note to self: See here for general notes on implementing under.

lmcmicu commented 2 years ago

I think there should be a third check: that a tree corresponding to table.column is actually defined at all.

jamesaoverton commented 2 years ago

Closed by #32