forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlookup_by_repec.rq
32 lines (31 loc) · 1.04 KB
/
lookup_by_repec.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
# Lookup wikidata URI, label and en+de wikipedia site links by RePEc id
#
# Must use SPARQL GET request (wikidata does not support POST -
# see https://phabricator.wikimedia.org/T112151)
#
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#
select ?repecId ?wd ?wdLabel ?sitelink
where {
# RePEc ID of Janet Currie and Peter Nijkamp
values ( ?repecId ) {
( 'pcu13' )
( 'pni111' )
}
# look up wikidata items and labels
?wd wdt:P2428 ?repecId ;
rdfs:label ?wdLabel .
#
# get site links (only from de/en wikipedia sites)
?sitelink schema:about ?wd ;
schema:inLanguage ?language .
filter (contains(str(?sitelink), 'wikipedia'))
filter (lang(?wdLabel) = ?language && ?language in ('en', 'de'))
}