-
Notifications
You must be signed in to change notification settings - Fork 1
/
speakers.html
217 lines (198 loc) · 5.87 KB
/
speakers.html
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
---
layout: basic
---
{% assign rootResource = site.rootResource | rdf_get %}
{% capture persons_query %}
SELECT distinct ?person
WHERE {
?resourceUri schema:subEvent ?subEvent .
?subEvent schema:subEvent ?session ;
rdfs:label ?eventTitle ;
dct:date ?date .
?session schema:location ?location ;
schema:startTime ?session_start ;
schema:endTime ?session_end ;
dct:title ?session_name ;
schema:subEvent ?talk .
?talk dct:title ?talk_title ;
schema:performer ?person ;
schema:startTime ?start ;
schema:endTime ?end .
OPTIONAL {
Select distinct ?person ?affiliation where {
{
?person a <http://schema.org/Person> ;
schema:affiliation ?affiliation .
} union
{
?person a <http://schema.org/Person> ;
schema:memberOf ?affiliation .
}}
}
}
order by ASC(?person)
{% endcapture %}
{% capture dates_query %}
SELECT distinct ?ds WHERE {
?rd a <https://dataweek.de/#RoomDay> ;
dct:date ?ds .
} order by ASC(?ds)
{% endcapture %}
{% capture affiliations_query %}
SELECT distinct ?al ?affiliation WHERE {
{
?person a <http://schema.org/Person> ;
<http://xmlns.com/foaf/0.1/name> ?name ;
schema:affiliation ?affiliation .
?event a schema:Event ;
schema:performer ?person .
?affiliation rdfs:label ?al .
FILTER(langMatches(lang(?al), "{{ site.language }}"))
}
UNION
{
?person a <http://schema.org/Person> ;
<http://xmlns.com/foaf/0.1/name> ?name ;
schema:memberOf ?affiliation .
?event a schema:Event ;
schema:performer ?person .
?affiliation rdfs:label ?al .
FILTER(langMatches(lang(?al), "{{ site.language }}"))
}
} order by ASC(lcase(?al))
{% endcapture %}
{% capture details1_query %}
SELECT distinct (GROUP_CONCAT(distinct ?date;SEPARATOR=" ") as ?dates)
WHERE {
<{{ rootResource }}> schema:subEvent ?subEvent .
?subEvent schema:subEvent ?session ;
dct:date ?date .
?session schema:subEvent ?talk .
?talk dct:title ?talk_title ;
schema:performer ?person .
filter (?person = ?resourceUri)
}
order by ASC(?person)
{% endcapture %}
{% capture details2_query %}
SELECT distinct (GROUP_CONCAT(distinct ?affiliation;SEPARATOR=" ") as ?affiliations)
WHERE {
<{{ rootResource }}> schema:subEvent ?subEvent .
?subEvent schema:subEvent ?session .
?session schema:subEvent ?talk .
?talk dct:title ?talk_title ;
schema:performer ?person .
OPTIONAL {
Select distinct ?person ?affiliation where {
{
?person a schema:Person ;
schema:affiliation ?affiliation .
} union
{
?person a schema:Person ;
schema:memberOf ?affiliation .
} }
}
filter (?person = ?resourceUri)
}
order by ASC(?person)
{% endcapture %}
<script type="text/javascript">
function filterSpeakers() {
var affiliation = document.getElementById("speaker_form-select_affiliation").value;
var date = document.getElementById("speaker_form-select_date").value;
var ul = document.getElementById("speaker_ul_list");
if (!affiliation && !date) {
for (let li of ul.children) {
li.style.display = "";
}
return;
}
for (let li of ul.children) {
var local_affiliations = li.attributes["data-affiliations"].value;
var local_dates = li.attributes["data-dates"].value;
var show = true;
if (affiliation) {
if (local_affiliations.indexOf(affiliation) === -1)
show = false;
}
if (show && date) {
if (local_dates.indexOf(date) === -1)
show = false;
}
if (!show)
li.style.display = "none";
else
li.style.display = "";
}
}
</script>
<div class="content-header">
<h1>
{% if site.language == 'en' %}
Our speakers
{% else %}
Unsere Vortragende
{% endif %}
</h1>
<p>
{{ rootResource | rdf_property: "schema:abstract", site.language }}
</p>
<form class="filter" action="#">
<div>
<label for="form-select1" class="hideme">Affiliation</label>
<select class="form-control" id="speaker_form-select_affiliation">
<option value="">
{% if site.language == 'en' %}
Choose affiliation
{% else %}
Affiliation wählen
{% endif %}
</option>
{% assign affiliations = rootResource | sparql_query: affiliations_query %}
{% for a in affiliations %}
<option value="{{ a.affiliation }}">
{{ a.al }}
</option>
{% endfor %}
</select>
<label for="speaker_form-select_date" class="hideme">Tag</label>
<select class="form-control" id="speaker_form-select_date">
<option value="">
{% if site.language == 'en' %}
Choose day
{% else %}
Tag wählen
{% endif %}
</option>
{% assign dates = rootResource | sparql_query: dates_query %}
{% for day in dates %}
<option value="{{ day.ds }}">
{{ day.ds }}
</option>
{% endfor %}
</select>
<button onclick="filterSpeakers()">
{% if site.language == 'en' %}
Filter speakers
{% else %}
Vortragende filtern
{% endif %}
</button>
</div>
</form>
</div>
<div class="contact-list">
<ul id="speaker_ul_list">
{% assign persons = rootResource | sparql_query: persons_query %}
{% for p in persons %}
{% assign details1 = p.person | sparql_query: details1_query %}
{% assign date = details1 | first %}
{% assign details2 = p.person | sparql_query: details2_query %}
{% assign affiliations = details2 | first %}
<li data-dates="{{ date.dates }}" data-affiliations="{{ affiliations.affiliations }}">
{% include components/person.html organizer=p.person %}
</li>
{% endfor %}
</ul>
</div>