-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
55 lines (43 loc) · 2.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## OBO Library prefix
OBO=http://purl.obolibrary.org/obo
BASE=$(OBO)/$(ONT)
CAT=--use-catalog
SRC=plant-ontology.obo
ONT=po
ROBOT=robot
OWLTOOLS=owltools
all: all_imports po.obo po.owl all_subsets
all_subsets: subsets/po-basic.obo
test: $(ONT).owl
release: all
echo "build successful. Now commit and push the derived files and make a release here: "
$(ONT).owl: $(SRC)
$(ROBOT) reason -x true -t true -i $< -r ELK relax reduce -r ELK annotate -V $(BASE)/releases/`date +%Y-%m-%d`/$(ONT).owl -o $@
$(ONT).obo: $(ONT).owl
$(OWLTOOLS) $(CAT) $< -o -f obo --no-check $(ONT).obo.tmp && grep -v '^owl-axioms:' $(ONT).obo.tmp > $@ && rm $(ONT).obo.tmp
# $(ROBOT) convert -i $< -f obo -o $(ONT).obo.tmp && grep -v '^owl-axioms:' $(ONT).obo.tmp > $@ && rm $(ONT).obo.tmp
reasoner-report.txt: plant-ontology.obo
owltools $(CAT) $< --run-reasoner -r elk -u > [email protected] && egrep '(INFERENCE|UNSAT)' [email protected] > $@
# TODO: switch to using robot
subsets/po-basic.obo: po.obo
owltools $(CAT) $< --remove-imports-declarations --make-subset-by-properties -f BFO:0000050 // --set-ontology-id $(OBO)/po/subsets/po-basic.owl -o -f obo $@
# ----------------------------------------
# Imports
# ----------------------------------------
IMPORTS = ncbitaxon
IMPORTS_OWL = $(patsubst %, imports/%_import.owl,$(IMPORTS)) $(patsubst %, imports/%_import.obo,$(IMPORTS))
# Make this target to regenerate ALL
all_imports: $(IMPORTS_OWL)
# Use ROBOT, driven entirely by terms lists NOT from source ontology
imports/%_import.owl: mirror/%.owl imports/%_terms.txt
$(ROBOT) extract -i $< -T imports/$*_terms.txt --method BOT -O $(BASE)/$@ -o $@
.PRECIOUS: imports/%_import.owl
imports/%_import.obo: imports/%_import.owl
$(OWLTOOLS) $(USECAT) $< -o -f obo temp.obo.tmp && grep -v '^owl-axioms:' temp.obo.tmp > $@ && rm temp.obo.tmp
# clone remote ontology locally, perfoming some excision of relations and annotations
mirror/%.owl: $(SRC)
$(OWLTOOLS) $(OBO)/$*.owl --remove-annotation-assertions -l -s -d -r --remove-dangling-annotations -o $@
.PRECIOUS: mirror/%.owl
mirror/ncbitaxon.owl:
$(OWLTOOLS) $(OBO)/ncbitaxon/subsets/taxslim.owl --remove-annotation-assertions -l -s -d --remove-dangling-annotations --set-ontology-id $(OBO)/ncbitaxon -o $@
.PRECIOUS: mirror/ncbitaxon.owl