Skip to content

Commit

Permalink
Add ECTO MRE subset
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Jan 13, 2024
1 parent 7500369 commit 53aa0b6
Show file tree
Hide file tree
Showing 9 changed files with 1,343 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ src/mapping/.cogs
src/mapping/mre_ecto2.sssom.tsv
src/patterns/data/default/*.txt
src/patterns/data/default/*.ofn
src/ontology/ecto-mre.owl
55 changes: 49 additions & 6 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ----------------------------------------
# Makefile for ecto
# Generated using ontology-development-kit
# ODK Version: v1.4
# ODK Version: v1.4.3
# ----------------------------------------
# IMPORTANT: DO NOT EDIT THIS FILE. To override default make goals, use ecto.Makefile instead

Expand Down Expand Up @@ -43,14 +43,14 @@ REPORT_PROFILE_OPTS =
OBO_FORMAT_OPTIONS =
SPARQL_VALIDATION_CHECKS = owldef-self-reference iri-range label-with-iri multiple-replaced_by
SPARQL_EXPORTS = basic-report class-count-by-prefix edges xrefs obsoletes synonyms
ODK_VERSION_MAKEFILE = v1.4
ODK_VERSION_MAKEFILE = v1.4.3

TODAY ?= $(shell date +%Y-%m-%d)
OBODATE ?= $(shell date +'%d:%m:%Y %H:%M')
VERSION= $(TODAY)
ANNOTATE_ONTOLOGY_VERSION = annotate -V $(ONTBASE)/releases/$(VERSION)/$@ --annotation owl:versionInfo $(VERSION)
ANNOTATE_CONVERT_FILE = annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) convert -f ofn --output $@.tmp.owl && mv $@.tmp.owl $@
OTHER_SRC = $(PATTERNDIR)/definitions.owl $(COMPONENTSDIR)/ecto-xrefs.owl $(COMPONENTSDIR)/bridge.owl $(COMPONENTSDIR)/obsoletes.owl
OTHER_SRC = $(PATTERNDIR)/definitions.owl $(COMPONENTSDIR)/ecto-xrefs.owl $(COMPONENTSDIR)/bridge.owl $(COMPONENTSDIR)/obsoletes.owl $(COMPONENTSDIR)/subsets.owl
ONTOLOGYTERMS = $(TMPDIR)/ontologyterms.txt
EDIT_PREPROCESSED = $(TMPDIR)/$(ONT)-preprocess.owl
PATTERNDIR= ../patterns
Expand All @@ -61,7 +61,7 @@ PATTERN_RELEASE_FILES= $(PATTERNDIR)/definitions.owl $(PATTERNDIR)/pattern.

FORMATS = $(sort owl obo json owl)
FORMATS_INCL_TSV = $(sort $(FORMATS) tsv)
RELEASE_ARTEFACTS = $(sort $(ONT)-full $(ONT)-base )
RELEASE_ARTEFACTS = $(sort $(ONT)-base $(ONT)-full $(ONT)-simple ecto-mre )

# ----------------------------------------
# Top-level targets
Expand Down Expand Up @@ -285,6 +285,13 @@ $(PRESEED): $(SRCMERGED)
$(ROBOT) query -f csv -i $< --query ../sparql/terms.sparql $@.tmp &&\
cat $@.tmp | sort | uniq > $@

SIMPLESEED=$(TMPDIR)/simple_seed.txt

$(SIMPLESEED): $(SRCMERGED) $(ONTOLOGYTERMS)
$(ROBOT) query -f csv -i $< --query ../sparql/simple-seed.sparql $@.tmp &&\
cat $@.tmp $(ONTOLOGYTERMS) | sort | uniq > $@ &&\
echo "http://www.geneontology.org/formats/oboInOwl#SubsetProperty" >> $@ &&\
echo "http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty" >> $@


ALLSEED = $(PRESEED) $(TMPDIR)/all_pattern_terms.txt \
Expand Down Expand Up @@ -396,6 +403,14 @@ $(COMPONENTSDIR)/%: | $(COMPONENTSDIR)





$(COMPONENTSDIR)/subsets.owl: $(TEMPLATEDIR)/subsets.tsv
if [ $(COMP) = true ] ; then $(ROBOT) template \
$(patsubst %, --template %, $^) \
$(ANNOTATE_CONVERT_FILE); fi

.PRECIOUS: $(COMPONENTSDIR)/subsets.owl
# ----------------------------------------
# Mirroring upstream ontologies
# ----------------------------------------
Expand Down Expand Up @@ -671,15 +686,27 @@ $(PATTERNDIR)/definitions.owl: $(DOSDP_OWL_FILES_DEFAULT)
# ----------------------------------------


$(ONT)-base.obo: $(ONT)-base.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo
$(ONT)-base.json: $(ONT)-base.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o $@.tmp.json &&\
mv $@.tmp.json $@
$(ONT)-full.obo: $(ONT)-full.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo
$(ONT)-full.json: $(ONT)-full.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o $@.tmp.json &&\
mv $@.tmp.json $@
$(ONT)-base.obo: $(ONT)-base.owl
$(ONT)-simple.obo: $(ONT)-simple.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo
$(ONT)-base.json: $(ONT)-base.owl
$(ONT)-simple.json: $(ONT)-simple.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o $@.tmp.json &&\
mv $@.tmp.json $@
ecto-mre.obo: ecto-mre.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo
ecto-mre.json: ecto-mre.owl
$(ROBOT) annotate --input $< --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert --check false -f json -o $@.tmp.json &&\
mv $@.tmp.json $@
Expand Down Expand Up @@ -725,6 +752,22 @@ $(ONT)-full.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(IMPORT_FILES)
relax \
reduce -r ELK \
$(SHARED_ROBOT_COMMANDS) annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) --output $@.tmp.owl && mv $@.tmp.owl $@
# foo-simple: (edit->reason,relax,reduce,drop imports, drop every axiom which contains an entity outside the "namespaces of interest")
# drop every axiom: filter --term-file keep_terms.txt --trim true
# remove --select imports --trim false
$(ONT)-simple.owl: $(EDIT_PREPROCESSED) $(OTHER_SRC) $(SIMPLESEED) $(IMPORT_FILES)
$(ROBOT_RELEASE_IMPORT_MODE) \
reason --reasoner ELK --equivalent-classes-allowed asserted-only --exclude-tautologies structural \
relax \
remove --axioms equivalent \
relax \
filter --term-file $(SIMPLESEED) --select "annotations ontology anonymous self" --trim true --signature true \
reduce -r ELK \
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 $@

ecto-mre.owl:
echo "ERROR: You have configured a custom release artefact ($@); this release artefact needs to be define in ecto.Makefile!" && false
# ----------------------------------------
# Debugging Tools
# ----------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/ontology/catalog-v001.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<group id="Folder Repository, directory=, recursive=false, Auto-Update=false, version=2" prefer="public" xml:base=""/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/components/bridge.owl" uri="components/bridge.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/components/ecto-xrefs.owl" uri="components/ecto-xrefs.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/components/subsets.owl" uri="components/subsets.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/components/xrefs.owl" uri="components/ecto-xrefs.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/imports/chebi_import.owl" uri="imports/chebi_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ecto/imports/envo_import.owl" uri="imports/envo_import.owl"/>
Expand Down
Loading

0 comments on commit 53aa0b6

Please sign in to comment.