query-65565c4829e53521c6b7d7a2067686eb

rq turtle/ttl

Nombre d'Élisabeth

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?target ?targetLabel (COUNT(*) AS ?count)  WHERE {
  VALUES ?target {
    wd:Q385468
    wd:Q17524931
    wd:Q18093037
  }
  ?item wdt:P31 wd:Q5;
    p:P735 ?statement.
  ?statement ps:P735  ?target.
  OPTIONAL { ?statement pq:P1545 ?rank. }
  BIND(IF(BOUND(?rank),?rank, 0) AS ?rank2)
  FILTER(xsd:integer(?rank2) < xsd:integer(2))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". }
}
GROUP BY  ?target ?targetLabel
ORDER BY DESC (?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v4("?item") v6("?rank") v7("?rank2") v5("?statement") v3("?target"):::projected c8(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c10(["fr,en"]):::literal f0[["http://www.w3.org/2001/XMLSchema#integer(?rank2) < http://www.w3.org/2001/XMLSchema#integer('2^^xsd:integer')"]] f0 --> v7 bind1[/VALUES ?target/] bind1-->v3 bind10(["wd:Q385468"]) bind10 --> bind1 bind11(["wd:Q17524931"]) bind11 --> bind1 bind12(["wd:Q18093037"]) bind12 --> bind1 v4 --"p:direct/P31"--> c3 v4 --"p:P735"--> v5 v5 --"p:statement/P735"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:qualifier/P1545".-> v6 end bind2[/"if(bound(?rank),?rank,'0^^xsd:integer')"/] v6 --o bind2 bind2 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind4[/"count(*)"/] bind4 --as--o v7