forked from catalyst-fp7/ontology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (55 loc) · 3.47 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
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
# Prerequisites:
# http://www.graphviz.org/
# Raptor from http://librdf.org/
# https://github.com/RDFLib/rdflib (pip install rdflib)
# https://github.com/digitalbazaar/pyld (pip install pyld)
#
# Ubuntu:
# sudo apt-get install python3-pygraphviz raptor2-utils python3-simplejson
# sudo pip install 'rdflib>=4' pyld
dotfiles = ibis.dot version.dot aif.dot vote.dot sioc.dot idea.dot assembl.dot ibis_idea.dot ibis_aif.dot ibis_pa.dot catalyst_core.dot reln_aif.dot reln_pa_ibis.dot
sourcefiles = version.ttl assembl_core.ttl catalyst_idea.ttl cache/AIF-RDF.core.ttl cache/pa_ibis.ttl cache/sioc.ttl cache/foaf.ttl catalyst_ibis.ttl catalyst_vote.ttl catalyst_core.ttl
pdf_files := $(subst .dot,.pdf,$(dotfiles))
all: $(dotfiles) example.json ontology.json
venv:
python3 -mvirtualenv venv
./venv/bin/pip install -r requirements.txt
clean:
rm -f $(dotfiles) $(pdf_files) example.json foaf.ttl pa_ibis.ttl sioc.ttl sioc.rdf.xml foaf.ttl pa_ibis.ttl foaf.rdf.xml
distclean: clean
rm -rf venv
ibis.dot: catalyst_ibis.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl pa_ibis aif --desired_ns ibis --files $(sourcefiles)
ibis_aif.dot: catalyst_ibis.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl pa_ibis --desired_ns ibis --files $(sourcefiles)
ibis_pa.dot: catalyst_ibis.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl aif --desired_ns ibis --files $(sourcefiles)
idea.dot: catalyst_idea.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl ibis --desired_ns idea --files $(sourcefiles)
vote.dot: catalyst_vote.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns vote --files $(sourcefiles)
assembl.dot: assembl_core.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns assembl --files $(sourcefiles)
catalyst_core.dot: catalyst_core.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns catalyst --files $(sourcefiles)
reln_pa_ibis.dot: catalyst_paibis.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns pa_ibis ibis --files catalyst_paibis.ttl $(sourcefiles)
reln_aif.dot: catalyst_aif.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns idea ibis --files catalyst_aif.ttl $(sourcefiles)
version.dot: version.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdfs owl --desired_ns version --files $(sourcefiles)
aif.dot: cache/AIF-RDF.core.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns aif --files cache/AIF-RDF.core.ttl
sioc.dot: cache/sioc.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl --desired_ns sioc --files $(sourcefiles)
ibis_idea.dot: catalyst_idea.ttl $(sourcefiles) venv
./venv/bin/python3 rdf2dot.py --output $@ --exclude_ns xsd rdf rdfs owl vote assembl pa_ibis --desired_ns idea ibis --files $(sourcefiles)
pdf: $(pdf_files)
%.pdf : %.dot
dot -Tpdf -o $@ $<
%.json: %.trig context.jsonld
./venv/bin/python3 save_jsonld.py -c context.jsonld -o $@ $<
ontology.trig:
cat catalyst_*.ttl assembl_core.ttl version.ttl > ontology.trig
%.ttl: %.rdf.xml
rapper -i rdfxml -o turtle $< > $@