Skip to content
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

Add unique_keys to FunctionalAnnotationAggMember class #2155

Open
aclum opened this issue Aug 8, 2024 · 6 comments
Open

Add unique_keys to FunctionalAnnotationAggMember class #2155

aclum opened this issue Aug 8, 2024 · 6 comments
Labels

Comments

@aclum
Copy link
Contributor

aclum commented Aug 8, 2024

We can use https://w3id.org/linkml/unique_keys to specify which two slots make up a unique key for this class, see microbiomedata/nmdc-runtime#611 and notes from 8/8/24 infrastructure meeting.

@kheal
Copy link
Contributor

kheal commented Sep 4, 2024

@aclum - should I implement this in microbiomedata#242? Seems like a logical time and place to implement.

@aclum
Copy link
Contributor Author

aclum commented Sep 10, 2024

Yes, that would be great.

@kheal
Copy link
Contributor

kheal commented Nov 8, 2024

@sierra-moxon and I have determined that uniqueness across objects is not supported in JSONSchema, and because linkml-validate uses the jsonschema serialization of the model to do validation, it is not checking the unique keys constraint. So while we could add a unique_keys field to a class, we do not currently have a mechanism for verifying validity of this constraint. Until we do, I consider this issue blocked.

@kheal kheal added the blocked label Nov 8, 2024
@aclum
Copy link
Contributor Author

aclum commented Nov 13, 2024

Is there an issue filed in the linkml repo for this?

@sierra-moxon
Copy link
Member

sierra-moxon commented Nov 13, 2024

https://github.com/orgs/linkml/discussions/2409 - our discussion centers around how to specify in the data model (nmdc-schema) that a unique index must be created in the implementation data store. In PostgreSQL this would be a unique index underlying a unique constraint. In MongoDB, this would be a unique index. In JSONSchema there is no such thing.

Being able to use our test/run-examples methodology in the nmdc-schema repo to do validation across data instances as a set without recapitulating the underlying data store (MongoDB) might be more of an architecture/DevOps issue than something easily solvable with LinkML, though. (we could explore using a tool called linkml-store that can easily spin up a MongoDB instance -- maybe we populate it with example data -- just brainstorming here...). This issue is the mechanism that Katherine mentioned above. We don't have an automated way to generate indexes in MongoDB based on some parameter(s) from the schema (is this correct? do we currently generate MongoDB indexes manually and as needed?). And we don't currently spin up an instance of MongoDB in the nmdc-schema repo, to verify that the indexes we specified are working as planned. (is this correct - I imagine to test a migrator, we spin up a local MongoDB instance, but that local MongoDB instance doesn't interact with the examples runner in the schema)

@kheal kheal removed their assignment Nov 13, 2024
@aclum
Copy link
Contributor Author

aclum commented Nov 13, 2024

cc @shreddd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants