jamesaoverton / cmi-pb-terminology

CMI-PB Controlled Terminology
0 stars 0 forks source link

Implement a simple grammar to parse the `structure` column of the `column` table. #33

Closed lmcmicu closed 2 years ago

lmcmicu commented 2 years ago

Currently, we allow the structure column of the column table to have multiple constraints, and currently the prototype code grabs all of them simply by splitting on spaces. This was never meant as a permanent solution to the problem and so far it has been fine for the simple conditions we've had to deal with like unique, primary, and tree(child), which we can rely on to not have any spaces. Since constraints like under(table.column, value) have multiple arguments, and since presumably we don't want to force the end user to omit a space between arguments, we need to handle things more intelligently.

The best solution is to implement a simple grammar for this. For python, we can use the lark library.

jamesaoverton commented 2 years ago

Closed by #32