-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtimeline.sparql
46 lines (40 loc) · 1.31 KB
/
timeline.sparql
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
#defaultView:Timeline
SELECT DISTINCT
?item ?date
(GROUP_CONCAT(DISTINCT ?name;separator="/") AS ?itemLabel)
(SAMPLE(?image) AS ?image)
(GROUP_CONCAT(DISTINCT ?creatorLabel;separator=", ") AS ?creators)
WHERE
{
{
{ ?item wdt:P31 wd:Q65966993 } # direct instances of hypertext systems
UNION
{ ?item wdt:P279 wd:Q65966993 } # specific types of hypertext systems
}
# get the first date
OPTIONAL {
{ ?item wdt:P571 ?date } UNION { ?item wdt:P580 ?date } UNION { ?item wdt:P585 ?date } UNION { ?item wdt:P577 ?date }
}
filter not exists {
{ { ?item wdt:P571 ?date2 } UNION { ?item wdt:P580 ?date2 } UNION { ?item wdt:P585 ?date2 } UNION { ?item wdt:P577 ?date2 } }
filter (?date > ?date2)
}
# all kinds of creators
OPTIONAL {
{ ?item wdt:P50 ?creator } UNION # author
{ ?item wdt:P170 ?creator } UNION # creator
{ ?item wdt:P61 ?creator } UNION # discoverer or inventor
{ ?item wdt:P178 ?creator } # developer
}
# image
OPTIONAL { ?item wdt:P18 ?image } .
# name(s)
OPTIONAL { ?item wdt:P1813 ?short } .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
?item rdfs:label ?label .
?creator rdfs:label ?creatorLabel .
} .
BIND(IF(BOUND(?short),?short,?label) AS ?name) .
} GROUP BY ?item ?date
ORDER BY ?date