sssom icon indicating copy to clipboard operation
sssom copied to clipboard

Add sssom_schema.yaml to projects/

Open puja-trivedi opened this issue 1 year ago • 3 comments

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.

puja-trivedi avatar Jul 20 '23 19:07 puja-trivedi

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?

matentzn avatar Jul 20 '23 19:07 matentzn

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)

hrshdhgd avatar Jul 20 '23 20:07 hrshdhgd

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

puja-trivedi avatar Jul 20 '23 21:07 puja-trivedi