forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpm20_mnm_synonyms.rq
51 lines (50 loc) · 1.44 KB
/
pm20_mnm_synonyms.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
# Plain list of synonyms by id for Mix-n-match (for co)
#
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX frapo: <http://purl.org/cerif/frapo/>
PREFIX schema: <http://schema.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
select distinct ?id (lcase(?label) as ?synonym)
where {
values ( ?language ?filterLang ) {
( 'de' 'und')
}
# query restricts result to folders with documents
?pm20 a zbwext:CompanyFolder ;
dct:identifier ?id ;
zbwext:adjustedLabel ?name ;
frapo:hasCountryCode ?country ;
zbwext:totalDocCount ?docCount .
#
# this is the filter for defining the separate mnm catalogs (parts)
bind(
if(?country in ('NL', 'ID', 'AO'), 'nl',
if(?country in ('GB', 'US', 'CA', 'AU', 'ZA', 'IE', 'MY', 'ZW'), 'en',
if(?country in ('FR', 'VN', 'BE', 'CD', 'LU', 'DZ'), 'fr',
if(?country in ('DE', 'AT', 'CH', 'HU', 'TZ', 'PL', 'CZ', 'WS'), 'de',
'und')))) as ?wikiLang)
filter(?wikiLang = ?filterLang)
{
# include all (not adjusted) labels
# (this leaves out the names of companies with an own GND)
{
?pm20 skos:prefLabel ?prefLabel ;
}
union
{
?pm20 skos:altLabel ?label ;
}
union
{
?pm20 skos:altLabel ?label ;
}
union
{
?pm20 zbwext:includesInstitutionNamed/schema:name ?label ;
}
}
filter(?label != ?name)
}
order by ?id ?synonym