Identify properties by ID and type#263
Merged
Merged
Conversation
this proves that now different properties can have the same name across different structure types (regular functor != regular category), implemented in the previous commit
1a57872 to
00af974
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An issue that already became apparent while working on #242 was that, sooner or later, properties can no longer be identified solely by their ID in the database, i.e. by their name, since the same name can be used for properties of different structure types. For example:
regular category != regular functor
Thus, we cannot have a single entry with the primary key
regularin the properties table (which, after #242, contains properties of all structure types). Other examples that will become problematic once additional structure types are added include:initial functor != initial object
isomorphism (as a property of a morphism) != isomorphism (as a property of a functor)
cocomplete category != cocomplete monoidal category
To fix this, the primary key of the properties table is now the composite key
(id, type). As a result, a couple of queries (though not many) had to be adjusted. (Of course, using a longer single primary key likeregular_categoryis inconvenient.)Remark: the
structurestable and theproperty_assignmentstable remain unchanged, even though one could argue that, for consistency, the type should also become part of their primary keys. This is not necessary at the moment, and if the need arises, it can be addressed in a later PR.To demonstrate that the change works, the new functor properties "regular" and "coregular" have been added. Both properties have been decided for all functors in the database. (In fact, this motivated adding the property of preserving regular epis/monos in #262, which was merged recently.)
Other examples that may be added later: "additive functor" (can now be distinguished from "additive category"), "accessible functor" (can now be distinguished from "accessible category"), "cartesian functor", "topological functor", etc.