Should LinkML metamodel have a way to specify which slots should be "indexed" in various storage backends, e.g. SQL DDL, mongo, neo4j, etc... #2409
sierra-moxon
started this conversation in
Ideas
Replies: 1 comment
-
I think it'd be useful, yep! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From a recent discussion with @kheal( see: microbiomedata/nmdc-schema#2155)
The gist of the question is: Should LinkML have a way to specify that a particular slot or set of slots in a class (perhaps using the
unique_keys
meta slot) should result in an index on an attribute/column/property or a compound index (if the storage mechanism supports this—e.g., SQL DDL)?Right now, our SQL DDL generator uses the
keys
related metamodel slots to establish FK and PK relationships between tables in that serialization. We get the indexes "for free" in many RDBM implementations.For MongoDB, we don't have constraints, but we can specify indexes: https://www.mongodb.com/docs/manual/indexes/. Still, we currently don't serialize a "schema" into MongoDB "collections" because there is no such thing. But it would be helpful to hint at the code that creates a collection and where to index it. We could do this through the
keys
LinkML mechanism as the SQL DDL generator does to create constraints.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions