You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL schema - clashing enums across repositories #35
We're trying to use SQL schema files from multiple Smart Data Model Git repositories and we've noticed that in some occasions unrelated enums with the same name are defined. This means that it is currently impossible to apply all the Smart Data Model schema files to the same PostgreSQL database because some of them have clashing "building blocks".
Let's take the status_type enum as an example. It's defined in at least two model repositories - the DCAT-AP one and the Device one:
Could enums either be rewritten in such a way that they wouldn't clash even if one applies all the available Smart Data Model SQL schema files to a single database? Alternatively they could be removed and replaced with a regular text column? A name change would also work I suppose but ending up with very long (but unique) enum names might not be something we'd want in the long run?
Maybe value constraints (checks) for columns could be a good enough alternative? I.e.
status TEXTNOT NULLCHECK (status IN ('cancelled','finished','ongoing','planned','scheduled')),
There is a simple explanation for this. The people uses same terms for different things. Linked data make this attributes unique but the raw SQL export is true that present inconveniences.
However being in different models it should be different tables and therefore its use possible.
At SDM don't have unique attributes names because the world is this way, imperfect, and our goal is to normalize the real world not an imaginary world that it is not existing. In sql I know that it is possible to have the table as prefix and would not this be a solution?
All 272 affected models across the published catalog have been regenerated with the entity-prefixed naming you and rokf agreed on here. Thanks for identifying this and proposing the fix.
Activity
albertoabellagarcia commentedon Sep 3, 2025
There is a simple explanation for this. The people uses same terms for different things. Linked data make this attributes unique but the raw SQL export is true that present inconveniences.
However being in different models it should be different tables and therefore its use possible.
At SDM don't have unique attributes names because the world is this way, imperfect, and our goal is to normalize the real world not an imaginary world that it is not existing. In sql I know that it is possible to have the table as prefix and would not this be a solution?
rokf commentedon Sep 4, 2025
I suppose that you mean something like:
Distribution_status_typeDeviceOperation_status_typeThis should work as well, yes. It'd make them unique and we could apply both schema files to the same database without modifications.
albertoabellagarcia commentedon Oct 7, 2026
Fixed -- see smart-data-models/data-models#74 for the implementation details. Both examples from this issue are verified live now:
All 272 affected models across the published catalog have been regenerated with the entity-prefixed naming you and rokf agreed on here. Thanks for identifying this and proposing the fix.