Multiple ontology support#1296
Open
cwant wants to merge 3 commits intoElixirTeSS:masterfrom
Open
Conversation
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.
Summary of changes
This is a scheme to specify multiple ontologies for a field that is completely backwards compatible with the current single ontology implementation.
As before, we can specify an ontology like we do in the models:
(This takes the default of
Edam::Ontology.instancefor theontologyargument.)Now you could allow terms from more than one ontology, like in the tests in
test/unit/has_ontology_terms_test.rb:The
ontologiesargument takes an array of hashes, each hash having keysontologyandbranch(and if either key is excluded, it takes similar defaults as before).In the example above, terms come from Edam (topics branch) and from DummyOntology (no branch specified).
Motivation and context
Explora uses multiple ontologies for scientific topics, and this implementation is adapted from that work. In the Explora case, we use a preferred ontology (CRDC from Statistics Canada) that we expose in the user interface (auto-complete), but we also want to be able to ingest Bioschemas that uses Edam.
Out of scope: this work does not address auto-complete in any controllers. The person implementing the ontology has to figure that one out themselves (in the Explora case, we basically did a
s/edam/crdc/and renamesEdamControllertoCRDCController.Screenshots
Not much to screenshot, since this works at a very abstract level and in fact there are no concrete examples in the code base. The test to look at though is
test/unit/has_ontology_terms_test.rb, which has examples of this working in a mocked sense.Checklist