query-3b6ae7933e86b7bec7e3c0d0a7f92ff1
select nber articles with one single author (author as a string),
select economists
join economist name with single author string.
without the limit, we're in timeout.
SELECT $item $count ?author_name $a WHERE { # FILTER REGEX(STR(?count), "^[1]{1}$") FILTER (?count = 1) { SELECT DISTINCT ?item (COUNT (?author) as ?count) WHERE { ?item wdt:P31 wd:Q13442814 ; wdt:P179 wd:Q57081850 . ?item wdt:P2093 ?author. } GROUP BY (?item) } { SELECT DISTINCT ?item (xsd:string(?author) AS ?author_name) WHERE { ?item wdt:P31 wd:Q13442814 ; wdt:P179 wd:Q57081850 . ?item wdt:P2093 ?author. } } { SELECT (xsd:string(?author) AS ?author_name) $a WHERE { ?a wdt:P31 wd:Q5; wdt:P106 wd:Q188094; rdfs:label ?author . FILTER(LANG(?author) IN ("en")) . } LIMIT 3000 } }
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# select nber articles with one single author (author as a string),
# select economists
# join economist name with single author string.
# without the limit, we're in timeout.
SELECT $item $count ?author_name $a WHERE {
# FILTER REGEX(STR(?count), "^[1]{1}$")
FILTER (?count = 1)
{
SELECT DISTINCT ?item (COUNT (?author) as ?count) WHERE {
?item wdt:P31 wd:Q13442814 ; wdt:P179 wd:Q57081850 .
?item wdt:P2093 ?author.
}
GROUP BY (?item)
}
{
SELECT DISTINCT ?item (xsd:string(?author) AS ?author_name) WHERE {
?item wdt:P31 wd:Q13442814 ; wdt:P179 wd:Q57081850 .
?item wdt:P2093 ?author.
}
}
{
SELECT (xsd:string(?author) AS ?author_name) $a WHERE {
?a wdt:P31 wd:Q5;
wdt:P106 wd:Q188094;
rdfs:label ?author .
FILTER(LANG(?author) IN ("en")) .
}
LIMIT 3000
}
}