forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubject_by_signature.rq
39 lines (38 loc) · 1.22 KB
/
subject_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 subject 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) ?notationLong ?signature ?category ?categoryLabel ?note ?countLabel
where {
graph <http://zbw.eu/beta/subject/ng> {
values ( ?language ) {
( 'de' )
}
?category dct:identifier ?categoryId ;
skos:notation ?signature ;
zbwext:notationLong ?notationLong ;
skos:prefLabel ?categoryLabelLang .
# remove root entry of category system
filter(?signature != 'JE')
# TODO temporarily remove entries not starting with [a-z]
filter(regex(?signature, '^[a-z]'))
#
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, ?cnt, '-') as ?count)
}
order by ?notationLong