forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeo_by_signature.rq
39 lines (38 loc) · 1.41 KB
/
geo_by_signature.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
# Systematic country list
#
PREFIX schema: <http://schema.org/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#
select (?countryId as ?id) ?notationLong ?signature ?country ?countryLabel ?note ?shCount ?shCountLabel ?waCount ?waCountLabel
where {
graph <http://zbw.eu/beta/geo/ng> {
values ( ?language ) {
( 'de' )
}
?country dct:identifier ?countryId ;
skos:notation ?signature ;
zbwext:notationLong ?notationLong ;
skos:prefLabel ?countryLabelLang .
optional {
?country zbwext:shFolderCount ?shCnt .
bind(str(?shCnt) as ?shCountLabel)
}
optional {
?country zbwext:waFolderCount ?waCnt .
bind(str(?waCnt) as ?waCountLabel)
}
optional {
?country skos:scopeNote ?noteLang .
filter(lang(?noteLang) = ?language)
bind(str(?noteLang) as ?note)
}
filter(lang(?countryLabelLang) = ?language)
bind(str(?countryLabelLang) as ?countryLabel)
}
bind(if(?shCnt > 0, uri(concat('https://pm20.zbw.eu/category/geo/i/', ?countryId, '/about.', ?language, '.html#sacharchiv')), '-') as ?shCount)
bind(if(?waCnt > 0, uri(concat('https://pm20.zbw.eu/category/geo/i/', ?countryId, '/about.', ?language, '.html#warenarchiv')), '-') as ?waCount)
}
order by ?notationLong