forked from zbw/sparql-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
articles_by.rq
28 lines (27 loc) · 915 Bytes
/
articles_by.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
# Articles by an author (from newspapers and the like)
# adapted from https://github.com/fnielsen/scholia/blob/master/scholia/wikipedia.py
#
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#
select distinct (max(?url) as ?titleLink) ?titleLinkLabel ?publication (min(?date) as ?issued)
where {
# default: by Kim Wall
values ( ?author ?language ) {
( wd:Q36519983 "en" )
}
?work wdt:P50 ?author .
?work wdt:P1476 ?title .
?work wdt:P953 ?url .
?work wdt:P1433 ?pub .
?pub rdfs:label ?pubLang .
filter(lang(?pubLang) = ?language)
?work wdt:P577 ?dateTime .
bind(substr(str(?dateTime), 0, 11) as ?date)
bind(str(?title) as ?titleLinkLabel)
bind(str(?pubLang) as ?publication)
}
group by ?titleLink ?titleLinkLabel ?publication
order by desc(?issued)