From ab4a5ed611e52c6f3e668f934526dfd573ac6d09 Mon Sep 17 00:00:00 2001 From: William Hogan Date: Sun, 22 Dec 2024 16:14:57 -0600 Subject: [PATCH] fixes #44 by making PATO import a separate ODK (filter) import. Making it an SLME import brought in too much stuff --- .github/workflows/qc.yml | 2 +- docs/odk-workflows/RepositoryFileStructure.md | 1 + src/ontology/Makefile | 22 ++++++- src/ontology/catalog-v001.xml | 2 +- src/ontology/dron-edit.owl | 24 +++++-- src/ontology/dron-odk.yaml | 4 ++ src/ontology/imports/apollo_sv_import.owl | 6 +- src/ontology/imports/bfo_import.owl | 6 +- src/ontology/imports/go_import.owl | 6 +- src/ontology/imports/iao_import.owl | 6 +- src/ontology/imports/obi_import.owl | 6 +- src/ontology/imports/ogms_import.owl | 6 +- src/ontology/imports/omo_import.owl | 6 +- src/ontology/imports/pato_import.owl | 66 +++++++++++++++++++ src/ontology/imports/pato_terms.txt | 2 + src/ontology/imports/ro_import.owl | 6 +- src/ontology/imports/uo_import.owl | 6 +- src/templates/external_import.tsv | 1 + 18 files changed, 141 insertions(+), 37 deletions(-) create mode 100644 src/ontology/imports/pato_import.owl create mode 100644 src/ontology/imports/pato_terms.txt diff --git a/.github/workflows/qc.yml b/.github/workflows/qc.yml index 2778e49..d17e4d2 100644 --- a/.github/workflows/qc.yml +++ b/.github/workflows/qc.yml @@ -29,5 +29,5 @@ jobs: - name: Run ontology QC checks env: DEFAULT_BRANCH: main - run: echo "DRON in its current form is too big for GitHub Actions" + run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false diff --git a/docs/odk-workflows/RepositoryFileStructure.md b/docs/odk-workflows/RepositoryFileStructure.md index 35315c7..397ddab 100644 --- a/docs/odk-workflows/RepositoryFileStructure.md +++ b/docs/odk-workflows/RepositoryFileStructure.md @@ -27,6 +27,7 @@ These are the current imports in DRON | omo | http://purl.obolibrary.org/obo/omo.owl | mirror | | chebi | http://purl.obolibrary.org/obo/chebi.owl | slme | | pr | http://purl.obolibrary.org/obo/pr.owl | slme | +| pato | http://purl.obolibrary.org/obo/pato.owl | filter | ## 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: diff --git a/src/ontology/Makefile b/src/ontology/Makefile index 7d7deb5..8526eaa 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -16,7 +16,7 @@ # 3. [Update repo to latest ODK](update_repo) # Fingerprint of the configuration file when this Makefile was last generated -CONFIG_HASH= 082560e7167e4c838bb11575d493a5b738d1886fb5b1721258c2e706584f371f +CONFIG_HASH= 19da4684159be042a50f7d4b9fa0ec9d7698d4c5d70529e63b99f62140d7e4a1 # ---------------------------------------- @@ -165,7 +165,7 @@ all_main: $(MAIN_FILES) # ---------------------------------------- -IMPORTS = ro apollo_sv go iao obi uo ogms bfo omo chebi pr +IMPORTS = ro apollo_sv go iao obi uo ogms bfo omo chebi pr pato IMPORT_ROOTS = $(patsubst %, $(IMPORTDIR)/%_import, $(IMPORTS)) IMPORT_OWL_FILES = $(foreach n,$(IMPORT_ROOTS), $(n).owl) @@ -425,6 +425,16 @@ $(IMPORTDIR)/pr_import.owl: $(MIRRORDIR)/pr.owl $(IMPORTDIR)/pr_terms_combined.t query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ $(ANNOTATE_CONVERT_FILE); fi +## Module for ontology: pato + +$(IMPORTDIR)/pato_import.owl: $(MIRRORDIR)/pato.owl $(IMPORTDIR)/pato_terms_combined.txt + if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \ + extract -T $(IMPORTDIR)/pato_terms_combined.txt --copy-ontology-annotations true --force true --method BOT \ + remove --base-iri http://purl.obolibrary.org/obo/PATO_ --axioms external --preserve-structure false --trim false \ + remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) --term rdfs:label --term IAO:0000115 -T $(IMPORTDIR)/pato_terms_combined.txt --select complement \ + query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \ + $(ANNOTATE_CONVERT_FILE); fi + .PHONY: refresh-imports refresh-imports: @@ -589,6 +599,14 @@ mirror-pr: endif +## ONTOLOGY: pato +.PHONY: mirror-pato +.PRECIOUS: $(MIRRORDIR)/pato.owl +mirror-pato: | $(TMPDIR) + curl -L $(OBOBASE)/pato.owl --create-dirs -o $(TMPDIR)/pato-download.owl --retry 4 --max-time 200 && \ + $(ROBOT) convert -i $(TMPDIR)/pato-download.owl -o $(TMPDIR)/$@.owl + + $(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR) if [ -f $(TMPDIR)/mirror-$*.owl ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." &&\ cp $(TMPDIR)/mirror-$*.owl $@; fi; fi diff --git a/src/ontology/catalog-v001.xml b/src/ontology/catalog-v001.xml index dd6d368..fd86edf 100644 --- a/src/ontology/catalog-v001.xml +++ b/src/ontology/catalog-v001.xml @@ -14,7 +14,7 @@ - + diff --git a/src/ontology/dron-edit.owl b/src/ontology/dron-edit.owl index e75c548..9a70c2b 100644 --- a/src/ontology/dron-edit.owl +++ b/src/ontology/dron-edit.owl @@ -20,6 +20,7 @@ Import() Import() Import() Import() +Import() Import() Import() Import() @@ -342,15 +343,15 @@ Declaration(AnnotationProperty( "has_alternative_id") -# Annotation Property: (has cross-reference) +# Annotation Property: (database_cross_reference) AnnotationAssertion(rdfs:label "database_cross_reference") -# Annotation Property: (has exact synonym) +# Annotation Property: (has_exact_synonym) AnnotationAssertion(rdfs:label "has_exact_synonym") -# Annotation Property: (has narrow synonym) +# Annotation Property: (has_narrow_synonym) AnnotationAssertion(rdfs:label "has_narrow_synonym") @@ -358,7 +359,7 @@ AnnotationAssertion(rdfs:label "has_obo_namespace") -# Annotation Property: (has related synonym) +# Annotation Property: (has_related_synonym) AnnotationAssertion(rdfs:label "has_related_synonym") @@ -454,7 +455,7 @@ SubClassOf( ObjectSomeValuesFrom( ObjectSomeValuesFrom( )) -# Class: (metaclazepam) +# Class: (Metaclazepam hydrochloride) SubClassOf( ObjectSomeValuesFrom( )) @@ -2061,6 +2062,7 @@ AnnotationAssertion( ) AnnotationAssertion( ) AnnotationAssertion( ) +SubClassOf( ) # Class: (protein binding) @@ -2106,6 +2108,11 @@ AnnotationAssertion( (datum label) AnnotationAssertion( ) +SubClassOf( ) + +# Class: (information content entity) + +SubClassOf( ) # Class: (planned process) @@ -2127,11 +2134,16 @@ AnnotationAssertion( ) -# Class: () +# Class: (mass) AnnotationAssertion( ) AnnotationAssertion( ) AnnotationAssertion( ) +SubClassOf( ) + +# Class: (unit) + +SubClassOf( ) ############################ diff --git a/src/ontology/dron-odk.yaml b/src/ontology/dron-odk.yaml index 5739837..283b055 100644 --- a/src/ontology/dron-odk.yaml +++ b/src/ontology/dron-odk.yaml @@ -49,6 +49,10 @@ import_group: module_type: slme is_large: TRUE use_gzipped: TRUE + - id: pato + module_type: filter + base_iris: + - http://purl.obolibrary.org/obo/PATO_ components: products: - filename: dron-ingredient.owl diff --git a/src/ontology/imports/apollo_sv_import.owl b/src/ontology/imports/apollo_sv_import.owl index b9d23d1..aff5438 100644 --- a/src/ontology/imports/apollo_sv_import.owl +++ b/src/ontology/imports/apollo_sv_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/bfo_import.owl b/src/ontology/imports/bfo_import.owl index 662fd84..caf242f 100644 --- a/src/ontology/imports/bfo_import.owl +++ b/src/ontology/imports/bfo_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/go_import.owl b/src/ontology/imports/go_import.owl index f85eb74..cef7cc7 100644 --- a/src/ontology/imports/go_import.owl +++ b/src/ontology/imports/go_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/iao_import.owl b/src/ontology/imports/iao_import.owl index 3f0d27e..3474fb5 100644 --- a/src/ontology/imports/iao_import.owl +++ b/src/ontology/imports/iao_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/obi_import.owl b/src/ontology/imports/obi_import.owl index 8b5eeac..3b42a43 100644 --- a/src/ontology/imports/obi_import.owl +++ b/src/ontology/imports/obi_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/ogms_import.owl b/src/ontology/imports/ogms_import.owl index aea2ba8..e42a240 100644 --- a/src/ontology/imports/ogms_import.owl +++ b/src/ontology/imports/ogms_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(AnnotationProperty()) diff --git a/src/ontology/imports/omo_import.owl b/src/ontology/imports/omo_import.owl index 8fd0e7e..dbcd8d2 100644 --- a/src/ontology/imports/omo_import.owl +++ b/src/ontology/imports/omo_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/pato_import.owl b/src/ontology/imports/pato_import.owl new file mode 100644 index 0000000..9e2c806 --- /dev/null +++ b/src/ontology/imports/pato_import.owl @@ -0,0 +1,66 @@ +Prefix(:=) +Prefix(owl:=) +Prefix(rdf:=) +Prefix(xml:=) +Prefix(xsd:=) +Prefix(rdfs:=) + + +Ontology( + +Annotation( ) +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") + +Declaration(Class()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +Declaration(AnnotationProperty()) +############################ +# Annotation Properties +############################ + +# Annotation Property: () + +SubAnnotationPropertyOf( ) + +# Annotation Property: () + +SubAnnotationPropertyOf( ) + +# Annotation Property: () + +SubAnnotationPropertyOf( ) + + + +############################ +# Classes +############################ + +# Class: (mass) + +AnnotationAssertion(Annotation( "PATOC:GVG") "A physical quality that inheres in a bearer by virtue of the proportion of the bearer's amount of matter.") +AnnotationAssertion( "quality") +AnnotationAssertion( "PATO:0000125") +AnnotationAssertion( ) +AnnotationAssertion( ) +AnnotationAssertion( ) +AnnotationAssertion(rdfs:comment "For any biological use of PATO, the concept that should be used is 'mass' and not 'weight'. For example, increased weight of an organism.") +AnnotationAssertion(rdfs:label "mass") + + +) \ No newline at end of file diff --git a/src/ontology/imports/pato_terms.txt b/src/ontology/imports/pato_terms.txt new file mode 100644 index 0000000..139597f --- /dev/null +++ b/src/ontology/imports/pato_terms.txt @@ -0,0 +1,2 @@ + + diff --git a/src/ontology/imports/ro_import.owl b/src/ontology/imports/ro_import.owl index cc005ba..980bc2c 100644 --- a/src/ontology/imports/ro_import.owl +++ b/src/ontology/imports/ro_import.owl @@ -7,10 +7,10 @@ Prefix(rdfs:=) Ontology( - + Annotation( ) -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/ontology/imports/uo_import.owl b/src/ontology/imports/uo_import.owl index 5c02f22..51266ab 100644 --- a/src/ontology/imports/uo_import.owl +++ b/src/ontology/imports/uo_import.owl @@ -7,9 +7,9 @@ Prefix(rdfs:=) Ontology( - -Annotation(rdfs:comment "This version of DrOn is current through RxNorm version 20AA_241202F") -Annotation(owl:versionInfo "2024-12-20") + +Annotation(rdfs:comment "This version of DrOn is current through RxNorm version ") +Annotation(owl:versionInfo "2024-12-22") Declaration(Class()) Declaration(Class()) diff --git a/src/templates/external_import.tsv b/src/templates/external_import.tsv index a72b551..3f7c378 100644 --- a/src/templates/external_import.tsv +++ b/src/templates/external_import.tsv @@ -110,3 +110,4 @@ CHEBI:7660 owl:Class CHEBI:7872 owl:Class CHEBI:8378 owl:Class CHEBI:8461 owl:Class +PATO:0000125 owl:Class