-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvents.html
55 lines (50 loc) · 1.64 KB
/
Events.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
---
rdf_prefix_path: "_data/prefixes.sparql"
layout: base
---
{% include head.html page=page %}
{% capture upcomming_query %}
select ?event ?label {
?event a schema:Event;
rdfs:label ?label;
schema:startDate ?startDate .
optional { ?event schema:endDate ?endDate }
BIND(if(regex(str(?startDate), '\\d{4}-\\d\\d-\\d\\d'), xsd:dateTime(?startDate), ?startDate) as ?startDateDT )
BIND(if(regex(str(?endDate), '\\d{4}-\\d\\d-\\d\\d'), xsd:dateTime(?endDate), ?endDate) as ?endDateDT )
filter(?startDateDT > now() || ?endDateDT > now())
}
ORDER BY DESC(?startDateDT) DESC(?endDateDT)
{% endcapture %}
{% capture past_query %}
select ?event ?label {
?event a schema:Event;
rdfs:label ?label;
schema:startDate ?startDate .
BIND( (if(regex(str(?startDate), '\\d{4}-\\d\\d-\\d\\d'), xsd:dateTime(?startDate), ?startDate)) as ?startDateDT )
filter(now() > ?startDateDT)
} ORDER BY DESC(?startDateDT)
{% endcapture %}
<section class="section">
<h3 class="title is-3">Upcoming Events</h3>
{% assign events = page.rdf | sparql_query: upcomming_query %}
{% for event in events %}
<section class="section">
<h4>{{ event.label }}</h4>
<p>{{ event.event | rdf_property: "dct:abstract" }}
<a href="{{ event.event.render_path | relativize_url }}">Read more about {{ event.label }}</a>
</p>
</section>
{% endfor %}
</section>
<section class="section">
<h3 class="title is-3">Past Events</h3>
{% assign events = page.rdf | sparql_query: past_query %}
<div class="content">
<ul>
{% for event in events %}
<li><a href="{{ event.event.render_path | relativize_url }}">{{ event.label }}</a></li>
{% endfor %}
</ul>
</div>
</section>
{% include foot.html page=page %}