query-5d9a07e6dab80c790c9790a4fcaf73e0

rq turtle/ttl

candidates in the 2020 Taiwanese legislative election

viewable as table, also as map

querying qualifiers

SELECT ?candidate ?candidateLabel ?image ?genderLabel ?age ?representsLabel ?electoral_districtLabel ?coord ?candidate_number ?votes_received WHERE { # ?candidate's "candidacy in election" (P3602) statement is ?x ?candidate p:P3602 ?x. # ?x's value is 2020 Taiwanese legislative election (Q60287334) ?x ps:P3602 wd:Q60287334 # optional: show ?candidate's image (P18) as ?image OPTIONAL {?candidate wdt:P18 ?image} # optional: show ?candidate's gender (P21) as ?gender OPTIONAL {?candidate wdt:P21 ?gender} # optional: show ?x's qualifier "stated age at event" (P3629) as ?age OPTIONAL {?x pq:P3629 ?age} # optional: show ?x's qualifier "represents" (P1268) as ?represents OPTIONAL {?x pq:P1268 ?represents} # optional: show ?x's qualifier "electoral district" (P768) as ?electoral_district OPTIONAL {?x pq:P768 ?electoral_district # optional: show ?electoral_district's coordinate location (P625) as ?coord OPTIONAL {?electoral_district wdt:P625 ?coord} } # optional: show ?x's candidate_number (P4243) as ?candidate_number OPTIONAL {?x pq:P4243 ?candidate_number} # optional: show ?x's votes received (P1111) as ?votes_received OPTIONAL {?x pq:P1111 ?votes_received} # show label in simplified Chinese (zh-hans) as default, and English when no default label exists SERVICE wikibase:label { bd:serviceParam wikibase:language "zh-hans,en". } }

Use at

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#>
# candidates in the 2020 Taiwanese legislative election
# viewable as table, also as map
# querying qualifiers
SELECT ?candidate ?candidateLabel ?image ?genderLabel ?age ?representsLabel ?electoral_districtLabel ?coord ?candidate_number ?votes_received
WHERE {
  # ?candidate's "candidacy in election" (P3602) statement is ?x
  ?candidate p:P3602 ?x.
  # ?x's value is 2020 Taiwanese legislative election (Q60287334)
  ?x ps:P3602 wd:Q60287334
  # optional: show ?candidate's image (P18) as ?image
  OPTIONAL {?candidate wdt:P18 ?image}
  # optional: show ?candidate's gender (P21) as ?gender
  OPTIONAL {?candidate wdt:P21 ?gender}
  # optional: show ?x's qualifier "stated age at event" (P3629) as ?age
  OPTIONAL {?x pq:P3629 ?age}
  # optional: show ?x's qualifier "represents" (P1268) as ?represents
  OPTIONAL {?x pq:P1268 ?represents}
  # optional: show ?x's qualifier "electoral district" (P768) as ?electoral_district
  OPTIONAL {?x pq:P768 ?electoral_district
            # optional: show ?electoral_district's coordinate location (P625) as ?coord
            OPTIONAL {?electoral_district wdt:P625 ?coord}
            }
  # optional: show ?x's candidate_number (P4243) as ?candidate_number
  OPTIONAL {?x pq:P4243 ?candidate_number}
  # optional: show ?x's votes received (P1111) as ?votes_received
  OPTIONAL {?x pq:P1111 ?votes_received}
  # show label in simplified Chinese (zh-hans) as default, and English when no default label exists
  SERVICE wikibase:label { bd:serviceParam wikibase:language "zh-hans,en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?age"):::projected v1("?candidate"):::projected v9("?candidate_number"):::projected v8("?coord"):::projected v7("?electoral_district") v4("?gender") v3("?image"):::projected v6("?represents") v10("?votes_received"):::projected v2("?x") c3(["wd:Q60287334"]):::iri c15(["zh-hans,en"]):::literal c13(["bd:serviceParam"]):::iri v1 --"p:P3602"--> v2 v2 --"p:statement/P3602"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P21".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P3629".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P1268".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P768".-> v7 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v7 -."p:direct/P625".-> v8 end end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P4243".-> v9 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:qualifier/P1111".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end