linkml / schema-automator

Automated assistance for the schema development lifecycle
https://linkml.io/schema-automator/
BSD 3-Clause "New" or "Revised" License
33 stars 12 forks source link

Automatic model for JSON-to-RDF mapping based on a custom ontology #119

Open danielbarta opened 1 year ago

danielbarta commented 1 year ago

I seek clarification regarding the representation of an custom ontology within a LinkML schema when creating a JSON data mapping to custom ontology classes.

While I am aware LinkML supports the transformation of JSON data into RDF format using a LinkML schema. However, I want to incorporating an existing ontology into the schema to guide the mapping process. Meaning, I would like to use the external ontology as a reference for mapping JSON data to RDF.

  1. Is it possible to represent an external ontology within a LinkML schema?

  2. What is the recommended approach for including an external ontology as part of the schema?

  3. Are there any specific LinkML constructs or features that facilitate the integration of an external ontology?

Are there any limitations or considerations to be aware of when using an external ontology in a LinkML schema for JSON-to-RDF mapping?

Please feel free to request any additional information or details that may assist you in addressing my query.

sierra-moxon commented 1 year ago

Hi @danielbarta - thanks for the good questions!

Here are a couple of resources and examples for you:

  1. Using ontology terms to constrain the value of a slot: https://linkml.io/linkml/faq/modeling.html#how-do-i-constrain-the-value-of-a-slot-using-an-ontology-or-vocabulary e.g. https://github.com/linkml/linkml-model/blob/main/examples/dynamic-enums-example.yaml
  2. Using slot_uris and class_uris in your schema: https://linkml.io/linkml/schemas/uris-and-mappings.html e.g. https://github.com/microbiomedata/nmdc-schema/blob/fba9062516e3ae0619e17df4f00d1352f1b86d4b/src/schema/core.yaml#L136
  3. Using mappings: https://linkml.io/linkml/schemas/uris-and-mappings.html#mappings e.g. https://github.com/biolink/biolink-model/blob/197b1ec15c5fab0574c2fbbf1dc8feb884d134c2/biolink-model.yaml#L889