query-738d04fb46a0d3d9ddd7964f5be33fc0

rq turtle/ttl

Évaluer le contenu de genre masculin et féminin d'encyclopédies diverses (TIMEOUT) select ?property ?propertyLabel ?propertyDescription (group_concat(concat(str(?sexe_label_final), ": ", str(?effectif), " ", "(", str(round(?effectif / sum(?effectif) * 100)), "%",")") ; separator=" - ") as ?sexes) (sum(?effectif) as ?total)

with {

select ?property ?sexe (count(?person) as ?effectif) { ?property rdf:type wikibase:Property ; wdt:P31/wdt:P279* wd:Q55452870 ; wikibase:directClaim ?propertyMainValue .

?person ?propertyMainValue [] ;
        wdt:P31 wd:Q5 .
optional {
   ?person wdt:P21 ?sexe2 .
   bind(if(isBlank(?sexe2), "inconnu", ?sexe2) as ?sexe3) 
}
bind(if(!bound(?sexe3), "non specifié", ?sexe3) as ?sexe)

} group by ?property ?sexe order by ?property ?sexe } as %dataset

where { { select ?property ?propertyLabel ?propertyDescription ?sexe ?sexe_label_final ?effectif{ include %dataset . optional { ?sexe rdfs:label ?label_sexe filter langmatches(lang(?label_sexe), "fr") } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } bind (if(bound(?label_sexe), ?label_sexe, ?sexe) as ?sexe_label_final) } } bind( (?effectif / ?total ) as ?pourcent) } group by ?property ?propertyLabel ?propertyDescription

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Évaluer le contenu de genre masculin et féminin d'encyclopédies diverses (TIMEOUT)
select ?property ?propertyLabel ?propertyDescription 
       (group_concat(concat(str(?sexe_label_final), 
                           ": ", 
                           str(?effectif), " ",
                           "(", str(round(?effectif / sum(?effectif) * 100)), "%",")") ; separator=" - ") as ?sexes) 
       (sum(?effectif) as ?total)


where {
  {
    select ?property ?propertyLabel ?propertyDescription ?sexe ?sexe_label_final ?effectif{
       {

select ?property ?sexe (count(?person) as ?effectif)
{
    ?property rdf:type wikibase:Property ;
              wdt:P31/wdt:P279* wd:Q55452870 ;
              wikibase:directClaim ?propertyMainValue .

    ?person ?propertyMainValue [] ;
            wdt:P31 wd:Q5 .
    optional {
       ?person wdt:P21 ?sexe2 .
       bind(if(isBlank(?sexe2), "inconnu", ?sexe2) as ?sexe3) 
    }
    bind(if(!bound(?sexe3), "non specifié", ?sexe3) as ?sexe)


} group by ?property ?sexe
  order by ?property ?sexe
}.
      optional { ?sexe rdfs:label ?label_sexe filter langmatches(lang(?label_sexe), "fr") }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
      bind (if(bound(?label_sexe), ?label_sexe, ?sexe) as ?sexe_label_final)
    }
  }
  bind( (?effectif / ?total )  as ?pourcent)
} group by ?property ?propertyLabel ?propertyDescription

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?_anon_d00291b7e9a143df8ec0be8c8ebd714c34723"):::projected v8("?effectif"):::projected v1("?label_sexe") v5("?person") v10("?pourcent") v2("?property"):::projected v4("?propertyMainValue") v8("?sexe") v6("?sexe2") v7("?sexe3") v9("?sexe_label_final"):::projected v12("?sexes") v13("?total") a2((" ")) a1((" ")) a3((" ")):::projected c3(["wikibase:Property"]):::iri c6(["wd:Q55452870"]):::iri c12(["bd:serviceParam"]):::iri c8(["wd:Q5"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"a"--> c3 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c6 v2 --"wikibase:directClaim"--> v4 v5 -->v4--> a2 v5 --"wdt:P31"--> c8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P21".-> v6 bind0[/"if(isBlank(?sexe2),'inconnu',?sexe2)"/] v6 --o bind0 bind0 --as--o v7 end bind1[/"if(not bound(?sexe3),'non specifié',?sexe3)"/] v7 --o bind1 bind1 --as--o v8 bind3[/"count(?person)"/] v5 --o bind3 bind3 --as--o v8 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."rdfs:label".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind4[/"if(bound(?label_sexe),?label_sexe,?sexe)"/] v1 --o bind4 v8 --o bind4 bind4 --as--o v9 bind5[/"?effectif / ?total"/] v8 --o bind5 v13 --o bind5 bind5 --as--o v10 bind9[/"sum(?effectif)"/] v8 --o bind9 bind9 --as--o v11 bind10[/"concat(str(?sexe_label_final),': ',str(?effectif),' ','(',str(numeric-round(?effectif / * '100^^xsd:integer')),'%',')')"/] v9 --o bind10 v8 --o bind10 a3 --o bind10 bind10 --as--o v12 bind11[/"sum(?effectif)"/] v8 --o bind11 bind11 --as--o v13