diff --git a/.gitignore b/.gitignore index b2f2d32..fa00605 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,5 @@ src/patterns/data/**/*.txt src/patterns/pattern_owl_seed.txt src/patterns/all_pattern_terms.txt -src/ontology/components/*.owl \ No newline at end of file +src/ontology/components/*.owl +src/ontology/debug.log diff --git a/src/ontology/Makefile b/src/ontology/Makefile index 0cce16c..f2b801d 100644 --- a/src/ontology/Makefile +++ b/src/ontology/Makefile @@ -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= ff6f93caf8c93bf6c4c5c663944a984e193688503d790d719a90a5de2d147045 +CONFIG_HASH= e6c8433a2061b8c344c045ae57324b457c3c5c0b221faaaec4373a8c55c52c2b # ---------------------------------------- @@ -121,7 +121,7 @@ custom_robot_plugins: .PHONY: extra_robot_plugins -extra_robot_plugins: +extra_robot_plugins: $(ROBOT_PLUGINS_DIRECTORY)/upheno.jar # Install all ROBOT plugins to the runtime plugins directory @@ -141,6 +141,9 @@ $(ROBOT_PLUGINS_DIRECTORY)/%.jar: # Specific rules for supplementary plugins defined in configuration +$(ROBOT_PLUGINS_DIRECTORY)/upheno.jar: + curl -L -o $@ https://github.com/monarch-initiative/monarch-robot-plugins/releases/latest/download/monarch-robot-extensions.jar + # ---------------------------------------- # Release assets diff --git a/src/ontology/phenio-odk.yaml b/src/ontology/phenio-odk.yaml index e889d98..7ea3b46 100644 --- a/src/ontology/phenio-odk.yaml +++ b/src/ontology/phenio-odk.yaml @@ -163,3 +163,12 @@ robot_report: documentation: documentation_system: mkdocs + +workflows: + - docs + +robot_plugins: + plugins: + - name: upheno + mirror_from: https://github.com/monarch-initiative/monarch-robot-plugins/releases/latest/download/monarch-robot-extensions.jar + diff --git a/src/ontology/phenio.Makefile b/src/ontology/phenio.Makefile index 22a8359..4e83d97 100644 --- a/src/ontology/phenio.Makefile +++ b/src/ontology/phenio.Makefile @@ -26,43 +26,27 @@ $(TMPDIR)/$(ONT)-full-unreasoned.owl: $(SRC) $(OTHER_SRC) $(EXPLAIN_OUT_PATH): $(TMPDIR)/$(ONT)-full-unreasoned.owl $(ROBOT) explain -i $< -M unsatisfiability --unsatisfiable random:10 --explanation $@ -$(TMPDIR)/$(ONT)-full.owl: $(TMPDIR)/$(ONT)-full-unreasoned.owl - #$(ROBOT) reason --input $< \ - # --reasoner ELK --equivalent-classes-allowed all --exclude-tautologies structural \ - # relax \ - # reduce -r ELK \ - # $(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@ - $(ROBOT) relax --input $< \ - $(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@ - -$(SUBQ_QUERY_RESULT_PATH): $(TMPDIR)/$(ONT)-full.owl - #echo "Finding subq patterns based on $(SUBQ_QUERY_PATH)..." - $(ROBOT) query --input $< --tdb true --format 'owl' --query $(SUBQ_QUERY_PATH) $@ - -$(UPDATE_QUERY_PATH): $(SUBQ_QUERY_RESULT_PATH) - #echo "Creating update query..." - awk -v RS= 'NR==1' $(SUBQ_QUERY_PATH) > $@ - tail -n +3 $<| sed -e '/./!Q' -e 's/@prefix/PREFIX/g' -e 's/.$$//' >> $@ - printf '\nINSERT DATA\n{' >> $@ - sed -n '/rdfs:subClassOf/,$$p' $< >> $@ - printf '\n}' >> $@ - grep subClassOf $@ | wc -l - -$(ONT)-full.owl: $(TMPDIR)/$(ONT)-full.owl $(UPDATE_QUERY_PATH) - #echo "Running update query for subq patterns..." - $(ROBOT) query --input $< --format 'owl' --update $(UPDATE_QUERY_PATH) --temporary-file 'true' annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@ - #echo "Completed update with subq patterns." - ### Merge Biolink Model categories $(BLMODEL): wget $(BLMODEL_URL) -O $@ -$(ONT).owl: $(ONT)-full.owl $(BLMODEL) - $(ROBOT) merge --input $< --input $(BLMODEL) \ - query --update $(BLQUERY) \ - unmerge --input $(BLMODEL) \ - annotate --ontology-iri $(URIBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ - convert -o $@.tmp.owl && mv $@.tmp.owl $@ +### Download ROBOT plugin for upheno +$(ROBOT_PLUGINS_DIRECTORY)/upheno.jar: + mkdir -p $(ROBOT_PLUGINS_DIRECTORY) + curl -L -o $@ https://github.com/monarch-initiative/monarch-robot-plugins/releases/download/v0.0.1/monarch-robot-extensions-0.0.1.jar + +$(ONT)-full.owl: $(TMPDIR)/$(ONT)-full-unreasoned.owl | all_robot_plugins + $(ROBOT) merge --input $< \ + relax \ + merge --input $(BLMODEL) \ + query --update $(BLQUERY) \ + unmerge --input $(BLMODEL) \ + upheno:extract-upheno-relations --root-phenotype UPHENO:0001001 --relation UPHENO:0000003 --relation UPHENO:0000001 \ + annotate --ontology-iri $(URIBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ + convert -o $@.tmp.owl && mv $@.tmp.owl $@ + +tmp/diff.txt: $(ONT).owl $(ONT)-old.owl + $(ROBOT) diff --left $< --right $(word 2,$^) --format txt -o $@ ### Get full entailment with relation-graph ### First, make a minimal version @@ -91,18 +75,6 @@ $(ONT)-relation-graph.tsv: $(MINIMAL_PATH) --obo-prefixes true \ --verbose true -# base-plus. No externally imported axioms, but reasoning is performed. -$(ONT)-base-plus.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES) - $(ROBOT_RELEASE_IMPORT_MODE) \ - reason --reasoner ELK --equivalent-classes-allowed all --exclude-tautologies structural \ - relax \ - reduce -r ELK \ - remove --base-iri $(URIBASE)/PHENIO --axioms external --preserve-structure false --trim false \ - $(SHARED_ROBOT_COMMANDS) \ - annotate --link-annotation http://purl.org/dc/elements/1.1/type http://purl.obolibrary.org/obo/IAO_8000001 \ - --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \ - --output $@.tmp.owl && mv $@.tmp.owl $@ - # test artifact. A small subset of the ontology for testing purposes # Note this does include categories. $(ONT)-test.owl: $(ONT).owl diff --git a/src/scripts/update_repo.sh b/src/scripts/update_repo.sh index 941b891..1fc84f2 100644 --- a/src/scripts/update_repo.sh +++ b/src/scripts/update_repo.sh @@ -26,7 +26,7 @@ cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/ cp -r target/$OID/src/sparql/* $SRCDIR/sparql/ mkdir -p $ROOTDIR/.github mkdir -p $ROOTDIR/.github/workflows -cp target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml + @@ -36,5 +36,5 @@ cp target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml cp -n target/$OID/mkdocs.yaml $ROOTDIR/ echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)" - +echo "WARNING: Your QC workflows have not been updated automatically. Please update the ODK version number(s) in .github/workflows/qc.yml." echo "Ontology repository update successfully completed." \ No newline at end of file