-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
61 lines (41 loc) · 1.59 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
.PHONY: dedupe serve dev convert publish
data:
mkdir -p data/
data/opensanctions.json: data
curl -o data/opensanctions.json https://data.opensanctions.org/datasets/latest/default/entities.ftm.json
convert-dev: data/opensanctions.json
python export.py -p http://localhost:9999/exports data/opensanctions.json
dev: convert-dev dedupe
serve:
cd data && python -m http.server 9999
convert: data/opensanctions.json
python export.py -p https://data.opensanctions.org/contrib/neo4j/exports data/opensanctions.json
publish:
gsutil cp -r data/exports/* gs://data.opensanctions.org/contrib/neo4j/exports
# OpenScreening big graph
data/graph.json: data
wget -q -c -O data/graph.json https://data.opensanctions.org/datasets/latest/graph/entities.ftm.json
openscreening: data/graph.json
python export.py -p https://data.opensanctions.org/contrib/offshore-graph/exports data/graph.json
openscreening-publish:
gsutil cp -r data/exports/* gs://data.opensanctions.org/contrib/offshore-graph/exports
clean:
rm -f data/graph.json
rm -f data/opensanctions.json
rm -rf data/dedupe
rm -rf data/exports
### Outdated, ignore:
data/dedupe:
mkdir -p data/dedupe
data/dedupe/%.head.csv:
head -1 data/exports/$*.csv >$@
data/dedupe/%.body.csv:
tail -n +2 data/exports/$*.csv >$@
data/dedupe/%.uniq.csv: data/dedupe/%.body.csv
sort -u data/dedupe/$*.body.csv -o data/dedupe/$*.uniq.csv
data/exports/%.csv: data/dedupe/%.head.csv data/dedupe/%.uniq.csv
cat data/dedupe/$*.head.csv data/dedupe/$*.uniq.csv >data/exports/$*.csv
openscreening-dedupe:
rm -rf data/dedupe
mkdir -p data/dedupe
make -B data/exports/*.csv