forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsk_wd_mapping.rq
53 lines (52 loc) · 1.69 KB
/
sk_wd_mapping.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
# Mapping of the industry category system to WD
#
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
select distinct ?notationLabel ?concept ?conceptLabel ?rel (?relChr as ?relLabel) ?wd ?wdLabel ?naceCode
where {
values ( ?rel ?relChr ) {
(skos:exactMatch "=")
(skos:narrowMatch ">")
(skos:broadMatch "<")
(skos:closeMatch "*")
(skos:relatedMatch "^")
}
graph <http://zbw.eu/beta/sk/ng> {
?concept a skos:Concept ;
?rel ?wd ;
skos:notation ?notationLabel .
filter(strstarts(str(?wd), str(wd:)))
bind(uri(concat('http://zbw.eu/beta/pm20sig/geo/', ?notationLabel)) as ?notation)
#
optional {
?concept skos:prefLabel ?conceptLabelDe .
filter(lang( ?conceptLabelDe) = 'de')
}
optional {
?concept skos:prefLabel ?conceptLabelEn .
filter(lang( ?conceptLabelEn) = 'en')
}
bind(concat(if(bound(?conceptLabelDe), str(?conceptLabelDe), ''), ' | ', if(bound(?conceptLabelEn), str(?conceptLabelEn), '')) as ?conceptLabel)
}
graph <http://zbw.eu/beta/wikidata/ng> {
optional {
?wd rdfs:label ?wdLabelDe .
filter(lang( ?wdLabelDe) = 'de')
}
optional {
?wd rdfs:label ?wdLabelEn .
filter(lang( ?wdLabelEn) = 'en')
}
bind(concat(if(bound(?wdLabelDe), str(?wdLabelDe), ''), ' | ', if(bound(?wdLabelEn), str(?wdLabelEn), '')) as ?wdLabel)
}
optional {
service <https://query.wikidata.org/sparql> {
?wd wdt:P4496 ?naceCode .
}
}
}
order by ?notationLabel