forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
synonyms.rq
39 lines (39 loc) · 1.03 KB
/
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
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>
#
# List of synonyms (for use in RePEc/Ideas and maybe other applications)
#
# Uses STW descriptors as well as exact matching concepts from other thesauri
#
SELECT DISTINCT ?concept (str(?prefLabel) AS ?conceptLabel) (lcase(str(?label)) AS ?synonym)
WHERE {
VALUES ( ?language ) {
( "en" )
}
?concept a zbwext:Descriptor ;
skos:prefLabel ?prefLabel .
FILTER (lang(?prefLabel) = ?language)
{
# include all labels from STW
{
?concept skos:prefLabel ?label
}
UNION
{
?concept skos:altLabel ?label
}
# include labels from matching concepts in other thesauri
UNION
{
?concept skos:exactMatch/skos:prefLabel ?label
}
UNION
{
?concept skos:exactMatch/skos:altLabel ?label
}
}
FILTER (lang(?label) = ?language)
# filter out labels which appear already as preferred labels
FILTER (lcase(?prefLabel) != lcase(?label))
}
ORDER BY ?prefLabel ?label