query-aed597344ae6ab6142dcda5bfb1b4b65

rq turtle/ttl

Malaysian subjects with no Malay article in Wikipedia

SELECT ?item ?itemLabel ?cnt WHERE { { SELECT ?item (COUNT(?sitelink) AS ?cnt) WHERE { ?item wdt:P27|wdt:P205|wdt:P17 wd:Q833 . #Malaysian subjects. MINUS {?item wdt:P106 wd:Q488111 .} #Minus occupations that would be inappropriate in most situations. MINUS {?item wdt:P106 wd:Q3286043 .} MINUS {?item wdt:P106 wd:Q4610556 .}
?sitelink schema:about ?item . FILTER NOT EXISTS { ?article schema:about ?item . ?article schema:isPartOf https://ms.wikipedia.org/ . #Targeting Wikipedia language where subjects has no article. } } GROUP BY ?item ORDER BY DESC (?cnt) #Sorted by amount of articles in other languages. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ms,en,zh,ta" } #Service to resolve labels in (fallback) languages: automatic user language, Malay, English, Chinese, Tamil. } ORDER BY DESC (?cnt)

Use at

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#>
#Malaysian subjects with no Malay article in Wikipedia

SELECT ?item ?itemLabel ?cnt WHERE {
{
  SELECT ?item (COUNT(?sitelink) AS ?cnt) WHERE { 
  ?item wdt:P27|wdt:P205|wdt:P17 wd:Q833 . #Malaysian subjects.
  MINUS {?item wdt:P106 wd:Q488111 .} #Minus occupations that would be inappropriate in most situations.
  MINUS {?item wdt:P106 wd:Q3286043 .}
  MINUS {?item wdt:P106 wd:Q4610556 .}  
  ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:isPartOf <https://ms.wikipedia.org/> . #Targeting Wikipedia language where subjects has no article.
  }
  } GROUP BY ?item ORDER BY DESC (?cnt) #Sorted by amount of articles in other languages.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ms,en,zh,ta" }  #Service to resolve labels in (fallback) languages: automatic user language, Malay, English, Chinese, Tamil.
} ORDER BY DESC (?cnt)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?article") v5("?cnt"):::projected v3("?item"):::projected v4("?sitelink") c11(["wd:Q4610556"]):::iri c3([https://ms.wikipedia.org/]):::iri c10(["wd:Q3286043"]):::iri c13(["bd:serviceParam"]):::iri c9(["wd:Q488111"]):::iri c5(["wd:Q833"]):::iri c15(["#91;AUTO_LANGUAGE#93;,ms,en,zh,ta"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:isPartOf"--> e0c3 e0v1("?article"):::projected e0v2("?item"):::projected e0c3([https://ms.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 v2 --"schema:about"--> v3 v2 --"schema:isPartOf"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P17"--> c5 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P205"--> c5 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P27"--> c5 end union0r <== or ==> union0l end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P106"--> c9 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P106"--> c10 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P106"--> c11 end v4 --"schema:about"--> v3 bind5[/"count(?sitelink)"/] v4 --o bind5 bind5 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end