-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.wikidata
26 lines (16 loc) · 1.15 KB
/
Makefile.wikidata
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
WIKI_DATA_DIR ?=data/wikidata
SPARQL_ENDPOINT ?=http://b-lx0053.sbb.spk-berlin.de/wikidata2/namespace/wdq/sparql
QUERIES:=$(wildcard sparql/*.query)
DE_QUERY_RESULTS:=$(patsubst sparql/%.query, $(WIKI_DATA_DIR)/de-%.pkl, $(QUERIES))
FR_QUERY_RESULTS:=$(patsubst sparql/%.query, $(WIKI_DATA_DIR)/fr-%.pkl, $(QUERIES))
EN_QUERY_RESULTS:=$(patsubst sparql/%.query, $(WIKI_DATA_DIR)/en-%.pkl, $(QUERIES))
$(WIKI_DATA_DIR)/de-%.pkl : sparql/%.query
run-sparql --query-file $< $@ --endpoint $(SPARQL_ENDPOINT) --lang de --site de.wikipedia.org
$(WIKI_DATA_DIR)/fr-%.pkl : sparql/%.query
run-sparql --query-file $< $@ --endpoint $(SPARQL_ENDPOINT) --lang fr --site fr.wikipedia.org
$(WIKI_DATA_DIR)/en-%.pkl : sparql/%.query
run-sparql --query-file $< $@ --endpoint $(SPARQL_ENDPOINT) --lang en --site en.wikipedia.org
sparql: $(DE_QUERY_RESULTS) $(FR_QUERY_RESULTS) $(EN_QUERY_RESULTS)
$(WIKI_DATA_DIR)/%-wikipedia-ner-entities.pkl: sparql
join-entities $(WIKI_DATA_DIR) $* https://$*.wikipedia.org/wiki/ $@
ner-entities: $(WIKI_DATA_DIR)/de-wikipedia-ner-entities.pkl $(WIKI_DATA_DIR)/fr-wikipedia-ner-entities.pkl $(WIKI_DATA_DIR)/en-wikipedia-ner-entities.pkl