An open API service indexing awesome lists of open source software.

https://github.com/vemonet/semanticscience-model

LinkML model for the SemanticScience Integrated Ontology
https://github.com/vemonet/semanticscience-model

knowledge-graph ontology owl-ontology semanticscience shacl shex

Last synced: 3 months ago
JSON representation

LinkML model for the SemanticScience Integrated Ontology

Awesome Lists containing this project

README

        

# 🔬 SemanticScience Integrated Ontology

[![Build and publish SIO model](https://github.com/vemonet/semanticscience-model/actions/workflows/main.yaml/badge.svg)](https://github.com/vemonet/semanticscience-model/actions/workflows/main.yaml)

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](https://github.com/linkml/linkml) modelling language to implement the [SIO ontology](https://semanticscience.org).

The LinkML model for SIO is defined in [`model/sio-model.yaml`](https://github.com/vemonet/semanticscience-model/blob/main/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:

```bash
pip install pipenv
```

Install LinkML with `pipenv`:

```bash
pipenv install linkml
```

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

```bash
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...):

```bash
make
```

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

```bash
make gen-shacl -B
```

Generate the model documentation in the `docs` folder:

```bash
make docs
```

Clean the `target` folder:

```bash
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](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml).

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` :

```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:

```bash
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:

```bash
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