Skip to content

Commit

Permalink
Merge pull request #2413 from obophenotype/issue2373-update-pro
Browse files Browse the repository at this point in the history
Updating pro import
  • Loading branch information
shawntanzk authored Apr 12, 2022
2 parents c9d6a9f + e4c42b5 commit d84344e
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 121 deletions.
45 changes: 29 additions & 16 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----------------------------------------
# Makefile for uberon
# Generated using ontology-development-kit
# ODK Version: v1.3.0
# ODK Version: v1.3.1
# ----------------------------------------
# IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use uberon.Makefile instead

Expand Down Expand Up @@ -41,7 +41,7 @@ REPORT_PROFILE_OPTS = --profile $(ROBOT_PROFILE)
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = equivalent-classes owldef-self-reference illegal-annotation-property taxon-range orcid-contributor obsolete-replaced_by
SPARQL_EXPORTS = basic-report
ODK_VERSION_MAKEFILE = v1.3.0
ODK_VERSION_MAKEFILE = v1.3.1

TODAY ?= $(shell date +%Y-%m-%d)
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
Expand Down Expand Up @@ -268,7 +268,7 @@ $(IMPORTDIR)/%_terms_combined.txt: $(IMPORTSEED) $(IMPORTDIR)/%_terms.txt
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) query -i $< --update ../sparql/preprocess-module.ru \
extract -T $(IMPORTDIR)/$*_terms_combined.txt --force true --copy-ontology-annotations true --individuals include --method BOT \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/postprocess-module.ru \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@; fi

.PRECIOUS: $(IMPORTDIR)/%_import.owl
Expand All @@ -277,28 +277,29 @@ $(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt

$(IMPORTDIR)/chebi_import.owl: $(MIRRORDIR)/chebi.owl $(IMPORTDIR)/chebi_terms_combined.txt
if [ $(IMP) = true ] && [ $(IMP_LARGE) = true ]; then $(ROBOT) extract -i $< -T $(IMPORTDIR)/chebi_terms_combined.txt --force true --individuals include --method BOT \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/postprocess-module.ru \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@; fi


.PHONY: refresh-imports
refresh-imports:
make IMP=true MIR=true PAT=false IMP_LARGE=true all_imports -B
$(MAKE) IMP=true MIR=true PAT=false IMP_LARGE=true all_imports -B

.PHONY: no-mirror-refresh-imports
no-mirror-refresh-imports:
make IMP=true MIR=false PAT=false IMP_LARGE=true all_imports -B
$(MAKE) IMP=true MIR=false PAT=false IMP_LARGE=true all_imports -B

.PHONY: refresh-imports-excluding-large
refresh-imports-excluding-large:
make IMP=true MIR=true PAT=false IMP_LARGE=false all_imports -B
$(MAKE) IMP=true MIR=true PAT=false IMP_LARGE=false all_imports -B

.PHONY: refresh-%
refresh-%:
make IMP=true IMP_LARGE=true MIR=true PAT=false $(IMPORTDIR)/$*_import.owl -B
$(MAKE) IMP=true IMP_LARGE=true MIR=true PAT=false $(IMPORTDIR)/$*_import.owl -B

.PHONY: no-mirror-refresh-%
no-mirror-refresh-%:
make IMP=true IMP_LARGE=true MIR=false PAT=false $(IMPORTDIR)/$*_import.owl -B
$(MAKE) IMP=true IMP_LARGE=true MIR=false PAT=false $(IMPORTDIR)/$*_import.owl -B


# ----------------------------------------
Expand All @@ -308,6 +309,17 @@ no-mirror-refresh-%:

COMP=true # Global parameter to bypass component generation

.PHONY: all_components
all_components: $(OTHER_SRC)

.PHONY: recreate-components
recreate-components:
$(MAKE) IMP=true MIR=true PAT=true IMP_LARGE=true all_components -B

.PHONY: recreate-%
recreate-%:
$(MAKE) IMP=true IMP_LARGE=true MIR=true PAT=true $(COMPONENTSDIR)/$*.owl -B

$(COMPONENTSDIR)/%: | $(COMPONENTSDIR)
touch $@
.PRECIOUS: $(COMPONENTSDIR)/%
Expand Down Expand Up @@ -497,7 +509,7 @@ mirror-caro: | $(TMPDIR)


$(MIRRORDIR)/%.owl: mirror-% | $(MIRRORDIR)
if [ $(IMP) = true ] && [ $(MIR) = true ]; then if cmp -s $(TMPDIR)/mirror-$*.owl $@ ; then echo "Mirror identical, ignoring."; else echo "Mirrors different, updating." && cp $(TMPDIR)/mirror-$*.owl $@; fi; fi
if [ $(IMP) = true ] && [ $(MIR) = true ] && [ -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



Expand Down Expand Up @@ -533,7 +545,7 @@ SPARQL_EXPORTS_ARGS = $(foreach V,$(SPARQL_EXPORTS),-s $(SPARQLDIR)/$(V).sparql
.PHONY: custom_reports
custom_reports: $(SRC) | $(REPORTDIR)
ifneq ($(SPARQL_EXPORTS_ARGS),)
$(ROBOT) query -f tsv -i $< $(SPARQL_EXPORTS_ARGS)
$(ROBOT) query -f tsv --use-graphs true -i $< $(SPARQL_EXPORTS_ARGS)
endif
# ----------------------------------------
# DOSDP Templates/Patterns
Expand All @@ -556,9 +568,9 @@ pattern_clean:
.PHONY: patterns
patterns dosdp:
echo "Validating all DOSDP templates"
make dosdp_validation
$(MAKE) dosdp_validation
echo "Building $(PATTERNDIR)/definitions.owl"
make $(PATTERNDIR)/pattern.owl $(PATTERNDIR)/definitions.owl
$(MAKE) $(PATTERNDIR)/pattern.owl $(PATTERNDIR)/definitions.owl

# DOSDP Template Validation

Expand Down Expand Up @@ -756,7 +768,7 @@ $(ONT)-simple.owl: $(SRC) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILES)
relax \
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \
reduce -r ELK \
query --update ../sparql/inject-subset-declaration.ru \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru \
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@
# foo-basic: A version of -simple containing only relationships using relations on a configurable whitelist (default = BFO:0000050 (?)). See above (David comment) for explanation.
# removes any axioms that contains one of the ops that not in the whitelist file
Expand Down Expand Up @@ -812,7 +824,7 @@ validate-tsv: $(TSV) | $(TMPDIR)
done

validate-all-tsv: $(ALL_TSV_FILES)
make validate-tsv TSV="$^"
$(MAKE) validate-tsv TSV="$^"

# ----------------------------------------
# Editors Utilities
Expand Down Expand Up @@ -843,7 +855,7 @@ update_docs:
# the environment does not malicously set `CLEANFILES` to `\`.
.PHONY: clean
clean:
make pattern_clean
$(MAKE) pattern_clean
[ -n "$(MIRRORDIR)" ] && [ $(MIRRORDIR) != "." ] && [ $(MIRRORDIR) != "/" ] && [ $(MIRRORDIR) != ".." ] && [ -d ./$(MIRRORDIR) ] && rm -rf ./$(MIRRORDIR)/*
[ -n "$(TMPDIR)" ] && [ $(TMPDIR) != "." ] && [ $(TMPDIR) != "/" ] && [ $(TMPDIR) != ".." ] && [ -d ./$(TMPDIR) ] && rm -rf ./$(TMPDIR)/*
rm -f $(CLEANFILES)
Expand All @@ -870,6 +882,7 @@ Core commands:

Imports management:
* refresh-imports: Refresh all imports and mirrors.
* refresh-components: Refresh all components.
* no-mirror-refresh-imports: Refresh all imports without downloading mirrors.
* refresh-imports-excluding-large: Refresh all imports and mirrors, but skipping the ones labelled as 'is_large'.
* refresh-%: Refresh a single import, i.e. refresh-go will refresh 'imports/go_import.owl'.
Expand Down
Loading

0 comments on commit d84344e

Please sign in to comment.