query-1a3278950a0edfdb280e8b63250bb242

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 bd: <http://www.bigdata.com/rdf#>
select ?parlament ?parlamentLabel ?job ?jobLabel ?s

WHERE{
  {
    SELECT ?parlament (MAX(?sens) AS ?s) WHERE{
       {
     SELECT (COUNT(?sen) AS ?sens) ?job ?parlament  WHERE { 
      ?sen wdt:P39 ?parlament;
          wdt:P106 ?job.
      ?parlament wdt:P279* wd:Q486839  
      FILTER (?job != wd:Q82955)
    } GROUP BY ?job ?parlament HAVING (?sens > 1)
  }    } GROUP BY ?parlament
  } 
   {
     SELECT (COUNT(?sen) AS ?sens) ?job ?parlament  WHERE { 
      ?sen wdt:P39 ?parlament;
          wdt:P106 ?job.
      ?parlament wdt:P279* wd:Q486839  
      FILTER (?job != wd:Q82955)
    } GROUP BY ?job ?parlament HAVING (?sens > 1)
  }  FILTER(?s = ?sens)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }  
} ORDER BY DESC(?s)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?job"):::projected v5("?parlament"):::projected v6("?s"):::projected v4("?sen") v6("?sens") c8(["bd:serviceParam"]):::iri c10(["en"]):::literal c6(["wd:Q486839"]):::iri f0[["?s = ?sens"]] f0 --> v6 f0 --> v6 f1[["?sens > '1^^xsd:integer'"]] f1 --> v6 f2[["?job != 'wd:Q82955'"]] f2 --> v3 v4 --"wdt:P39"--> v5 v4 --"wdt:P106"--> v3 v5 --"wdt:P279"--> c6 bind4[/"count(?sen)"/] v4 --o bind4 bind4 --as--o v6 bind6[/"max(?sens)"/] v6 --o bind6 bind6 --as--o v6 f7[["?sens > '1^^xsd:integer'"]] f7 --> v6 f8[["?job != 'wd:Q82955'"]] f8 --> v3 v4 --"wdt:P39"--> v5 v4 --"wdt:P106"--> v3 v5 --"wdt:P279"--> c6 bind10[/"count(?sen)"/] v4 --o bind10 bind10 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end