-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (27 loc) · 1.54 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
# This Makefile assumes you have the Jena command-line tools installed,
# including the `shacl` and `shex` commands.
all: validate-shapes run-all-shex run-all-shacl
.PHONY: all validate run-all-shacl run-all-shex clean
validate-shapes: .validate-shex .validate-shacl
# Validate the ShEx file; ignore parsed structure output.
.validate-shex: shex/obo-shapes.shex
shex p -q $< >/dev/null #&& touch $@ # Disable this marker file until Jena shex is fixed to exit with non-zero code on failure: https://github.com/apache/jena/issues/1257
# Validate the SHACL file; ignore parsed structure output.
.validate-shacl: shacl/obo-shapes.ttl
shacl p -q $< >/dev/null && touch $@
PASS_FILES := $(wildcard test-data/pass/*)
FAIL_FILES := $(wildcard test-data/fail/*)
SHACL_PASS_OUT := $(patsubst test-data/pass/%,output/pass/%-shacl.out,$(PASS_FILES))
SHACL_FAIL_OUT := $(patsubst test-data/fail/%,output/fail/%-shacl.out,$(FAIL_FILES))
SHEX_PASS_OUT := $(patsubst test-data/pass/%,output/pass/%-shex.out,$(PASS_FILES))
SHEX_FAIL_OUT := $(patsubst test-data/fail/%,output/fail/%-shex.out,$(FAIL_FILES))
output/%-shacl.out: test-data/% shacl/obo-shapes.ttl .validate-shacl
mkdir -p $(dir $@)
shacl v --shapes shacl/obo-shapes.ttl --data $< >$@ #--text
output/%-shex.out: test-data/% shex/obo-shapes.shex shex/obo-shapes.shapeMap .validate-shex
mkdir -p $(dir $@)
shex v --schema shex/obo-shapes.shex --data $< --map shex/obo-shapes.shapeMap --text >$@
run-all-shacl: $(SHACL_PASS_OUT) $(SHACL_FAIL_OUT)
run-all-shex: $(SHEX_PASS_OUT) $(SHEX_FAIL_OUT)
clean:
rm -rf output