Skip to content

Commit

Permalink
Inject ODK fix and updated module
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Apr 11, 2022
1 parent 8c5983a commit e4c42b5
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 16 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
25 changes: 25 additions & 0 deletions src/ontology/imports/pr_import.owl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<rdf:RDF xmlns="http://purl.obolibrary.org/obo/uberon/imports/pr_import.owl#"
xml:base="http://purl.obolibrary.org/obo/uberon/imports/pr_import.owl"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:pr="http://purl.obolibrary.org/obo/pr#"
xmlns:obo="http://purl.obolibrary.org/obo/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Expand Down Expand Up @@ -34,6 +35,30 @@



<!-- http://purl.obolibrary.org/obo/pr#Gene-based -->

<owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/pr#Gene-based">
<rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
</owl:AnnotationProperty>



<!-- http://purl.obolibrary.org/obo/pr#PRO-common-name -->

<owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/pr#PRO-common-name">
<rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
</owl:AnnotationProperty>



<!-- http://purl.obolibrary.org/obo/pr#PRO-short-label -->

<owl:AnnotationProperty rdf:about="http://purl.obolibrary.org/obo/pr#PRO-short-label">
<rdfs:subPropertyOf rdf:resource="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
</owl:AnnotationProperty>



<!-- http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty -->

<owl:AnnotationProperty rdf:about="http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty"/>
Expand Down
1 change: 1 addition & 0 deletions src/scripts/update_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cp -r target/$OID/src/sparql/* $SRCDIR/sparql/
mkdir -p $ROOTDIR/.github
mkdir -p $ROOTDIR/.github/workflows
cp -n target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml
cp -n target/$OID/.github/workflows/diff.yml $ROOTDIR/.github/workflows/diff.yml

cp -n target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml

Expand Down
11 changes: 11 additions & 0 deletions src/sparql/inject-synonymtype-declaration.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX : <http://www.test.com/ns/test#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

INSERT { ?y rdfs:subPropertyOf <http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty> . }

WHERE {
?x <http://www.geneontology.org/formats/oboInOwl#hasSynonymType> ?y .
FILTER(isIRI(?y))
FILTER(regex(str(?y),"^(http://purl.obolibrary.org/obo/)") || regex(str(?y),"^(http://www.ebi.ac.uk/efo/)") || regex(str(?y),"^(https://w3id.org/biolink/)"))
}

0 comments on commit e4c42b5

Please sign in to comment.