This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
46 lines (40 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
39
40
41
42
43
44
45
46
SPECIFICATION.pdf: SPECIFICATION.md
pandoc $< -o $@
# for now we only have one example
all-examples: all-examples-organization
# for each example schema, make all derived schema products, and derived serializations for the example data file
all-examples-%: examples/%.py examples/%.schema.json examples/%.shex examples/%.graphql examples/%.graphql examples/%.shex examples/%.proto examples/%.shex examples/%.valid examples/%-data.nt
echo done
RUN=pipenv run
## Example schema products
examples/%.py: examples/%.yaml
$(RUN) gen-py-classes $< > $@ && $(RUN) python -m examples.$*
examples/%.shex: examples/%.yaml
$(RUN) gen-shex $< > $@
examples/%.schema.json: examples/%.yaml
$(RUN) gen-json-schema -t $* $< > $@
examples/%.context.jsonld: examples/%.yaml
$(RUN) gen-jsonld-context -t $* $< > $@
examples/%.graphql: examples/%.yaml
$(RUN) gen-graphql $< > $@
examples/%.context.jsonld: examples/%.yaml
$(RUN) gen-jsonld-context $< > $@
examples/%.jsonld: examples/%.yaml
$(RUN) gen-jsonld $< > $@
examples/%.shex: examples/%.yaml
$(RUN) gen-shex $< > $@
examples/%.proto: examples/%.yaml
$(RUN) gen-proto $< > $@
examples/%.owl: examples/%.yaml
$(RUN) gen-owl $< > $@
examples/%.ttl: examples/%.yaml
$(RUN) gen-rdf $< > $@
examples/%-docs: examples/%.yaml
$(RUN) gen-markdown $< -d $@
## Example instance data products
examples/%.valid: examples/%-data.json examples/%.schema.json
jsonschema -i $^
examples/%-data.jsonld: examples/%-data.json examples/%.context.jsonld
jq -s '.[0] * .[1]' $^ > $@
examples/%-data.nt: examples/%-data.jsonld
riot $< > $@