Metadata-Version: 2.1
Name: relation-validator
Version: 0.2.0
Summary: This package validates a list of relationships between two terms against the specified ontologies.
Home-page: https://github.com/anitacaron/relation-validator
Author: Anita Caron
Author-email: anitac@ebi.ac.uk
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: oaklib (>=0.5.0,<0.6.0)
Requires-Dist: pandas (>=1.5.3,<2.0.0)
Requires-Dist: pyaml (>=21.10.1,<22.0.0)
Requires-Dist: ruamel-yaml (>=0.17.21,<0.18.0)
Project-URL: Repository, https://github.com/anitacaron/relation-validator
Description-Content-Type: text/markdown

# Relationship validator

Validation process using [Ubergraph](https://zenodo.org/record/7249759#.ZDRuZOzML1c) as source of truth.

Ubergraph is an RDF triplestore with [39 OBO ontologies](https://github.com/INCATools/ubergraph#integrated-obo-ontology-triplestore) merged, precomputed OWL classification and materialized class relationship from existential properties restriction.


## Install

```bash
pip install relation-validator
```

## Configure YAML file

In the config file, it is defined the list of relationships the validation should run on. The order is essential.

The yaml file needs to have the keys `relationships` and `filename`. Check an example below:

```yaml
relationships:
  sub_class_of: rdfs:subClassOf
  part_of: BFO:0000050
  connected_to: RO:0001025
  has_soma_location: RO:0002100
  ...

filename: path/to/filename.csv
```

The filename should have the following columns:

| s                   | slabel                                | user_slabel                               | o                  | olabel                                | user_olabel                               |
|---------------------|---------------------------------------|-------------------------------------------|--------------------|---------------------------------------|-------------------------------------------|
| the subject term ID | the label of the term in the column s | optional label for the term given by user | the object term ID | the label of the term in the column s | optional label for the term given by user |

## Run relation-validator CLI

```bash
relation-validator validate --input path/to/config.yaml --output path/to/output.csv
```

The `output.csv` file will be in the same format as the `filename.csv`. It will return the cases where a triple (subject, relationship, object) with the relationships listed in the yaml file was not found in Ubergraph.

## List of ontologies available

To know which ontologies and their version are available in Ubergraph, use the following CLI:

```bash
relation-validator ontologies_version --output filename.json
```
