Skip to content

Commit b7642d3

Browse files
Apply changes made on OBOFoundry.github.io (#141)
* Remove 'and usages' from tracker check This commit was supposed to be added in this repo. Ref commit: 9c3d971f79d1492e2bc50f1585e3586864bd2ecf * fix 'license' typos in fp_001.py This commit was supposed to be done here. Ref commit a182e0e57335042c03b0a23f5a6d74db07a96c6b * fix typo in fp_007.py This commit was supposed to be done here. Ref commit 8fd395bb03c18bc49114b405574b5719ef1539b7 * Apply prettier This commit was supposed to be done here. Ref commit ebc2d0935b3de55076ec61c5a6e4be7cd279c7de * Fix typo on util/dashboard/fp_006.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix typo on util/dashboard/fp_009.py * fix typo on util/dashboard/fp_006.py * Enhance HTTP status code documentation. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Documenting error thresholds Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Enhance implementation documentation --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ea99dd2 commit b7642d3

13 files changed

+93
-26
lines changed

util/dashboard/fp_001.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,37 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1019).
66
##
77
##### Requirements
8+
##
89
## 1. The ontology **must** have a license both in the registry data and in the ontology file.
9-
## 2. The licenese **must** be the same in both files.
10-
## 3. The license *should* be one of the CC0 or CC-BY licenses.
10+
## 2. The license **must** be the same in both files.
11+
## 3. The license _should_ be one of the CC0 or CC-BY licenses.
1112
##
1213
## ### Fixes
1314
##
1415
## #### Choosing a license
16+
##
1517
## See [Open Recommendations](http://obofoundry.org/principles/fp-001-open.html#recommendations) for appropriate licenses.
1618
##
1719
## #### Adding a license to the registry data
20+
##
1821
## First, read the [FAQ](http://obofoundry.github.io/faq/how-do-i-edit-metadata.html) on how to edit the metadata for your ontology. Then, add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with the correct license and license label):
22+
##
1923
## ```
2024
## license:
2125
## url: http://creativecommons.org/licenses/by/4.0/
2226
## label: CC-BY 4.0
2327
## ```
2428
##
2529
## #### Adding a license to the ontology file
30+
##
2631
## See [Open Implementation](http://obofoundry.org/principles/fp-001-open.html#implementation) for details on adding license to OWL and OBO files.
2732
##
2833
## ### Implementation
34+
##
2935
## The registry data entry is validated with JSON schema using the [license schema](https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/util/schema/license.json). The license schema ensures that a license entry is present and that the entry has a `url` and `label`. The license schema also checks that the license is one of the CC0 or CC-BY licenses. OWL API is then used to check the ontology as an `OWLOntology` object. Annotations on the ontology are retrieved and the `dcterms:license` property is found. The python script ensures that the correct `dcterms:license` property is used. The script compares this license to the registry license to ensure that they are the same.
3036

31-
import jsonschema
3237
import dash_utils
38+
import jsonschema
3339

3440

3541
def is_open(ontology, data, schema):
@@ -293,7 +299,7 @@ def compare_licenses(registry_license, ontology_license):
293299
ontology_license (str): license URL from the ontology
294300
295301
Return:
296-
True if registry license matches ontology licences;
302+
True if registry license matches ontology license;
297303
False if the licenses do not match;
298304
None if one or both licenses are missing.
299305
"""
@@ -369,7 +375,7 @@ def process_results(registry_license,
369375
level = 'ERROR'
370376
issues.append(missing_ontology_license)
371377

372-
# matches_ontology = None if missing ontology licenese
378+
# matches_ontology = None if missing ontology license
373379
if matches_ontology is False:
374380
level = 'ERROR'
375381
issues.append(no_match.format(ontology_license, registry_license))

util/dashboard/fp_002.py

+3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1018).
66
##
77
## ### Requirements
8+
##
89
## 1. Released ontology **must** be in RDF/XML format
910
##
1011
## ### Fixes
12+
##
1113
## See the [Common Format Recommendations](http://obofoundry.org/principles/fp-002-format.html#recommendations). [ROBOT](http://robot.obolibrary.org/convert) offers functionality to convert a variety of formats, including OBO, to RDF/XML. Protégé allows you to save ontologies in RDF/XML, as well. The [Ontology 101 Tutorial](https://ontology101tutorial.readthedocs.io/en/latest/StartingProtege.html) has directions on starting and saving in Protégé.
1214
##
1315
## ### Implementation
16+
##
1417
## Current implementation attempts to load the ontology using OWL API. If the ontology is loaded, it is assumed that it is in a good format, although it may not be RDF/XML. For large ontologies, the ontology is a valid format (either RDF/XML or Turtle) if it can be [loaded with Jena](http://robot.obolibrary.org/query#executing-on-disk) to run the ROBOT report over.
1518

1619
import dash_utils

util/dashboard/fp_003.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1017).
66
##
77
## ### Requirements
8+
##
89
## 1. All entities in the ontology namespace **must** use an underscore to separate the namespace and local ID.
9-
## 2. The local ID *should* not be semantically significant, and *should* be numeric.
10+
## 2. The local ID _should_ not be semantically significant, and _should_ be numeric.
1011
##
1112
## ### Fixes
13+
##
1214
## Edit problematic IRIs to resolve the problems. [Click here](https://ontology101tutorial.readthedocs.io/en/latest/EntitiesTab.html#renaming-an-entity) for details on editing an IRI in Protégé.
1315
##
1416
## The full OBO Foundry ID Policy can be found [here](http://www.obofoundry.org/id-policy). In short, all IRIs should begin with your unique OBO Foundry namespace (e.g., `http://purl.obolibrary.org/obo/OBI_`). The local ID, which comes after the unique namespace, should be numeric (e.g., `http://purl.obolibrary.org/obo/OBI_0000001`). We recommend using seven digits.
1517
##
1618
## #### Updating an IRI
19+
##
1720
## 1. Add an `owl:deprecated` annotation with a boolean value of `true` to the problematic term
1821
## 2. Add `obsolete` to the beginning of the term's label to prevent duplicating labels
1922
## 3. Create a new term with a valid IRI to replace this old term
2023
## 4. Copy the old annotations (label, definition, etc., excluding the `owl:deprecated`) over to the new term
2124
## 5. Add a [`IAO:0100001` (term replaced by)](http://purl.obolibrary.org/obo/IAO_0100001) annotation to the old term with a value of the new term's IRI
22-
## * Make sure this is an IRI annotation by selecting "IRI Editor" when adding the annotation in Protégé
25+
## - Make sure this is an IRI annotation by selecting "IRI Editor" when adding the annotation in Protégé
2326
##
2427
## ### Implementation
28+
##
2529
## All entity IRIs are retrieved from the ontology, excluding annotation properties. Annotation properties may use hashtags and words due to legacy OBO conversions for subset properties. All other IRIs are checked if they are in the ontology's namespace. If the IRI begins with the ontology namespace, the next character must be an underscore. If not, this is an error. The IRI is also compared to a regex pattern to check if the local ID after the underscore is numeric. If not, this is a warning.
2630

27-
import dash_utils
2831
import os
2932
import re
3033

34+
import dash_utils
35+
3136
iri_pattern = r'http:\/\/purl\.obolibrary\.org\/obo\/%s_[0-9]{1,9}'
3237
owl_deprecated = 'http://www.w3.org/2002/07/owl#deprecated'
3338

util/dashboard/fp_004.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,35 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1016).
66
##
77
## ### Requirements
8+
##
89
## 1. The released ontology **must** have a version IRI.
9-
## 2. The version IRI *should* follow a dated format (`NS/YYYY-MM-DD/ontology.owl`)
10+
## 2. The version IRI _should_ follow a dated format (`NS/YYYY-MM-DD/ontology.owl`)
1011
##
1112
## ### Fixes
13+
##
1214
## First, make sure you have a valid version IRI pattern. See [Versioning Implementation](http://obofoundry.org/principles/fp-004-versioning.html#implementation) for more details.
1315
##
1416
## #### Adding a Version IRI in Protégé
17+
##
1518
## The "Ontology Version IRI" input is located in the "Active Ontology" tab that appears when you open your ontology in Protégé.
1619
##
1720
## #### Adding a Version IRI with ROBOT
21+
##
1822
## You may use the [ROBOT annotate](http://robot.obolibrary.org/annotate) command the add a version IRI.
1923
##
2024
## Please be aware that the [Ontology Development Kit](https://github.com/INCATools/ontology-development-kit) comes standard with a release process that will automatically generate a dated version IRI for your ontology release.
2125
##
2226
## ### Implementation
27+
##
2328
## The version IRI is retrieved from the ontology using OWL API. For very large ontologies, the RDF/XML ontology header is parsed to find the owl:versionIRI declaration. If found, the IRI is compared to a regex pattern to determine if it is in date format. If it is not in date format, a warning is issued. If the version IRI is not present, this is an error.
2429

30+
import re
2531
from typing import Optional
2632
from urllib.parse import urlparse
2733

2834
import dash_utils
29-
import re
3035
from lib import url_exists
3136

32-
3337
# regex pattern to match purl obolibrary url
3438
pat = r'http:\/\/purl\.obolibrary\.org/obo/.*/.*/.*'
3539
PATTERN = re.compile(pat)

util/dashboard/fp_005.py

+4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1015).
66
##
77
## ### Requirements
8+
##
89
## 1. A scope ('domain') **must** be declared in the registry data
910
##
1011
## ### Fixes
12+
##
1113
## First, read the [FAQ](http://obofoundry.github.io/faq/how-do-i-edit-metadata.html) on how to edit the metadata for your ontology. Then, add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with your domain):
14+
##
1215
## ```
1316
## domain: experiments
1417
## ```
1518
##
1619
## ### Implementation
20+
##
1721
## First, the registry data is checked for a 'domain' tag. If missing, that is an error. If it is present, the domain is compared to all other ontology domains. If the ontology shares a domain with one or more other ontologies, we return a list of those ontologies in an info message.
1822

1923
import dash_utils

util/dashboard/fp_006.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,31 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1010).
66
##
77
## ### Requirements
8+
##
89
## 1. Each definition **must** be unique.
910
## 2. Each entity **must** not have more than one textual definition.
10-
## 3. Each entity *should* have a textual definition using [`IAO:0000115` (definition)](http://purl.obolibrary.org/obo/IAO_0000115).
11+
## 3. Each entity _should_ have a textual definition using [`IAO:0000115` (definition)](http://purl.obolibrary.org/obo/IAO_0000115).
1112
##
1213
## ### Fixes
1314
##
1415
## #### Uniqueness
16+
##
1517
## Update each duplicate definition to have some detail that differentiates one term from another.
1618
##
1719
## #### Multiples
20+
##
1821
## If a term has more than one defintion, combine the two definitions. Alternatively, change one definition to an `rdfs:comment` if it just contains further details.
1922
##
2023
## #### Missing Definitions
24+
##
2125
## Add an [`IAO:0000115` (definition)](http://purl.obolibrary.org/obo/IAO_0000115) annotation to each term that is missing a definition. For help writing good definitions, see [Textual Definitions Recommendations](http://obofoundry.org/principles/fp-006-textual-definitions.html#recommendation).
2226
##
23-
## For adding defintions in bulk, check out [ROBOT template](http://robot.obolibrary.org/template).
27+
## For adding definitions in bulk, check out [ROBOT template](http://robot.obolibrary.org/template).
2428
##
2529
## ### Implementation
26-
## [ROBOT report](http://robot.obolibrary.org/report) is run over the ontology. A count of violations for each of the following checks is retrieved from the report object: [duplicate definition](http://robot.obolibrary.org/report_queries/duplicate_definition), [multiple definitions](http://robot.obolibrary.org/report_queries/multiple_definitions), and [missing definition](http://robot.obolibrary.org/report_queries/missing_definition). If there are any duplicate or multiple defintions, it is an error. If there are missing definitions, it is a warning.
30+
##
31+
## [ROBOT report](http://robot.obolibrary.org/report) is run over the ontology. A count of violations for each of the following checks is retrieved from the report object: [duplicate definition](http://robot.obolibrary.org/report_queries/duplicate_definition), [multiple definitions](http://robot.obolibrary.org/report_queries/multiple_definitions), and [missing definition](http://robot.obolibrary.org/report_queries/missing_definition). If there are any duplicate or multiple definitions, it is an error. If there are missing definitions, it is a warning.
32+
## Note: Even a single duplicate or multiple definition will result in an error status, while missing definitions will only trigger a warning status regardless of count.
2733

2834
import dash_utils
2935
from dash_utils import format_msg

util/dashboard/fp_007.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,33 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/981).
66
##
77
## ### Requirements
8+
##
89
## 1. The ontology **must not** duplicate existing RO properties.
9-
## 2. The ontology *should* use existing RO properties, rather than creating new propeties.
10+
## 2. The ontology _should_ use existing RO properties, rather than creating new properties.
1011
##
1112
## ### Fixes
1213
##
1314
## #### Duplicated Properties
15+
##
1416
## 1. Add an `owl:deprecated` annotation with a boolean value of `true` to the problematic property in your ontology
1517
## 2. Add `obsolete` to the beginning of the property's label
1618
## 3. Replace all usages of that property with the duplicated RO property
1719
##
1820
## #### Non-RO Properties
21+
##
1922
## Review your non-RO properties to see if any can be replaced with an RO property using the steps above. Often, a corresponding property will not exist in RO and that is OK.
2023
##
2124
## ### Implementation
25+
##
2226
## The object and data properties from the ontology are compared to existing RO properties. If any labels match existing RO properties, but do not use the correct RO IRI, this is an error. Any non-RO properties (no label match and do not use an RO IRI) will be listed as INFO messages.
2327

2428
import csv
25-
import dash_utils
2629
import os
2730
import unicodedata
28-
2931
from io import TextIOWrapper
3032

33+
import dash_utils
34+
3135
owl_deprecated = 'http://www.w3.org/2002/07/owl#deprecated'
3236

3337
# Violation messages

util/dashboard/fp_008.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,41 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1009).
66
##
77
## ### Requirements
8+
##
89
## 1. The ontology **must** have a homepage.
910
## 2. The homepage URL **must** resolve.
1011
## 3. The ontology **must** have a description.
1112
##
1213
## ### Fixes
14+
##
1315
## First, read the [FAQ](http://obofoundry.github.io/faq/how-do-i-edit-metadata.html) on how to edit the metadata for your ontology.
1416
##
1517
## #### Adding or Updating a Homepage
18+
##
1619
## Add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with your homepage, which may just be your GitHub repository):
20+
##
1721
## ```
1822
## homepage: http://obi-ontology.org
1923
## ```
24+
##
2025
## If your homepage is not resolving, determine why (Is the server down? Is the URL wrong?) and update your homepage URL if needed.
2126
##
2227
## #### Adding a Description
28+
##
2329
## Add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with a short description about your ontology):
30+
##
2431
## ```
2532
## description: An integrated ontology for the description of life-science and clinical investigations
2633
## ```
2734
##
2835
## ### Implementation
29-
## The registry data is checked for 'homepage' and 'description' entries. If either is missing, this is an error. If the homepage is present, the URL is checked to see if it resolves (does not return an HTTP status of greater than 400). If the URL does not resolve, this is also an error.
36+
##
37+
## The registry data is checked for 'homepage' and 'description' entries. If either is missing, this is an error. If the homepage is present, the URL is checked to see if it returns a successful HTTP status code (200-299) rather than an error code (400+). If the URL does not resolve, this is also an error.
3038

3139

3240
from lib import url_exists
3341

42+
3443
def has_documentation(data):
3544
"""Check fp 8 - documentation.
3645

util/dashboard/fp_009.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1008).
66
##
77
## ### Requirements
8+
##
89
## 1. The ontology **must** have a tracker.
910
## 2. The ontology **must** have usages.
1011
##
1112
## ### Fixes
13+
##
1214
## First, read the [FAQ](http://obofoundry.github.io/faq/how-do-i-edit-metadata.html) on how to edit the metadata for your ontology.
1315
##
1416
## #### Adding a Tracker
17+
##
1518
## If you do not already have a version control repository that has an [Issues Tracker](https://help.github.com/en/github/managing-your-work-on-github/about-issues), create one. We recommend creating a [GitHub Repository](https://help.github.com/en/github/getting-started-with-github/create-a-repo). To do this, you will need to [create a GitHub account](https://github.com/join) if you do not already have one.
1619
##
1720
## Once you have a version control repository, add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with the link to your repository's issue tracker):
21+
##
1822
## ```
1923
## tracker: https://github.com/DiseaseOntology/HumanDiseaseOntology/issues
2024
## ```
2125
##
2226
## #### Adding Usages
27+
##
2328
## Determine what other groups are using your ontology and how they are using it. Then, add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with the correct group name, link, and description):
29+
##
2430
## ```
2531
## usages:
2632
## - user: http://www.informatics.jax.org/disease (link to group)
@@ -29,10 +35,12 @@
2935
## - url: http://www.informatics.jax.org/disease/DOID:4123 (link to specific example)
3036
## description: Human genes and mouse homology associated with nail diseases (description of specific example)
3137
## ```
32-
## You may have multiple exampels for each user, and mulitple users under the `usages` tag.
38+
##
39+
## You may have multiple examples for each user, and multiple users under the `usages` tag.
3340
##
3441
## ### Implementation
35-
## The registry data is checked for 'tracker' and 'usage' entries. If either is missing, this is an error.
42+
##
43+
## The registry data is checked for 'tracker' and 'usage' entries. If either is missing, this is an error. The tracker should be a valid URL to an issue tracking system, and usages should contain at least one user with a valid URL and description.
3644

3745
import dash_utils
3846
from dash_utils import format_msg

util/dashboard/fp_011.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
## Discussion on this check can be [found here](https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1007).
66
##
77
## ### Requirements
8+
##
89
## 1. The ontology **must** have a single contact person
910
##
1011
## ### Fixes
12+
##
1113
## First, read the [FAQ](http://obofoundry.github.io/faq/how-do-i-edit-metadata.html) on how to edit the metadata for your ontology.
1214
##
1315
## Next, determine who the point person for your ontology project is. This *must not* be a mailing list. If this person does not already have a GitHub account, we request that they [create one](https://github.com/join). Then, add the following to your [metadata file](https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology) (replacing with the correct email, name, and GitHub username):
16+
##
1417
## ```
1518
## contact:
1619
@@ -19,13 +22,14 @@
1922
## ```
2023
##
2124
## ### Implementation
25+
##
2226
## The registry data entry is validated with JSON schema using the [contact schema](https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/util/schema/contact.json). The contact schema ensures that a contact entry is present and that the entry has a name and email address.
2327

24-
import jsonschema
25-
2628
import dash_utils
29+
import jsonschema
2730
from dash_utils import format_msg
2831

32+
2933
def has_contact(data, contact_schema):
3034
"""Check fp 11 - locus of authority.
3135

0 commit comments

Comments
 (0)