query-f975bd9aacc472e749a3882e095d0bb8

rq turtle/ttl

Unique sitelinks & no sitlinks

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/>
#defaultView:BubbleChart
SELECT ?lang (COUNT(DISTINCT ?item) AS ?count) WHERE {
    ?item wdt:P31 wd:Q7889.
  {
    ?article schema:about ?item.
    FILTER((SUBSTR(STR(?article), 11 , 15 )) = ".wikipedia.org/")
    ?article schema:inLanguage ?lang.
    ?item wikibase:sitelinks ?sitelinks.
    FILTER(?sitelinks = 1 )
  }
  UNION
  {
    BIND("None" as ?lang).
    MINUS { ?article schema:about ?item. }
  }
}
GROUP BY ?lang
ORDER BY DESC (?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?article") v6("?count") v2("?item"):::projected v6("?lang"):::projected v3("?sitelinks") c2(["wd:Q7889"]):::iri v2 --"wdt:P31"--> c2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; bind0[/"'None'"/] bind0 --as--o v6 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v4 --"schema:about"--> v2 end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; f2[["?sitelinks = '1^^xsd:integer'"]] f2 --> v3 f3[["substring(str(?article),'11^^xsd:integer','15^^xsd:integer') = '.wikipedia.org/'"]] f3 --> v4 v4 --"schema:about"--> v2 v4 --"schema:inLanguage"--> v6 v2 --"wikibase:sitelinks"--> v3 end union0r <== or ==> union0l end bind5[/"count(?item)"/] v2 --o bind5 bind5 --as--o v6