mapping-commons / sssom

Simple Standard for Sharing Ontology Mappings
https://mapping-commons.github.io/sssom/
BSD 3-Clause "New" or "Revised" License
141 stars 24 forks source link

Add sssom_schema.yaml to projects/ #301

Open puja-trivedi opened 11 months ago

puja-trivedi commented 11 months ago

Would you be able to add a version of the sssom_schema in LinkML formatting with file extension .yaml.

I am creating my own model using LinkML and I want to use the sssom_schema (sssom:Mapping) but in order to import the schema it must be .yaml.

matentzn commented 11 months ago

You are right in that no yaml is specifically released.. the editor file is here https://github.com/mapping-commons/sssom/blob/master/src/sssom_schema/schema/sssom_schema.yaml

@hrshdhgd what is the prevalent practice: should a yaml file be copied into the release directory? Else, how do you make sure that people don't use a version with unreleased edits?

Also @hrshdhgd can you tell @puja-trivedi how to access the yaml file using the pypi sssom schema package?

hrshdhgd commented 11 months ago

You can access the sssom_schema.yaml file using pkg_resources. An example of this is done in sssom-py here.

SCHEMA_YAML = pkg_resources.resource_filename("sssom_schema", "schema/sssom_schema.yaml")

Then you could use SchemaView in linkml and proceed e.g.: SchemaView(SCHEMA_YAML)

puja-trivedi commented 11 months ago

@hrshdhgd , @matentzn - Okay I will try that, thank you!