-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
108 lines (85 loc) · 2.32 KB
/
Makefile
File metadata and controls
108 lines (85 loc) · 2.32 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Informed Consent Ontology (ICO) Makefile
# Jie Zheng
#
# This Makefile is used to build artifacts for the Informed Consent Ontology.
#
### Configuration
#
# prologue:
# <http://clarkgrubb.com/makefile-style-guide#toc2>
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := all
.DELETE_ON_ERROR:
.SUFFIXES:
### Definitions
SHELL := /bin/bash
OBO := http://purl.obolibrary.org/obo
ICO := $(OBO)/ICO_
TODAY := $(shell date +%Y-%m-%d)
### Directories
#
# This is a temporary place to put things.
build:
mkdir -p $@
### ROBOT
#
# We use the latest official release version of ROBOT
build/robot.jar: | build
curl -L -o $@ "https://github.com/ontodev/robot/releases/latest/download/robot.jar"
ROBOT := java -jar build/robot.jar
### Imports
#
# Use Ontofox to import terms from external ontologies.
src/ontology/imports/%_OntoFox_import.owl: src/ontology/imports/OntoFox_Inputs/%_OntoFox_import_input.txt | build
curl -s -F file=@$< -o $@ https://ontofox.hegroup.org/service.php
IMPORT_FILES := $(wildcard src/ontology/imports/*_OntoFox_import.owl)
.PHONY: imports
imports: $(IMPORT_FILES)
### Build
#
# Here we create a standalone OWL file appropriate for release.
# This involves merging, reasoning, annotating,
# and removing any remaining import declarations.
build/ico-merged.owl: src/ontology/ico-edit.owl | build/robot.jar build
$(ROBOT) merge \
--input $< \
annotate \
--ontology-iri "$(OBO)/ico/ico-merged.owl" \
--version-iri "$(OBO)/ico/releases/$(TODAY)/ico-merged.owl" \
--annotation owl:versionInfo "$(TODAY)" \
--output build/ico-merged.tmp.owl
sed '/<owl:imports/d' build/ico-merged.tmp.owl > $@
rm build/ico-merged.tmp.owl
ico.owl: build/ico-merged.owl
$(ROBOT) reason \
--input $< \
--reasoner ELK \
annotate \
--ontology-iri "$(OBO)/ico.owl" \
--version-iri "$(OBO)/ico/releases/$(TODAY)/ico.owl" \
--annotation owl:versionInfo "$(TODAY)" \
--output $@
ico-base.owl: ico.owl
$(ROBOT) remove \
--input $< \
--base-iri http://purl.obolibrary.org/obo/ICO_ \
--axioms external \
--preserve-structure false \
--trim false \
--output $@
robot_report.tsv: ico-base.owl
$(ROBOT) report \
--input $< \
--fail-on none \
--output $@
###
#
# Full build
.PHONY: all
all: ico.owl robot_report.tsv
# Remove generated files
.PHONY: clean
clean:
rm -rf build