Skip to content

Commit

Permalink
Updated makefile for new cl-basic and cl-simple
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Jun 15, 2019
1 parent adabade commit 753dbc1
Show file tree
Hide file tree
Showing 10 changed files with 19,662 additions and 1,899 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ src/ontology/cl-base.json
src/ontology/cl-base.obo
src/ontology/cl.json
src/patterns/all_pattern_terms.txt
src/ontology/oort
3,516 changes: 3,516 additions & 0 deletions reports/cl-edit-obo-report.tsv

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions src/ontology/cl.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,85 @@ imports/ncbitaxon_import.owl:

object_properties.txt: $(SRC)
$(ROBOT) query --use-graphs true -f csv -i $< --query ../sparql/object-properties-in-signature.sparql $@

$(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 > $@.tmp &&\
cat $@.tmp | perl -0777 -e '$$_ = <>; s/^name[:].*?\nname[:]/name:/g; print' | perl -0777 -e '$$_ = <>; s/def[:].*?\ndef[:]/def:/g; print' > $@
rm -f $@.tmp.obo $@.tmp

simple_seed.txt: $(SRC) #$(ONTOLOGYTERMS) #prepare_patterns
$(ROBOT) query --use-graphs false -f csv -i $< --query ../sparql/object-properties.sparql $@.tmp &&\
cat $@.tmp $(ONTOLOGYTERMS) | sort | uniq > $@ &&\
echo "http://www.geneontology.org/formats/oboInOwl#SubsetProperty" >> $@ &&\
echo "http://www.geneontology.org/formats/oboInOwl#SynonymTypeProperty" >> $@
#rm -f [email protected]

non_native_classes.txt: $(SRC)
$(ROBOT) query --use-graphs true -f csv -i $< --query ../sparql/non-native-classes.sparql $@.tmp &&\
cat $@.tmp | sort | uniq > $@
rm -f $@.tmp

$(ONT)-simple.owl: $(SRC) $(OTHER_SRC) simple_seed.txt non_native_classes.txt $(ONTOLOGYTERMS)
$(ROBOT) merge --input $< $(patsubst %, -i %, $(OTHER_SRC)) --collapse-import-closure true \
reason --reasoner ELK \
relax \
remove --axioms equivalent \
relax \
filter --term-file simple_seed.txt --trim true --select "annotations ontology anonymous parents object-properties self" --preserve-structure false \
remove --term-file non_native_classes.txt --preserve-structure false \
reduce -r ELK \
annotate --ontology-iri $(ONTBASE)/$@ --version-iri $(ONTBASE)/releases/$(TODAY)/$@ --output $@.tmp.owl && mv $@.tmp.owl $@

# TODO add back: remove --term-file non_native_classes.txt \

$(ONT).obo: $(ONT)-basic.owl
$(ROBOT) convert --input $< --check false -f obo $(OBO_FORMAT_OPTIONS) -o $@.tmp.obo && grep -v ^owl-axioms $@.tmp.obo > $@ && rm $@.tmp.obo

$(PATTERNDIR)/dosdp-patterns: .FORCE
echo "WARNING WARNING Skipped until fixed: delete from cl.Makefile"

$(ONT)-basic.owl: $(SRC) $(OTHER_SRC) $(ONTOLOGYTERMS) $(KEEPRELATIONS) simple_seed.txt non_native_classes.txt
$(ROBOT) merge --input $< $(patsubst %, -i %, $(OTHER_SRC)) --collapse-import-closure true \
reason --reasoner ELK \
relax \
remove --axioms equivalent \
relax \
filter --term-file simple_seed.txt --trim true --select "annotations ontology anonymous parents object-properties self" --preserve-structure false \
remove --term-file non_native_classes.txt --preserve-structure false \
remove --term-file $(KEEPRELATIONS) --select complement --select object-properties --trim true \
reduce -r ELK \
annotate --ontology-iri $(ONTBASE)/$@ --version-iri $(ONTBASE)/releases/$(TODAY)/$@ --output $@.tmp.owl && mv $@.tmp.owl $@

oort: $(SRC)
ontology-release-runner --reasoner elk $< --no-subsets --allow-equivalent-pairs --simple --relaxed --asserted --allow-overwrite --outdir oort

KEEPRS=part_of develops_from

$(ONT)-basic.owl: $(ONT)-simple.owl
owltools $< --make-subset-by-properties $(KEEPRS) -o -f owl $@

$(ONT)-simple.owl: oort
cp oort/$@ $@

$(ONT)-basic.obo: $(ONT)-simple.obo
owltools $< --make-subset-by-properties $(KEEPRS) -o -f obo $@

$(ONT)-simple.obo: oort
cp oort/$@ $@

# TODO add BACK remove --term-file $(KEEPRELATIONS) --select complement --select object-properties --trim true \
# TODO add BACK remove --term-file non_native_classes.txt \
# remove --term-file $(KEEPRELATIONS) --select complement --select object-properties --trim true \


fail_seed_by_entity_type_cl:
robot query --use-graphs false -f csv -i cl-edit.owl --query ../sparql/object-properties.sparql $@.tmp &&\
cat $@.tmp | sort | uniq > $@.txt && rm -f $@.tmp

works_seed_by_entity_type_cl:
robot query --use-graphs false -f csv -i cl-edit.owl --query ../sparql/object-properties-in-signature.sparql $@.tmp &&\
cat $@.tmp | sort | uniq > $@.txt && rm -f $@.tmp
Loading

0 comments on commit 753dbc1

Please sign in to comment.