query-70a2c5d2b5d10085a150d6476798bc6b

rq turtle/ttl

Works ordered by how many language versions of Wikipedia have an article about them

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 ?work ?workLabel (COUNT(DISTINCT ?sitelink) as ?linkcount) WHERE {
  ?work wdt:P50 wd:Q9068.  # works by Voltaire
MINUS {?work wdt:P31 wd:Q39811647} # translations
MINUS {?work wdt:P31 wd:Q3331189} # editions
MINUS {?work wdt:P31 wd:Q105420} # anthologies
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,fr,de". }
OPTIONAL{?sitelink schema:about ?work . # get Wikimedia pages about the work
FILTER(CONTAINS(str(?sitelink), ".wikipedia.org/")) } # only Wikipedia links
} GROUP BY ?work ?workLabel ORDER BY DESC(?linkcount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?linkcount") v2("?sitelink"):::projected v3("?work"):::projected c3(["wd:Q9068"]):::iri c9(["bd:serviceParam"]):::iri c5(["wd:Q39811647"]):::iri c11(["#91;AUTO_LANGUAGE#93;,mul,en,fr,de"]):::literal c6(["wd:Q3331189"]):::iri c7(["wd:Q105420"]):::iri v3 --"wdt:P50"--> c3 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> c5 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> c6 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> c7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."schema:about".-> v3 end bind4[/"count(?sitelink)"/] v2 --o bind4 bind4 --as--o v4