-
Notifications
You must be signed in to change notification settings - Fork 3
/
periods-as-csv.rq
76 lines (74 loc) · 2.06 KB
/
periods-as-csv.rq
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
prefix dc: <http://purl.org/dc/terms/>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix periodo: <http://n2t.net/ark:/99152/p0v#>
prefix prov: <http://www.w3.org/ns/prov#>
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix time: <http://www.w3.org/2006/time#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
(?concept as ?period)
(group_concat(distinct ?labels;separator='|') as ?label)
(group_concat(distinct ?places;separator=' | ') as ?spatial_coverage)
# (group_concat(distinct ?place_uri;separator=' ') as ?gazetteer_links)
(xsd:integer(group_concat(distinct ?starts;separator='|')) as ?start)
(group_concat(distinct ?stops;separator='|') as ?stop)
(group_concat(distinct ?scheme;separator='|') as ?authority)
(group_concat(distinct ?sources;separator=' | ') as ?source)
(group_concat(distinct ?issued;separator='|') as ?publication_year)
# (group_concat(distinct ?derived;separator=' ') as ?derived_periods)
(group_concat(distinct ?broader;separator=' ') as ?broader_periods)
(group_concat(distinct ?narrower;separator=' ') as ?narrower_periods)
WHERE {
?concept a skos:Concept ;
skos:prefLabel ?labels ;
skos:inScheme ?scheme
.
OPTIONAL {
?scheme
dc:source/dc:isPartOf? [
dc:title|((dc:creator|dc:contributor)/foaf:name) ?sources
]
.
}
OPTIONAL {
?scheme
dc:source/dc:isPartOf? [
dc:issued ?issued
]
.
}
OPTIONAL {
?concept
periodo:spatialCoverageDescription|(dc:spatial/skos:prefLabel)
?places
.
}
# OPTIONAL {
# ?concept dc:spatial ?place_uri .
# }
OPTIONAL {
?concept
time:intervalStartedBy/time:hasDateTimeDescription [
(time:year|periodo:earliestYear) ?starts
]
.
}
OPTIONAL {
?concept
time:intervalFinishedBy/time:hasDateTimeDescription [
(time:year|periodo:latestYear) ?stops
]
.
}
# OPTIONAL {
# ?derived prov:wasDerivedFrom ?concept .
# }
OPTIONAL {
?concept skos:broader ?broader .
}
OPTIONAL {
?narrower skos:broader ?concept .
}
}
GROUP BY ?concept
ORDER BY ?publication_year ?source ?spatial_coverage ?start