forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathware_by_signature.rq
41 lines (39 loc) · 1.32 KB
/
ware_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
39
40
# Systematic ware category 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 (?categoryId as ?id) ?category ?categoryLabel (?signature as ?tmpSignature) ?note ?count ?countLabel
where {
graph <http://zbw.eu/beta/ware/ng> {
values ( ?language ) {
( 'de' )
}
?category dct:identifier ?categoryId ;
skos:notation ?signature ;
skos:prefLabel ?categoryLabelLang .
# remove root entry of category system
filter(?signature != 'IP')
# remove entries starting with Y (sub-classification)
filter(regex(?signature, '^[^Y]'))
#
optional {
?category zbwext:folderCount ?cnt .
bind(str(?cnt) as ?countLabel)
}
optional {
?category skos:scopeNote ?noteLang .
filter(lang(?noteLang) = ?language)
bind(str(?noteLang) as ?note)
}
filter(lang(?categoryLabelLang) = ?language)
bind(str(?categoryLabelLang) as ?categoryLabel)
}
bind(if(?cnt > 0, uri(concat('https://pm20.zbw.eu/category/ware/i/', ?categoryId)), '-') as ?count)
}
# for wares, no historical correct notation exists,
# so use category label for sorting
order by ?categoryLabel