query-30f5297e4f1251b09c68dfc88cff41e4
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?article ?result WHERE
{
?item wdt:P27 wd:Q664.
{?item wdt:P496 [].} # has an ORCId
UNION # and/or
{?university wdt:P31/wdt:P279* wd:Q4671277. hint:Prior hint:gearing "forward".
?item wdt:P108 ?university.} # employed by an academic institution
UNION # and/or
{ VALUES ?profession {wd:Q1650915 wd:Q66666607} # occupation is researcher or academic
?item wdt:P106/wdt:P279* ?profession . hint:Prior hint:gearing "forward".}
OPTIONAL { # get en-wiki articles having a Scholia template
SELECT ?item ?pageid ?ns WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:generator "search" .
bd:serviceParam mwapi:gsrsearch "hastemplate:"Scholia"" .
bd:serviceParam mwapi:gsrlimit "max" .
?item wikibase:apiOutputItem mwapi:item .
?ns wikibase:apiOutput "@ns" .
}
} LIMIT 10000
}
OPTIONAL { # ?item might have an EN wiki article
?article schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/>
}
FILTER EXISTS {?paper wdt:P31/wdt:P279* wd:Q732577. # things that are publications
hint:Prior hint:gearing "forward".
?paper wdt:P50|wdt:P98 ?item . # is the author or editor of a publication
}
BIND(IF(BOUND(?ns)&&BOUND(?article),"Has scholia",
IF(BOUND(?article),"Scholia missing","No article")) as ?result)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}