-
Notifications
You must be signed in to change notification settings - Fork 1
/
table.sparql
61 lines (49 loc) · 1.98 KB
/
table.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#defaultView:Table
SELECT DISTINCT ?year ?name ?creators ?environments ?wikidata {
{ SELECT DISTINCT
?item
?itemLabel
?date
?end
(GROUP_CONCAT(DISTINCT ?envLabel;separator=", ") AS ?environments)
(GROUP_CONCAT(DISTINCT ?creatorLabel;separator=", ") AS ?creators)
(GROUP_CONCAT(DISTINCT ?short;separator="/") AS ?shortLabel)
WHERE
{
# hypertext systems
{ { ?item wdt:P31 wd:Q65966993 } UNION { ?item wdt:P279 wd:Q65966993 } }
# date of creation, publication etc.
{ { ?item wdt:P571 ?date } UNION { ?item wdt:P580 ?date } UNION { ?item wdt:P585 ?date } UNION { ?item wdt:P577 ?date } }
# end time
OPTIONAL { ?item wdt:P582 ?end }
# 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
}
OPTIONAL {
{ ?item wdt:P306 ?env } UNION # operating system
{ ?item wdt:P277 ?env } UNION # programming language
{ ?item wdt:P277 ?env } UNION # depends on software
{ ?item wdt:P408 ?env } UNION # software engine
{ ?item wdt:P400 ?env } # platform
}
# short name(s)
OPTIONAL { ?item wdt:P1813 ?short } .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?item rdfs:label ?itemLabel .
?creator rdfs:label ?creatorLabel .
?env rdfs:label ?envLabel .
} .
} GROUP BY ?item ?itemLabel ?date ?end }
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)
}
BIND(IF(strlen(?shortLabel)>0,CONCAT(?itemLabel," (",?shortLabel,")"),?itemLabel) AS ?name)
BIND(IF(BOUND(?end),CONCAT(STR(YEAR(?date)),"-",STR(YEAR(?end))),STR(YEAR(?date))) AS ?year)
BIND(?item as ?wikidata)
} ORDER BY ?year