query-e79c91bd3153d397cef0ce3a9004db7a

rq turtle/ttl

Articles 14:31, 28 August 2016 (UTC)) talk (Tobias1984We (at WMCEE 2016) would like to see all the articles that are available in either Russian OR English, that don't have an article on the Armenian language Wikipedia. Running into timeouts and probably have a bad approach. --

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#>
SELECT ?item ?itemLabel (COUNT(DISTINCT ?sitelink) AS ?linkcount) WHERE {
    ?item wdt:P31 wd:Q5 .
    ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:inLanguage "hy" .
    ?article schema:isPartOf <https://hy.wikipedia.org/>
  }
  OPTIONAL {
    ?article schema:about ?item .
    ?article schema:inLanguage "en" .
    ?article schema:isPartOf <https://en.wikipedia.org/>
  }
  OPTIONAL {
    ?article schema:about ?item .
    ?article schema:inLanguage "ru" .
    ?article schema:isPartOf <https://ru.wikipedia.org/>
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC(?linkcount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?article") v3("?item"):::projected v5("?linkcount") v4("?sitelink"):::projected c10(["ru"]):::literal c8(["en"]):::literal c3(["hy"]):::literal c9([https://en.wikipedia.org/]):::iri c13(["bd:serviceParam"]):::iri c11([https://ru.wikipedia.org/]):::iri c7(["wd:Q5"]):::iri c5([https://hy.wikipedia.org/]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:inLanguage"--> e0c3 e0v1 --"schema:isPartOf"--> e0c5 e0v1("?article"):::projected e0v2("?item"):::projected e0c3(["hy"]):::literal e0c5([https://hy.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 f0 --> c4 f0 --> c5 v2 --"schema:about"--> v3 v2 --"schema:inLanguage"--> c3 v2 --"schema:isPartOf"--> c5 v3 --"wdt:P31"--> c7 v4 --"schema:about"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:about".-> v3 v2 --"schema:inLanguage"--> c8 v2 --"schema:isPartOf"--> c9 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:about".-> v3 v2 --"schema:inLanguage"--> c10 v2 --"schema:isPartOf"--> c11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c8 end bind2[/"count(?sitelink)"/] v4 --o bind2 bind2 --as--o v5