query-41fa2611aa50522efa194a97e981b646
Things called "cancer", ordered by number of sitelinks
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?itemLabel ?item ?itemDescription ?sites WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "EntitySearch" .
bd:serviceParam wikibase:endpoint "www.wikidata.org" .
bd:serviceParam mwapi:search "cancer" .
bd:serviceParam mwapi:language "en" .
?item wikibase:apiOutputItem mwapi:item
}
?item wikibase:sitelinks ?sites.
MINUS {?item wdt:P31 wd:Q4167410} # Exclude Wikimedia disambiguation pages
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
} ORDER BY DESC(?sites)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?sites"):::projected
c6(["www.wikidata.org"]):::literal
c15(["wd:Q4167410"]):::iri
c12(["mwapi:item"]):::iri
c10(["en"]):::literal
c2(["bd:serviceParam"]):::iri
c4(["EntitySearch"]):::literal
c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["cancer"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:api"--> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:search"--> c8
c2 --"mwapi:language"--> c10
v2 --"mwapi:apiOutputItem"--> c12
end
v2 --"mwapi:sitelinks"--> v1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> c15
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c2 --"mwapi:language"--> c17
end