User:Looniverse/Bundestagswahl

From Wikidata
Jump to navigation Jump to search

Einiges zur Bundestagswahl 2017[edit]

  • Overpass-Abfrage für OpenStreetMap-Grenz-Relationen der Wahlkreise als csv:

[out:csv(::id,::type,"ref","name","wikidata","wikipedia","election:part","election:year";header;"|")]; area[name="Deutschland"]->.a;( rel(area.a)[political=election]['election:parliament'~'Bundestag'];);out;

Probier es!


  • Abfrage der Mitglieder der Wahlkreisrelation (Mitgliedsrelation)

<osm-script output="csv" output-config="(::id,::type,'name','admin_level','type';true;'|')">
 <query type="relation">
   <has-kv k="type" v="election" />
   <has-kv k="election:parliament"
      v="Deutscher Bundestag" />
   <has-kv k="election:part"
   v="Wahlkreis" />
   <has-kv k="election:year" v="2013" />     
   <has-kv k="ref" v="255"/>  
 </query>
 <union>
   <item/>
   <recurse type="relation-relation"/>
 </union>
 <print/>
</osm-script>

Probier es!


  • SPARQL-Abfrage aller Bundestagswahlkreise:

The following query uses these:

  • SPARQL-Abfrage der Bundestagswahlkreise 2017:

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, OpenStreetMap relation ID (P402)  View with Reasonator View with SQID, catalog code (P528)  View with Reasonator View with SQID, start time (P580)  View with Reasonator View with SQID, end time (P582)  View with Reasonator View with SQID, catalog (P972)  View with Reasonator View with SQID
    # Liste der Bundestagswahlkreise 2017
    SELECT ?item ?itemLabel ?start ?ende ?katalogid ?katalog ?katalogLabel ?article #?osm_rel 
    WHERE
    {
     BIND(wd:Q26971257 AS ?katalog)
     ?item wdt:P31 wd:Q11703715 .
     ?item p:P31 ?statement .
     OPTIONAL {?statement pq:P580 ?start.}.
     OPTIONAL {?statement pq:P582 ?ende.}.
     #OPTIONAL {?item wdt:P402 ?osm_rel.}.
     ?item p:P528 ?katalogStatement.
     ?katalogStatement ps:P528 ?katalogid.
     ?katalogStatement pq:P972 ?katalog.
     OPTIONAL {
          ?article schema:about ?item .
          ?article schema:inLanguage "de" .
          ?article schema:isPartOf <https://de.wikipedia.org/> .
        }
     SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
    }
    ORDER BY xsd:integer(?katalogid)
    
  • SPARQL-Abfrage Abgeordnete des 19. Bundestages mit Wahlkreisen:

The following query uses these:

  • Properties: position held (P39)  View with Reasonator View with SQID, parliamentary term (P2937)  View with Reasonator View with SQID, parliamentary group (P4100)  View with Reasonator View with SQID, electoral district (P768)  View with Reasonator View with SQID
    # Mitglieder des Bundestags mit Wahlkreisen
    select ?mdb ?mdbLabel ?periodeLabel ?fraktionLabel ?wahlbezirk ?wahlbezirkLabel
    WHERE {
       BIND(wd:Q30579723 AS ?periode)
        ?mdb p:P39 ?statement.
        ?statement ps:P39 wd:Q1939555;
                   pq:P2937 ?periode.
        OPTIONAL {?statement pq:P4100 ?fraktion.}.
        OPTIONAL {?statement pq:P768 ?wahlbezirk.}.
       SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
    }