-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forbid reference column pointing to unexpected table? #110
Comments
All these reference properties already have an entry
Can – and should – we formalize this “or” somehow in the specs? I guess we still want the potential flexibility of people coming up with alternative encoding schemes for such references in the future, so I would understand it if we do not formalize it yet, or not yet for all properties. |
We might want to spell out more clearly, that the or means, the reference must be a foreign key (or NULL) if a LanguageTable exists. |
In looking at the new
get_foreign_key_target
Method in pycldf, I noticed that it makes sense to always return and heed the referenced table of a foreign key – but that also suggests that aformReference
might have a foreign key pointing to a table that is not aFormTable
. What would that mean?I think that the CLDF specs should specify that an
xxxReference
column SHOULD be a foreign key to theXxxTable
, and that doing it differently MAY lead to undefined behaviour in software. CLDF software SHOULD use the referenced table and check it for the columns needed.For example, my code that looks for the
segments
of a form referenced in aCognateTable
will look forinstead of
If that fails with a
KeyError
, it would be allowed to add a segments column to the FormTable, though, and expect everything to be fine, because my segmenter functionality can't be expected to work on weird arbitrary tables.The text was updated successfully, but these errors were encountered: