query-8c64f4defd9b16ec2567c40530c2fe42

rq turtle/ttl

TODO

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 ?wikipedia_articles ?wikiquote_articles
WHERE
{

{
  SELECT ?item (COUNT(DISTINCT ?wikipedia_article) AS ?wikipedia_articles)
        (COUNT(DISTINCT ?wikiquote_article) AS ?wikiquote_articles)
  WHERE
  {
    ?item wdt:P31 wd:Q5.
    ?item wdt:P106 wd:Q482980.
    OPTIONAL {
      ?wikipedia_article schema:about ?item.
      ?wikipedia_article schema:isPartOf/wikibase:wikiGroup "wikipedia".
    }
    ?wikiquote_article schema:about ?item.
    ?wikiquote_article schema:isPartOf/wikibase:wikiGroup "wikiquote".
  }
  GROUP BY ?item
  HAVING (?wikiquote_articles > ?wikipedia_articles)
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
ORDER BY DESC(?wikiquote_articles)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v4("?wikipedia_article") v6("?wikipedia_articles"):::projected v5("?wikiquote_article") v6("?wikiquote_articles"):::projected a1((" ")) a2((" ")) c13(["en"]):::literal c9(["wikiquote"]):::literal c11(["bd:serviceParam"]):::iri c4(["wd:Q482980"]):::iri c2(["wd:Q5"]):::iri c8(["wikipedia"]):::literal f0[["?wikiquote_articles > ?wikipedia_articles"]] f0 --> v6 f0 --> v6 v3 --"wdt:P31"--> c2 v3 --"wdt:P106"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."schema:about".-> v3 v4 --"schema:isPartOf"--> a1 a1 --"wikibase:wikiGroup"--> c8 end v5 --"schema:about"--> v3 v5 --"schema:isPartOf"--> a2 a2 --"wikibase:wikiGroup"--> c9 bind3[/"count(?wikipedia_article)"/] v4 --o bind3 bind3 --as--o v6 bind4[/"count(?wikiquote_article)"/] v5 --o bind4 bind4 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end