You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
+
5
+
### Steps to add a constraint violation check:
6
+
7
+
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.
8
+
2. Add the name of the new file to odk configuration file `src/ontology/uberon-odk.yaml`:
9
+
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.
10
+
1. If the `robot_report` or `custom_sparql_checks` keys are not available, please add this code block to the end of the file.
11
+
12
+
```yaml
13
+
robot_report:
14
+
release_reports: False
15
+
fail_on: ERROR
16
+
use_labels: False
17
+
custom_profile: True
18
+
report_on:
19
+
- edit
20
+
custom_sparql_checks:
21
+
- name-of-the-file-check
22
+
```
23
+
3. Update the repository so your new SPARQL check will be included in the QC.
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:
25
24
26
25
1. There is an automated process that generates and re-generates a part of the ontology
27
26
2. A part of the ontology is managed in ROBOT templates
28
27
3. The expressivity of the component is higher than the format of the edit file. For example, people still choose to manage their ontology in OBO format (they should not) missing out on a lot of owl features. They may choose to manage logic that is beyond OBO in a specific OWL component.
Copy file name to clipboardExpand all lines: docs/odk-workflows/components.md
+27-16Lines changed: 27 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,35 +14,46 @@ components:
14
14
- filename: your-component-name.owl
15
15
```
16
16
17
-
3) Add the component to your catalog file (src/ontology/catalog-v001.xml)
17
+
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 `https://nfdi4culture.de/ontology/cto/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.
18
+
19
+
If your component is to be generated by some automated process, add a goal in your custom Makefile (`src/ontology/cto.Makefile`) and make it perform any task needed to generate the component:
4) Add the component to the edit file (src/ontology/cto-edit.obo)
24
-
for .obo formats:
26
+
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:
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).
39
+
40
+
Likewise, the ODK can generate the required code for the case where the component is to be derived from SSSOM mappings:
0 commit comments