-
Notifications
You must be signed in to change notification settings - Fork 14
/
map_specific_topics.py
837 lines (825 loc) · 18.1 KB
/
map_specific_topics.py
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
tags = {
'accessibility': 'Accessibility',
'activism': 'Activism',
'agenda': 'Agenda Formation',
'animal': 'Animal Protection & Welfare',
'architecture': 'Architecture & Design',
'capacity': 'Capacity Building',
'civic_infra': 'Civic Infrastructure',
'civic_roles': 'Civic Roles & Powers',
'civil': 'Civil Infrastructure',
'conflict': 'Conflict Resolution',
'decision': 'Decision-Making',
'democratic': 'Democratic Innovation',
'dialogue': 'Dialogue & Deliberation',
'digital': 'Digital/New Technologies',
'direct': 'Direct Action',
'educational': 'Educational Resources & Opportunities',
'empowerment': 'Empowerment',
'environment': 'Environment',
'formal': 'Formal/Structured Participation',
'gender': 'Gender',
'global': 'Global Affairs',
'human': 'Human Rights',
'inclusiveness': 'Inclusiveness',
'indigenous': 'Indigenous Issues',
'informal': 'Informal Participation',
'internal': 'Internal- & Self-Management',
'initiative': 'Initiative Process',
'mapping': 'Mapping & Analysis',
'online': 'Online',
'oversight': 'Oversight & Monitoring',
'participatory': 'Participatory Budgeting',
'planning': 'Planning & Development',
'political': 'Political Institutions',
'public_opinion': 'Public Opinion',
'public_services': 'Public Services',
'race': 'Race',
'research': 'Research/Study',
'rural': 'Rural',
'science': 'Science Communication',
'social_media': 'Social Media',
'social_welfare': 'Social Welfare',
'stateholder': 'Stakeholder Engagement',
'storytelling': 'Storytelling',
'sustainability': 'Sustainability & Green Living',
'transparency': 'Transparency & Accountability',
'urban': 'Urban',
'youth': 'Youth & Student Engagement'
}
# ensure these are absolutely in the same order
tag_keys = [tag[0] for tag in sorted(tags.items())]
tag_values = [tag[1] for tag in sorted(tags.items())]
tags_used = '''1st amendment
Accessibility
Achitect
active citizens
activism
Activism
Agenda Formation
Agriculture
airesis
alpine environment
'Americans Elect' 'Colton Schweitzer' 'Tony Elia'
Animal Protection & Welfare
applied innovation
Architecture & Design
arquitectura
art
assembly
association
australia
Australia DirectDemocracy
autonomous regions
Autonomy
Backbone Campaign
big data
bilancio partecipativo
Blasphemy Laws
Bürgerbeteiligung
Bürgerhaushalt
California Citizens Redistrciting Commission Proposition 11 Voters First Act Senate Assembly Board of Equalization
Canada
canadian
capacity building
Capacity Building
capacity planning
change
changeagent
changeagents
children
CIR
Citizen Deliberation
citizen engagement
citizen panel
Citizen Participation
citizens
citizens assembly
Citizens for Democracy
Citizens Initiative Review
citizens jury
citizens'' jury
Citizen Wisdom Council
city council
Civic Council
civic engagement
civic engagement digital participation planning public
Civic Infrastructure
civic participation
Civic Roles & Powers
civic studies
civic tech
Civil Infrastructure
civil society group
climate
coalition
co-creation
co-design
collaboration
collaborative governance
Communities
community
community-academic partnership
Community and Voluntray Sector
community based organization
Community-based participatory research
community capacity building
community development
Community Development
community-engaged scholarship
community engagement
community engagements
Community Places
Community Planning
comune
comune italiano
Conflict Resolution
Consciousness-raising
consensus conference
conservatism
Constitution
coopertion
copyright
corporate social responsibility
corruption
Creative Insight council
critical reporting
Crowdmapping
Crowdsourcing
culture
david mathews center for civic live engagement deliberation alabama
decision making
Decision-Making
deeper democracy
deliberation
Deliberative
deliberative democracy
democracy
Democracy
democratic accountability
Democratic Experimentation
Democratici Diretti
Democratic Innovation
democrazia partecipativa
demopart
Development
development projects
Dialog Digital
dialogue
Dialogue & Deliberation
digital divide
digitalengagement
digital engagement
Digital/New Technologies
Direct Action
Direct Democracy
diseño Colaborativo
Diseño participativo
diseño social
dissent
Dynamic Facilitation
dynamic governance
easw
economic empowerment
Economic Justice
edem
edemocracy
e-democracy
education
Educational Resources & Opportunities
egovernment
e-government
Empowerment
energy
Engagement
Environment
environmental conflicts
environmental impact assessment studies
environmental justice
Environmental Justice
eparticipation
e-participation
Equality
Europe
european awarness scenario workshop
evolution
EZLN
Facebook application
facilitation
facilitator
federalism
film
finance
Finland
Formal/Structured Participation
foundation
freedom of expression
freedom of speech
Freerz
Freerz Community
Freerz Manifesto
gamification
Gender
Global Affairs
global warming
Government
grassroots
grassroots democracy
health
health care
http://www.studycircles.net.au/
Human Rights
ICT
idea management
IKEK
Inclusive
inclusive decision making
Inclusiveness (from DemocracySpot)
Inclussiveness
india
indigenous
Indigenous Issues
Informal Participation
Initiative Process
Inovacción ciudadana
Internal- & Self-Management
international education
internet
interplay
#IPDConf2018
ISEK
italia
italy
journalism
languages
large scale consultations
Latin America
law
lawmaking
law-making
legal affairs
legislative information
local authority
local economy
local government
local self-reliance
Love
Mapping & Analysis
maps
media
medicine
meta-theory
minorities
mission humanitaire
mission humanitaire afrique
mockery
money
Movement
MoveOn Move On
nanotechnology
net neutrality
network
NGO
non-governmental
Occupy
Occupy Wall Street
OCCUPY Wall Street
Öffentlichkeitsbeteiligung
online
Online
online deliberation
Online Democracy
online discussion
online forum
open access
open democracy
open government
Open Policy Making
open space technology
organization
Oversight & Monitoring
Pakistan
parliamentary informatics
partecipazione
participación ciudadana
participación comunitaria
participation
Participatory
participatory budget
participatory budgeting
Participatory Budgeting
Participatory democracy
particpatory democracy
Partizipation
patient-centred health care
performance monitoring
personality
pirate parties
planner
Planning & Development
platform
police accountability
policy development
Political Institutions
politics
Portugal
privacy
procedural competencies
Proces
process designer
processi decisionali inclusivi
professional organization
project Cycle management
protest
public consultation
public education
public engagement
publicengmt
Public Opinion
public participation
Public Services
Race
racism
Radical Feminism
regional authority
republicanism
research
Research/Study
responsabilità sociale
reunion
revolution
Revoution
Rural
Science Communication
science public engagement participation
SDD
service-learning
shop local
Shoreline Master Program SMP SMA Update
small business
social innovation
social justice
Social Justice
Social Media
social movement
social research
social ventures
Social Welfare
society
sociocracy
socio-economic research
software
Stadtplanung
stakeholder engagement
Stakeholder Engagement
Statewide convener
Storytelling
structured dialogic design
stub
student-led
Super PAC
sussidiarietà
sustainability
Sustainability & Green Living
sweden
Teaching Tool Student Engagement
Technology
temporary project syndicate
theory on procedures
toolbox
toscana
town council
town meeting
Transparency & Accountability
Tunisia
tuscan
tuscany
Umbrella Group
Unemployment
Union
Urban
urban politics
US politics
video
voluntary
Vote
Voters
Voting
voting rights
voyage humanitaire
white supremacist
wiki
Wisdom Council
wise democracy
WWViews
www.deborda.org
young people community participation UK
youth
youth development
youth engagement
Youth Participation
#youth #politics #civicengagement #canada
#youth #politics #civicengagement #kenya
Youth & Student Engagement
Youth & Student Engagment'''.splitlines()
delete_tags = [
"1st amendment",
"airesis",
"alpine environment",
"$_$'Americans Elect' 'Colton Schweitzer' 'Tony Elia'$_$",
"applied innovation",
"art",
"assembly",
"association",
"autonomous regions",
"Autonomy",
"australia",
"Australia DirectDemocracy",
"Backbone Campaign",
"big data",
"bilancio partecipativo",
"Blasphemy Laws",
"Bürgerbeteiligung",
"Bürgerhaushalt",
"California Citizens Redistrciting Commission Proposition 11 Voters First Act Senate Assembly Board of Equalization",
"Canada",
"canadian",
"change",
"changeagent",
"changeagents",
"CIR",
"Citizen Deliberation",
"citizen engagement",
"citizen panel",
"Citizen Participation",
"citizens",
"citizens assembly",
"Citizens for Democracy",
"Citizens Initiative Review",
"citizens jury",
"citizens'' jury",
"Citizen Wisdom Council",
"city council",
"Civic Council",
"climate",
"coalition",
"co-creation",
"co-design",
"collaboration",
"collaborative governance",
"Communities",
"community",
"community-academic partnership",
"Community and Voluntray Sector",
"community based organization",
"Community-based participatory research",
"community capacity building",
"community development",
"Community Development",
"community-engaged scholarship",
"community engagement",
"community engagements",
"Community Places",
"Community Planning",
"comune",
"comune italiano",
"Conflict Resolution",
"Consciousness-raising",
"consensus conference",
"conservatism",
"Constitution",
"coopertion",
"copyright",
"corporate social responsibility",
"corruption",
"Creative Insight council",
"critical reporting",
"Crowdmapping",
"Crowdsourcing",
"culture",
"david mathews center for civic live engagement deliberation alabama",
"decision making",
"Decision-Making",
"deeper democracy",
"deliberation",
"Deliberative",
"Democratici Diretti",
"democrazia partecipativa",
"demopart",
"Development",
"development projects",
"diseño Colaborativo",
"Diseño participativo",
"diseño social",
"dissent",
"Dynamic Facilitation",
"dynamic governance",
"easw",
"Economic Justice",
"edem",
"edemocracy",
"e-democracy",
"egovernment",
"e-government",
"energy",
"Engagement",
"eparticipation",
"e-participation",
"Equality",
"Europe",
"european awarness scenario workshop",
"evolution",
"EZLN",
"Facebook application",
"facilitation",
"facilitator",
"federalism",
"film",
"finance",
"Finland",
"foundation",
"freedom of expression",
"freedom of speech",
"Freerz",
"Freerz Community",
"Freerz Manifesto",
"gamification",
"global warming",
"Government",
"grassroots",
"grassroots democracy",
"health",
"health care",
"http://www.studycircles.net.au/",
"ICT",
"idea management",
"IKEK",
"india",
"Initiative Process",
"Inovacción ciudadana",
"international education",
"internet",
"interplay",
"#IPDConf2018",
"ISEK",
"italia",
"italy",
"journalism",
"languages",
"large scale consultations",
"Latin America",
"law",
"lawmaking",
"law-making",
"legal affairs",
"legislative information",
"local authority",
"local economy",
"local government",
"local self-reliance",
"Love",
"media",
"medicine",
"meta-theory",
"minorities",
"mission humanitaire",
"mission humanitaire afrique",
"mockery",
"money",
"Movement",
"MoveOn Move On",
"nanotechnology",
"net neutrality",
"network",
"NGO",
"non-governmental",
"Occupy",
"Occupy Wall Street",
"OCCUPY Wall Street",
"Öffentlichkeitsbeteiligung",
"open access",
"open democracy",
"open government",
"Open Policy Making",
"open space technology",
"organization",
"Pakistan",
"parliamentary informatics",
"partecipazione",
"participación ciudadana",
"participación comunitaria",
"participation",
"Participatory",
"Participatory democracy",
"particpatory democracy",
"Partizipation",
"patient-centred health care",
"performance monitoring",
"personality",
"pirate parties",
"planner",
"platform",
"police accountability",
"policy development",
"politics",
"Portugal",
"privacy",
"procedural competencies",
"Proces",
"process designer",
"processi decisionali inclusivi",
"professional organization",
"project Cycle management",
"protest",
"public education",
"public engagement",
"publicengmt",
"Public Opinion",
"public participation",
"Radical Feminism",
"regional authority",
"republicanism",
"responsabilità sociale",
"reunion",
"revolution",
"Revoution",
"science public engagement participation",
"SDD",
"service-learning",
"shop local",
"Shoreline Master Program SMP SMA Update",
"small business",
"social innovation",
"social justice",
"Social Justice",
"social movement",
"social research",
"social ventures",
"society",
"sociocracy",
"socio-economic research",
"software",
"Stadtplanung",
"Statewide convener",
"structured dialogic design",
"stub",
"student-led",
"Super PAC",
"sussidiarietà",
"sweden",
"Teaching Tool Student Engagement",
"Technology",
"temporary project syndicate",
"theory on procedures",
"toolbox",
"toscana",
"town council",
"town meeting",
"Tunisia",
"tuscan",
"tuscany",
"Umbrella Group",
"Unemployment",
"Union",
"US politics",
"video",
"voluntary",
"Vote",
"Voters",
"Voting",
"voting rights",
"voyage humanitaire",
"white supremacist",
"wiki",
"Wisdom Council",
"wise democracy",
"WWViews",
"www.deborda.org",
"young people community participation UK",
"youth development",
"#youth #politics #civicengagement #canada",
"#youth #politics #civicengagement #kenya"
]
reverse_map = {
"Accessibility": "accessibility",
"active citizens": "activism",
"Activism": "activism",
"Agenda Formation": "agenda",
"Agriculture": "Agriculture",
"Animal Protection & Welfare": "animal",
"Architect": "architecture",
"Architecture & Design": "architecture",
"arquitectura": "architecture",
"capacity building": "capacity",
"Capacity Building": "capacity",
"capacity planning": "capacity",
"civic engagement": "civic_roles",
"civic engagement digital participation planning public": "civic_roles",
"Civic Infrastructure": "civic_infra",
"civic participation": "civic_roles",
"Civic Roles & Powers": "civic_roles",
"civic studies": "civic_roles",
"civic tech": "civic_infra",
"Civil Infrastructure": "civil",
"civil society group": "civil",
"deliberative democracy": "democratic",
"democracy": "democratic",
"Democracy": "democratic",
"democratic accountability": "democratic",
"Democratic Experimentation": "democratic",
"Democratic Innovation": "democratic",
"Dialog Digital": "dialogue",
"dialogue": "dialogue",
"Dialogue & Deliberation": "dialogue",
"digital divide": "digital",
"digitalengagement": "digital",
"digital engagement": "digital",
"Digital/New Technologies": "digital",
"Direct Action": "direct",
"Direct Democracy": "direct",
"economic empowerment": "empowerment",
"education": "educational",
"Educational Resources & Opportunities": "educational",
"Empowerment": "empowerment",
"Environment": "environment",
"environmental conflicts": "environment",
"environmental impact assessment studies": "environment",
"environmental justice": "environment",
"Environmental Justice": "environment",
"Formal/Structured Participation": "formal",
"Gender": "gender",
"Global Affairs": "global",
"Human Rights": "human",
"Inclusive": "inclusiveness",
"inclusive decision making": "inclusiveness",
"Inclusiveness (from DemocracySpot)": "inclusiveness",
"Inclussiveness": "inclusiveness",
"indigenous": "indigenous",
"Indigenous Issues": "indigenous",
"Informal Participation": "informal",
"Internal- & Self-Management": "internal",
"Mapping & Analysis": "mapping",
"maps": "mapping",
"online": "online",
"Online": "online",
"online deliberation": "online",
"Online Democracy": "online",
"online discussion": "online",
"online forum": "online",
"Oversight & Monitoring": "oversight",
"participatory budget": "participatory",
"participatory budgeting": "participatory",
"Participatory Budgeting": "participatory",
"Planning & Development": "planning",
"Political Institutions": "political",
"public consultation": "public_opinion",
"Public Services": "public_services",
"Race": "race",
"racism": "race",
"research": "research",
"Research/Study": "research",
"Rural": "rural",
"Science Communication": "science",
"Social Media": "social_media",
"Social Welfare": "social_welfare",
"stakeholder engagement": "stakeholder",
"Stakeholder Engagement": "stakeholder",
"Storytelling": "storytelling",
"sustainability": "sustainability",
"Sustainability & Green Living": "sustainability",
"Transparency & Accountability": "transparency",
"Urban": "urban",
"urban politics": "urban",
"youth": "youth",
"youth engagement": "youth",
"Youth Participation": "youth",
"Youth & Student Engagement": "youth",
"Youth & Student Engagment": "youth",
"children": "youth"
}
# write out the valid tag fields (keys) for tags table, in guaranteed order (alpha by key)
print("CREATE TABLE tags_localized (")
print(" language TEXT NOT NULL,")
for tag_name in tag_keys:
print(" %s TEXT DEFAULT 'Localized %s'," % (tag_name, tag_name))
print(");")
print()
# write out the valid localized values for tags table, in guaranteed order (alpha by key)
print("INSERT INTO tags_localized VALUES(")
print(" 'en',")
for tag_value in tag_values:
print(" '%s'," % tag_value)
print(");")
print()
# write out the tag deletion rules for tags not supported at all, in things.tag
for tag in delete_tags:
print("update things set tags = array_remove(tags, '%s');" % tag)
print()
# write out the tag mapping rules, from pre-localized to valid tag, in things.tag
for key, value in reverse_map.items():
print("update things set tags = array_replace(tags, '%s', '%s');" % (key, value))
print()
# write function to map things.keys to localized_values {key: keyLookup: value:} objects, i.e., a specialized form of get_localized_list()
# DONE
# remove any duplicates in things.tags
# Test to make sure all tags fields return valid sets, with no duplicates