forked from okfde/offenesparlament.de
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFreezefile.yaml
157 lines (141 loc) · 5.06 KB
/
Freezefile.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
common:
database: postgresql://fl@localhost/opa_etl
prefix: /var/www/opendatalabs.org/de/bundestag
exports:
#- query: >
# SELECT b.fraktion, a.sachgebiet, b.fingerprint, p.date, a.titel, a.source_url
# FROM ablauf a LEFT JOIN position p ON p.source_url = a.source_url
# LEFT JOIN beitrag b ON b.source_url = p.source_url
# WHERE b.art = 'Kleine Anfrage'
# filename: zus_kleine_anfragen.csv
# format: csv
#- query: >
# SELECT DISTINCT a.source_url, b.fraktion, a.sachgebiet, b.fingerprint, p.date, a.titel,
# SUBSTR(p.date, 0, 8) AS ts
# FROM ablauf a LEFT JOIN position p ON p.source_url = a.source_url
# LEFT JOIN beitrag b ON b.source_url = p.source_url
# WHERE b.art = 'Kleine Anfrage'
# filename: anfragen/fraktion/{{slug:fraktion}}_{{ts}}.json
# format: json
#- query: >
# SELECT b.fraktion, a.sachgebiet, b.fingerprint, p.date, a.titel, a.source_url
# FROM ablauf a LEFT JOIN position p ON p.source_url = a.source_url
# LEFT JOIN beitrag b ON b.source_url = p.source_url
# WHERE b.art = 'Kleine Anfrage'
# filename: anfragen/{{fraktion}}index_.json
# format: json
#- query: >
# SELECT DISTINCT a.source_url, a.initiative, a.sachgebiet, b.fingerprint, p.date, a.titel
# FROM ablauf a LEFT JOIN position p ON p.source_url = a.source_url
# LEFT JOIN beitrag b ON b.source_url = p.source_url
# WHERE b.art = 'Kleine Anfrage'
# filename: zus_kleine_anfragen_initiative.csv
# format: csv
#- query: >
# SELECT COUNT(DISTINCT a.id), b.fraktion, a.sachgebiet,
# SUBSTR(p.date, 0, 8) AS ts
# FROM ablauf a LEFT JOIN position p ON p.source_url = a.source_url
# LEFT JOIN beitrag b ON b.source_url = p.source_url
# WHERE b.art = 'Kleine Anfrage'
# GROUP BY b.fraktion, a.sachgebiet, ts
# ORDER BY ts DESC
# filename: timeseries_kleine_anfragen.csv
# format: csv
- query: >
SELECT COUNT(DISTINCT a.id), b.fraktion, c.category,
SUBSTR(p.date, 0, 8) AS ts
FROM ablauf a
LEFT JOIN category c ON c.sachgebiet = a.sachgebiet
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = p.source_url
WHERE a.sachgebiet IS NOT NULL
AND LENGTH(a.sachgebiet) > 0
AND b.art = 'Kleine Anfrage'
GROUP BY b.fraktion, c.category, ts
ORDER BY ts DESC;
filename: anfragen/months.csv
format: csv
- query: >
SELECT DISTINCT ON (a.source_url)
a.source_url, b.fraktion, c.category, p.date, a.titel,
SUBSTR(p.date, 0, 8) AS ts
FROM ablauf a
LEFT JOIN category c ON c.sachgebiet = a.sachgebiet
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = p.source_url
WHERE a.sachgebiet IS NOT NULL
AND LENGTH(a.sachgebiet) > 0
AND b.art = 'Kleine Anfrage'
GROUP BY a.source_url, b.fraktion, c.category, p.date, a.titel;
filename: anfragen/all.json
format: tabson
- query: >
SELECT COUNT(DISTINCT a.id) AS num, TRIM(b.fingerprint) AS name
FROM ablauf a
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = p.source_url
WHERE b.art = 'Kleine Anfrage'
GROUP BY b.fingerprint
ORDER BY num DESC
LIMIT 15;
filename: anfragen/by_mdb.csv
format: csv
- query: >
SELECT COUNT(DISTINCT a.id) AS num, b.fraktion AS name
FROM ablauf a
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = p.source_url
WHERE b.art = 'Kleine Anfrage'
GROUP BY b.fraktion
ORDER BY num DESC
LIMIT 15;
filename: anfragen/by_fraktion.csv
format: csv
- query: >
SELECT COUNT(DISTINCT a.id) AS num, s.wort AS name
FROM ablauf a
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = p.source_url
LEFT JOIN schlagwort s ON a.source_url = s.source_url
WHERE b.art = 'Kleine Anfrage'
GROUP BY s.wort
ORDER BY num DESC
LIMIT 15;
filename: anfragen/by_schlagwort.csv
format: csv
- name: Redeprotokolle
skip: true
query: >
SELECT *
FROM speech s
ORDER BY sequence ASC
filename: 'plenum/rohtranskript-{{wahlperiode}}-{{sitzung}}.csv'
format: csv
- name: Personen
query: >
SELECT *
FROM person
ORDER BY fingerprint DESC
filename: 'person.csv'
format: csv
- query: >
SELECT *
FROM ablauf
ORDER BY key DESC
filename: 'dip/ablaeufe.csv'
format: csv
- query: >
SELECT *
FROM ablauf a
LEFT JOIN position p ON p.source_url = a.source_url
ORDER BY key DESC
filename: 'dip/positionen.csv'
format: csv
- query: >
SELECT *
FROM ablauf a
LEFT JOIN position p ON p.source_url = a.source_url
LEFT JOIN beitrag b ON b.source_url = a.source_url
ORDER BY key DESC
filename: 'dip/beitraege.csv'
format: csv