Skip to content
Permalink
Browse files

Updated makefile for new cl-basic and cl-simple

  • Loading branch information...
matentzn committed Jun 15, 2019
1 parent adabade commit 753dbc1e1b7eb09d524a7dfd92973493b6fcf3e9
@@ -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

Large diffs are not rendered by default.

@@ -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 $@.tmp

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

0 comments on commit 753dbc1

Please sign in to comment.
You can’t perform that action at this time.