Skip to content

Commit

Permalink
Add datatype QC for annotations related to date (#2066)
Browse files Browse the repository at this point in the history
* add datetime datatype QC

* replace string to datetime in date related properties

* update illegal date violation from ODK 1.5

* replace string to datetime on date related annotations

---------

Co-authored-by: Anita Caron <[email protected]>
  • Loading branch information
Anita Caron and anitacaron authored May 21, 2024
1 parent b0a0af1 commit 7990aa5
Show file tree
Hide file tree
Showing 7 changed files with 2,686 additions and 2,641 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- name: Run ontology QC checks
env:
DEFAULT_BRANCH: master
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false

2 changes: 0 additions & 2 deletions docs/odk-workflows/ManageDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ The documentation is _not_ automatically updated from the Markdown, and needs to
3. Just to double check, you can now navigate to your documentation pages (usually https://obophenotype.github.io/cell-ontology/).
Just make sure you give GitHub 2-5 minutes to build the pages!



4 changes: 2 additions & 2 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# More information: https://github.com/INCATools/ontology-development-kit/

# Fingerprint of the configuration file when this Makefile was last generated
CONFIG_HASH= 3ef44073feb4dd21f093356b564a51bd94638e4a757ed43c0c9ff69e9599cac2
CONFIG_HASH= 8b5b779b91f8bb931caf3512d6c7fcb325ef83bafc7ba409b86058a9dae7f67f


# ----------------------------------------
Expand Down Expand Up @@ -44,7 +44,7 @@ REPORT_FAIL_ON = ERROR
REPORT_LABEL =
REPORT_PROFILE_OPTS =
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference nolabels pmid-not-dbxref obsolete-replaced_by obsolete-alt-id orcid-contributor illegal-annotation-property label-synonym-polysemy
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference nolabels pmid-not-dbxref obsolete-replaced_by obsolete-alt-id orcid-contributor illegal-annotation-property label-synonym-polysemy illegal-date
SPARQL_EXPORTS = basic-report
ODK_VERSION_MAKEFILE = v1.5

Expand Down
5,285 changes: 2,649 additions & 2,636 deletions src/ontology/cl-edit.owl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ontology/cl-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ robot_report:
- orcid-contributor
- illegal-annotation-property
- label-synonym-polysemy
- illegal-date
custom_sparql_exports :
- basic-report
components:
Expand Down
12 changes: 12 additions & 0 deletions src/sparql/illegal-date-violation.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

SELECT DISTINCT ?term ?property ?value WHERE
{
VALUES ?property {dct:date dct:issued dct:created oboInOwl:creation_date}
?term ?property ?value .
FILTER (datatype(?value) != xsd:date || !regex(str(?value), '^\\d{4}-\\d\\d-\\d\\d$'))
FILTER (datatype(?value) != xsd:dateTime || !regex(str(?value), '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z'))
}

21 changes: 21 additions & 0 deletions src/sparql/replace_string_to_datetime.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>

DELETE {
?sub ?property ?value .
}

INSERT {
?sub ?property ?new_value.
}

WHERE {
VALUES ?property {dct:date dct:issued dct:created oboInOwl:creation_date}
?sub ?property ?value .
FILTER(Datatype(?value)!=xsd:dateTime)
BIND(STRDT(?value, xsd:dateTime) as ?new_value)
}

0 comments on commit 7990aa5

Please sign in to comment.