query-a8f44db912a3449192e63b91ebe5e428

rq turtle/ttl

Compteur de liens de genres par article

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?gender ?genderLabel (COUNT(*) AS ?count) 
WHERE {
  SERVICE wikibase:mwapi {
     bd:serviceParam wikibase:endpoint "fr.wikipedia.org"; 
                     wikibase:api "Generator";
                     mwapi:generator "links"; 
                     mwapi:titles "Sociologie";. 
     ?item wikibase:apiOutputItem mwapi:item.
  } 
  FILTER BOUND (?item)                                         # Safeguard to not get a timeout from unbound items when using ?item below
  ?item wdt:P21 ?gender .                                  
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }    
}
GROUP BY ?gender ?genderLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?count") v2("?gender"):::projected v1("?item") c12(["mwapi:item"]):::iri c4(["fr.wikipedia.org"]):::literal c2(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal c8(["links"]):::literal c10(["Sociologie"]):::literal c6(["Generator"]):::literal f0[["bound(?item)"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:endpoint"--> c4 c2 --"mwapi:api"--> c6 c2 --"mwapi:generator"--> c8 c2 --"mwapi:titles"--> c10 v1 --"mwapi:apiOutputItem"--> c12 end v1 --"wdt:P21"--> v2 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c2 --"mwapi:language"--> c16 end bind2[/"count(*)"/] bind2 --as--o v3