Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.2
container: obolibrary/odkfull:v1.6

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run ontology QC checks
env:
Expand Down
77 changes: 60 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,83 @@
/site
build
src/ontology/pato.json
src/ontology/pato.obo
src/ontology/pato.owl
src/ontology/pato_ext.owl
pato_ext.json
.DS_Store
src/ontology/simple_seed.txt.tmp
# ODK-managed rules, do not modify
# If you need to add your own ignore rules, you may do so below
# the "End ODK-managed rules" marker at the end of this file.
.DS_Store
semantic.cache
bin/

*.tmp
*.tmp.obo
*.tmp.owl
*.tmp.json
*-relation-graph.tsv.gz
.template.db

.github/token.txt

/pato.owl
/pato.obo
/pato.json
/pato.db
/pato-base.*
/pato-basic.*
/pato-full.*
/pato-simple.*
/pato-simple-non-classified.*
/mappings/
/patterns/
/reports/
/subsets/

src/ontology/mirror
src/ontology/mirror/*
src/ontology/reports/*
!src/ontology/reports/release-diff.md
src/ontology/pato.owl
src/ontology/pato.obo
src/ontology/pato.json
src/ontology/pato.db
src/ontology/pato-base.*
src/ontology/pato-basic.*
src/ontology/pato-full.*
src/ontology/pato-simple.*
src/ontology/pato-simple-non-classified.*
semantic.cache
bin/

src/ontology/seed.txt
src/ontology/target/
src/ontology/dosdp-tools.log
src/patterns/imports/seed_sorted.txt
src/ontology/ed_definitions_merged.owl
src/ontology/patterns
*.tmp.obo
*.tmp.owl
src/ontology/ontologyterms.txt
src/ontology/simple_seed.txt
src/ontology/patterns
src/ontology/merged-pato-edit.owl
src/ontology/pato-edit.properties

src/ontology/target/
src/ontology/tmp/*
!src/ontology/tmp/.gitkeep
!src/ontology/tmp/README.md

src/ontology/run.sh.conf
src/ontology/run.sh.env

src/ontology/imports/*_terms_combined.txt

src/patterns/data/**/*.ofn
src/patterns/data/**/*.txt
src/patterns/pattern_owl_seed.txt
src/patterns/all_pattern_terms.txt

# End of ODK-managed rules
/site
build
src/ontology/pato_ext.owl
pato_ext.json
src/ontology/simple_seed.txt.tmp
src/patterns/imports/seed_sorted.txt
src/ontology/pato-edit-donotedit.owl
src/ontology/pato_ext-no-imports.owl
src/ontology/tmp/pre_seed.txt
src/ontology/tmp/merged-pato-edit.obo
src/ontology/tmp
site/contributing/index.html
src/ontology/imports/*_terms_combined.txt
src/ontology/imports/*_terms_pre_combined.txt
.vscode/*
28 changes: 28 additions & 0 deletions docs/odk-workflows/ManageAutomatedTest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Constraint violation checks

We can define custom checks using [SPARQL](https://www.w3.org/TR/rdf-sparql-query/). SPARQL queries define bad modelling patterns (missing labels, misspelt URIs, and many more) in the ontology. If these queries return any results, then the build will fail. Custom checks are designed to be run as part of GitHub Actions Continuous Integration testing, but they can also run locally.

### Steps to add a constraint violation check:

1. Add the SPARQL query in `src/sparql`. The name of the file should end with `-violation.sparql`. Please give a name that helps to understand which violation the query wants to check.
2. Add the name of the new file to odk configuration file `src/ontology/uberon-odk.yaml`:
1. Include the name of the file (without the `-violation.sparql` part) to the list inside the key `custom_sparql_checks` that is inside `robot_report` key.
1. If the `robot_report` or `custom_sparql_checks` keys are not available, please add this code block to the end of the file.

``` yaml
robot_report:
release_reports: False
fail_on: ERROR
use_labels: False
custom_profile: True
report_on:
- edit
custom_sparql_checks:
- name-of-the-file-check
```
3. Update the repository so your new SPARQL check will be included in the QC.

```shell
sh run.sh make update_repo
```

17 changes: 8 additions & 9 deletions docs/odk-workflows/RepositoryFileStructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ These are the current imports in PATO

| Import | URL | Type |
| ------ | --- | ---- |
| ro | http://purl.obolibrary.org/obo/ro.owl | None |
| chebi | https://raw.githubusercontent.com/obophenotype/chebi_obo_slim/main/chebi_slim.owl | None |
| go | http://purl.obolibrary.org/obo/go.owl | None |
| pco | http://purl.obolibrary.org/obo/pco.owl | None |
| uberon | http://purl.obolibrary.org/obo/uberon.owl | None |
| cl | http://purl.obolibrary.org/obo/cl.owl | None |
| ncbitaxon | http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.owl | None |
| pr | https://raw.githubusercontent.com/obophenotype/pro_obo_slim/master/pr_slim.owl | None |

| ro | http://purl.obolibrary.org/obo/ro.owl | slme |
| chebi | http://purl.obolibrary.org/obo/upheno/chebi_slim.owl | slme |
| go | http://purl.obolibrary.org/obo/go.owl | slme |
| pco | http://purl.obolibrary.org/obo/pco.owl | slme |
| uberon | http://purl.obolibrary.org/obo/uberon.owl | slme |
| cl | http://purl.obolibrary.org/obo/cl.owl | slme |
| ncbitaxon | http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.owl | slme |
| pr | https://raw.githubusercontent.com/obophenotype/pro_obo_slim/master/pr_slim.owl | slme |
## Components
Components, in contrast to imports, are considered full members of the ontology. This means that any axiom in a component is also included in the ontology base - which means it is considered _native_ to the ontology. While this sounds complicated, consider this: conceptually, no component should be part of more than one ontology. If that seems to be the case, we are most likely talking about an import. Components are often not needed for ontologies, but there are some use cases:

Expand Down
43 changes: 27 additions & 16 deletions docs/odk-workflows/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,46 @@ components:
- filename: your-component-name.owl
```

3) Add the component to your catalog file (src/ontology/catalog-v001.xml)
3) Refresh your repo by running `sh run update_repo`. This will automatically (1) create a new file in `src/ontology/components/`, (2) update the `-edit` file so that it imports `http://purl.obolibrary.org/obo/pato/components/your-component-name.owl` (the IRI of your new component), and (3) update the XML catalog file (`src/ontology/catalog-v001.xml`) to redirect that IRI to the file in the `src/ontology/components` directory, so that the new component can be found by tools such as Protégé or ROBOT, when they load the `-edit` file.

If your component is to be generated by some automated process, add a goal in your custom Makefile (`src/ontology/pato.Makefile`) and make it perform any task needed to generate the component:

```
<uri name="http://purl.obolibrary.org/obo/pato/components/your-component-name.owl" uri="components/your-component-name.owl"/>
$(COMPONENTSDIR)/your-component-name.owl: $(SRC)
<Insert here the code to produce the component>
```

4) Add the component to the edit file (src/ontology/pato-edit.obo)
for .obo formats:
If the component is to be generated from a ROBOT template, the ODK can generate the appropriate code for you. For that, when adding the component fo the ODK configuration file (step 2 above), explicitly indicate that the component should be derived from template(s) and list the source templates:

```
import: http://purl.obolibrary.org/obo/pato/components/your-component-name.owl
components:
products:
- filename: your-component-name.owl
use_template: true
templates:
- template1.tsv
- template2.tsv
```

for .owl formats:
In this example, the component will be derived from the templates found in `src/templates/template1.tsv` and `src/templates/template2.tsv`. Initial empty templates will automatically be generated when the repository is refreshed (step 3).

Likewise, the ODK can generate the required code for the case where the component is to be derived from SSSOM mappings:

```
Import(<http://purl.obolibrary.org/obo/pato/components/your-component-name.owl>)
components:
products:
- filename: your-component-name.owl
use_mappings: true
mappings:
- my-mappings.sssom.tsv
```

5) Refresh your repo by running `sh run.sh make update_repo` - this should create a new file in src/ontology/components.
6) In your custom makefile (src/ontology/pato.Makefile) add a goal for your custom make file. In this example, the goal is a ROBOT template.
and for the case where the component is to be fetched from a remote resource:

```
$(COMPONENTSDIR)/your-component-name.owl: $(SRC) ../templates/your-component-template.tsv
$(ROBOT) template --template ../templates/your-component-template.tsv \
annotate --ontology-iri $(ONTBASE)/$@ --output $(COMPONENTSDIR)/your-component-name.owl
components:
products:
- filename: your-component-name.owl
source: https://example.org/component-source.owl
```

(If using a ROBOT template, do not forget to add your template tsv in src/templates/)

7) Make the file by running `sh run.sh make components/your-component-name.owl`

Loading