query-92645d1c3243fc1c65e5973119cb0c03

rq turtle/ttl

Created by User:Gnoeee

Successful candidates during 2016 Kerala Legislative Assembly in each constituencies

SELECT ?constituency_No ?jurisdictionLabel ?successful_candidateLabel ?electorate ?total_valid_votes ?votes_received ?political_partyLabel (100*?votes_received/?total_valid_votes AS ?candidate_Vote_percent) WHERE { ?item wdt:P31 wd:Q40231; wdt:P541 wd:Q99709336. ?item wdt:P1001 ?jurisdiction. ?jurisdiction p:P31 ?id. ?id ps:P31 wd:Q54375461 . ?id pq:P1545 ?constituency_No. SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ml". } OPTIONAL { ?item wdt:P1697 ?total_valid_votes. } OPTIONAL { ?item wdt:P991 ?successful_candidate. } OPTIONAL { ?item wdt:P1831 ?electorate. } ?item p:P991 ?sc. ?sc pq:P1111 ?votes_received; pq:P102 ?political_party. } ORDER BY ASC(xsd:integer(?constituency_No) )

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#>
# Created by User:Gnoeee
# Successful candidates during 2016 Kerala Legislative Assembly in each constituencies
SELECT ?constituency_No ?jurisdictionLabel ?successful_candidateLabel ?electorate ?total_valid_votes ?votes_received ?political_partyLabel (100*?votes_received/?total_valid_votes AS ?candidate_Vote_percent) WHERE {
  ?item wdt:P31 wd:Q40231;
    wdt:P541 wd:Q99709336.
  ?item wdt:P1001 ?jurisdiction.
  ?jurisdiction p:P31 ?id.
  ?id ps:P31 wd:Q54375461 .
  ?id pq:P1545 ?constituency_No.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ml". }
  OPTIONAL { ?item wdt:P1697 ?total_valid_votes. }
  OPTIONAL { ?item wdt:P991 ?successful_candidate. }
  OPTIONAL { ?item wdt:P1831 ?electorate. }
  ?item p:P991 ?sc.
  ?sc pq:P1111 ?votes_received;
    pq:P102 ?political_party.
}
ORDER BY ASC(xsd:integer(?constituency_No) )

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v11("?candidate_Vote_percent") v1("?constituency_No"):::projected v7("?electorate"):::projected v4("?id") v2("?item") v3("?jurisdiction") v10("?political_party") v8("?sc") v6("?successful_candidate") v5("?total_valid_votes"):::projected v9("?votes_received"):::projected c13(["en,ml"]):::literal c2(["wd:Q40231"]):::iri c8(["wd:Q54375461"]):::iri c11(["bd:serviceParam"]):::iri c4(["wd:Q99709336"]):::iri v2 --"p:direct/P31"--> c2 v2 --"p:direct/P541"--> c4 v2 --"p:direct/P1001"--> v3 v3 --"p:P31"--> v4 v4 --"p:statement/P31"--> c8 v4 --"p:qualifier/P1545"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1697".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P991".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1831".-> v7 end v2 --"p:P991"--> v8 v8 --"p:qualifier/P1111"--> v9 v8 --"p:qualifier/P102"--> v10 bind0[/"'100^^xsd:integer' * ?votes_received / ?total_valid_votes"/] v9 --o bind0 v5 --o bind0 bind0 --as--o v11