Skip to content

vemonet/semanticscience-model

Repository files navigation

🔬 SemanticScience Integrated Ontology

Build and publish SIO model

The Semanticscience Integrated Ontology (SIO) provides a simple, integrated ontology of types and relations for rich description of objects, processes and their attributes.

This repository uses the LinkML modelling language to implement the SIO ontology.

The LinkML model for SIO is defined in model/sio-model.yaml

📖 The documentation generated by LinkML is available at https://vemonet.github.io/semanticscience-model

📥️ Install

Requirement: Python >= 3.7

Pipenv is required to build the files from the LinkML models:

pip install pipenv

Install LinkML with pipenv:

pipenv install linkml

Make sure the make command is available, on Debian/Ubuntu you can install it with:

sudo apt-get install -y build-essential

📦️ Build model files

Generate all artefacts from the YAML model in the semanticscience_model folder (OWL, SHACL, ShEx, JSON-LD context, Python classes...):

make

Generate a specific artefact, for example with SHACL, and ignore the cache:

make gen-shacl -B

Generate the model documentation in the docs folder:

make docs

Clean the target folder:

make clean

Check the Makefile file if you need to make changes to the process.

💬 Autocomplete for the model YAML

For VisualStudio Code users: you can add autocomplete and validation for LinkML model files in VisualStudio Code easily with the YAML extension from RedHat.

  1. Go to VisualStudio Code, and open the Command Palette in the View menu, or with Ctrl+Shift+P

  2. Search for Open Settings (JSON)

  3. Then add the following lines to the settings.json :

    "yaml.schemas": {
  "https://raw.githubusercontent.com/vemonet/semanticscience-model/master/resources/linkml.schema.json": ["model/*-model.yml"],
    }

🔧 Use a custom LinkML installation

You might want to bring improvements to the LinkML schema generation and use this new version. To do so, clone the LinkML repo in the parent directory of semanticscience-model, and install LinkML from this repository:

cd ..
git clone https://github.com/linkml/linkml
cd semanticscience-model
pipenv install ../linkml

🦉 Convert OWL to LinkML

⚠️ Work in progress, not all SIO has been defined in this LinkML model, we are still missing:

  • Data Properties and Annotation Properties
  • Advanced semantic such as inverse or symmetric

Go to the owl_to_linkml folder, and install the dependencies to convert OWL to LinkML:

cd owl_to_linkml
pip install -r requirements.txt

Then run the notebook owl_to_linkml.ipynb

Note: a similar work has been done to convert OWL directly to RML https://github.com/oeg-dataintegration/owl2rml

🔗 Links

LinkML docs: https://linkml.io/linkml/intro/tutorial01.html

LinkML template repo: https://github.com/linkml/linkml-model-template

Example LinkML model: https://github.com/biolink/biolink-model