mih / datalad-mihextras

DataLad extension with special interest functionality or drafts of future additions to DataLad proper
Other
1 stars 1 forks source link

LinkML dynamic enum for constraining slot value to a list of terms #45

Closed jsheunis closed 10 months ago

jsheunis commented 10 months ago

In the context of https://github.com/mih/datalad-mihextras/issues/44, I have created a basic LinkML model for a datalad dataset. One slot that I'm having trouble with is the license slot for a Dataset class. Based on their documentation (https://linkml.io/linkml/schemas/enums.html#dynamic-enums and https://linkml.io/linkml/faq/modeling.html#how-do-i-constrain-the-value-of-a-slot-using-an-ontology-or-vocabulary) it should be possible to define the slot's range as an enum which references an ontology. But I am unfamiliar with which properties to use and what they actually mean (source_ontology, source_nodes, relationship_types, etc) in order to get this to work. The documentation doesn't provide enough background or more information here, or I guess it assumes some knowledge about ontology queries that I don't have.

I also think my problem has to do with the specific meaning of an ontology vs a list of terms. In this case, our list of terms comes from the prefix: https://spdx.org/licenses/. I guess this isn't an ontology per se, but rather a base URI against which specific terms (here, licenses) can be resolved?

Is this why I get this error:

> gen-jsonld-context tools/metadata/dataset-schema.yaml

ValueError:  Unknown argument: source_ontology = 'spdx'

Note: might be worth investigating the use of https://github.com/INCATools/ontology-access-kit

jsheunis commented 10 months ago

Closing this since it has been recreated in the applicable repository: https://github.com/psychoinformatics-de/datalad-concepts/issues/59