-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdata_files.proto
152 lines (121 loc) · 2.84 KB
/
data_files.proto
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
syntax = "proto3";
// articles
message StatisticRow {
float statval = 1;
repeated int32 ordinal_by_universe = 2;
repeated int32 percentile_by_population_by_universe = 4;
}
message FirstOrLast {
// index into article.rows
int32 article_row_idx = 1;
// index into article.universes
int32 article_universes_idx = 2;
bool is_first = 3;
}
message RelatedButton {
string longname = 1;
string shortname = 2;
string row_type = 3;
}
message RelatedButtons {
string relationship_type = 1;
repeated RelatedButton buttons = 2;
}
message Histogram {
float bin_min = 1;
float bin_size = 2;
// the counts are normalized to sum to 2**16
repeated int32 counts = 3;
}
message TimeSeries {
repeated float values = 1;
}
message ExtraStatistic {
optional Histogram histogram = 1;
optional TimeSeries timeseries = 2;
}
message Article {
string shortname = 1;
string longname = 2;
string source = 3;
string article_type = 4;
bytes statistic_indices_packed = 9;
repeated StatisticRow rows = 5;
repeated FirstOrLast overall_first_or_last = 10;
repeated RelatedButtons related = 6;
repeated string universes = 7;
repeated ExtraStatistic extra_stats = 8;
}
// geojson
message Coordinate {
float lon = 1;
float lat = 2;
}
message Ring {
repeated Coordinate coords = 1;
}
message Polygon {
repeated Ring rings = 1;
}
message MultiPolygon {
repeated Polygon polygons = 1;
}
message Feature {
oneof geometry {
Polygon polygon = 1;
MultiPolygon multipolygon = 2;
}
repeated int32 zones = 3;
float center_lon = 4;
}
// string lists
message StringList {
repeated string elements = 1;
}
message SearchIndex {
repeated string elements = 1;
repeated uint32 priorities = 2;
}
message OrderList {
repeated int32 order_idxs = 1;
}
message DataList {
repeated float value = 1;
repeated int32 population_percentile = 2;
}
message OrderLists {
repeated string statnames = 1;
repeated OrderList order_lists = 2;
}
message DataLists {
repeated string statnames = 1;
repeated DataList data_lists = 2;
}
// unified result
message AllStats {
repeated float stats = 1;
}
message ConsolidatedShapes {
repeated string longnames = 1;
repeated Feature shapes = 2;
}
message ConsolidatedStatistics {
repeated string longnames = 1;
repeated string shortnames = 2;
repeated AllStats stats = 3;
}
// quiz sampling data
message QuizDataForStat {
repeated float stats = 1;
}
message QuizFullData {
repeated QuizDataForStat stats = 1;
}
message QuizQuestionTronche {
repeated int32 geography_a = 1;
repeated int32 geography_b = 2;
repeated int32 stat = 3;
// probability within tronche
int32 neg_log_prob_x10_basis = 4;
repeated int32 neg_log_prob_x10_minus_basis = 5;
}