Wikidata-Abfragen
Abfrage von Politiker:innen
Die Suche nach Politiker:innen erfolgt über drei verschiedene Wege:
-
Parlamentsmitglieder und Politiker:innen:
- Muss einer politischen Partei angehören (P102) oder eine Verbindung haben (P1416)
- Muss eine Mastodon-Adresse haben (P4033)
- Muss entweder:
- Mitglied des Bundestags (Q1939555)
- Mitglied des Europäischen Parlaments (Q27169)
- Mitglied eines Landtags (Q1939559)
- Ratsherr/Ratsmitglied (Q708492)
- Bürgermeister (Q30185)
- Stadtrat (Q3154693)
- Bezirksverordneter (Q113885691)
- Kreisrat (Q113134496)
- Eine aktuelle politische Position in Deutschland oder der EU innehaben
- Muss einer der folgenden Parteien angehören:
- SPD (Q49768)
- CDU (Q49762)
- CSU (Q49763)
- FDP (Q13124)
- Die Linke (Q49764)
- Bündnis 90/Die Grünen (Q49766)
- Alternative für Deutschland (Q6721203)
- Piratenpartei Deutschland (Q13129)
- Die PARTEI (Q22748)
- Freie Wähler (Q327389)
- Volt Deutschland (Q106205950)
- Bündnis Sahra Wagenknecht (Q123121346)
-
Parteiorganisationen:
- Erfasst werden:
- SPD-Ortsvereine (Q131745197)
- Kreisverbände (Q91459453)
- Landesverbände (Q18744396)
- Ortsverbände (Q86189847)
-
Accounts auf Partei-Instanzen:
- Erfasst werden alle Accounts auf:
- linke.social (Die Linke)
- gruene.social (Bündnis 90/Die Grünen)
- die-partei.social (Die PARTEI)
- piraten-partei.social (Piratenpartei Deutschland)
- Parteizugehörigkeit wird automatisch basierend auf der Instanz zugeordnet
- Zusätzliche Informationen aus Wikidata werden hinzugefügt, falls vorhanden
SPARQL-Abfrage für Politiker:innen
Die SPARQL-Abfrage kombiniert Parlamentsmitglieder, Politiker:innen und Parteiorganisationen:
Diese SPARQL-Abfrage können Sie direkt im Wikidata Query Service ausprobieren und erkunden.
SELECT DISTINCT ?item ?itemLabel ?position ?positionLabel ?account ?party ?partyLabel ?qid WHERE {
# German politicians with positions and Fediverse accounts
{
?item wdt:P102 ?party # Political party membership
} UNION {
?item wdt:P1416 ?party # Affiliations (broader than just membership)
}
# Party must be a major German party or a political party in Germany
{
VALUES ?party {
wd:Q49768 # SPD
wd:Q49762 # CDU
wd:Q49763 # CSU
wd:Q13124 # FDP
wd:Q49764 # Die Linke
wd:Q49766 # Bündnis 90/Die Grünen
wd:Q6721203 # Alternative für Deutschland
wd:Q13129 # Piratenpartei Deutschland
wd:Q22748 # Die PARTEI
wd:Q327389 # Freie Wähler
wd:Q106205950 # Volt Deutschland
wd:Q123121346 # Bündnis Sahra Wagenknecht
}
} UNION {
?party wdt:P31 wd:Q2023214 # Instance of political party in Germany
}
?item p:P4033 ?statement . # Mastodon address
?statement ps:P4033 ?account .
{
# Current members of parliament and other positions
VALUES ?membership {
wd:Q1939555 # Member of Bundestag
wd:Q27169 # Member of the European Parliament
wd:Q1939559 # Member of Landtag
wd:Q708492 # Ratsherr/Ratsmitglied
wd:Q30185 # Bürgermeister
wd:Q3154693 # Stadtrat
wd:Q113885691 # Bezirksverordneter
wd:Q113134496 # Kreisrat
}
?item p:P39 ?membershipStatement .
?membershipStatement ps:P39 ?membership .
# Filter for current positions (no end date)
FILTER NOT EXISTS { ?membershipStatement pq:P582 ?endtime }
BIND(?membership AS ?position)
}
UNION
{
# Political parties in Germany
?item wdt:P31 wd:Q2023214 . # Instance of political party in Germany
BIND(wd:Q2023214 AS ?position)
}
UNION
{
# Local and regional party organizations
VALUES ?organization_type {
wd:Q131745197 # SPD local associations
wd:Q91459453 # District associations
wd:Q18744396 # State associations
wd:Q86189847 # Local associations
}
?item wdt:P31 ?organization_type .
BIND(?organization_type AS ?position)
}
UNION
{
# Other political positions
?item p:P39 ?positionStatement .
?positionStatement ps:P39 ?position .
# Filter for current positions (no end date)
FILTER NOT EXISTS { ?positionStatement pq:P582 ?endtime }
# Position must be either in Germany OR an EU position
{
# German positions
?position wdt:P17 wd:Q183 .
}
UNION
{
# EU Parliament and Landtag positions
VALUES ?position { wd:Q27169 wd:Q1939559 }
}
UNION
{
# Specific positions that don't need country filtering
VALUES ?position {
wd:Q1939555 # Member of Bundestag
wd:Q708492 # Ratsherr/Ratsmitglied
wd:Q30185 # Bürgermeister
wd:Q3154693 # Stadtrat
wd:Q113885691 # Bezirksverordneter
wd:Q113134496 # Kreisrat
}
}
}
# Extract QID
BIND(REPLACE(STR(?item), "http://www.wikidata.org/entity/", "") AS ?qid)
# Labels in German only
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
SPARQL-Abfrage für Partei-Instanzen
Separate Abfrage für Accounts auf linke.social, gruene.social, die-partei.social und piraten-partei.social:
Diese SPARQL-Abfrage können Sie direkt im Wikidata Query Service ausprobieren und erkunden.
SELECT DISTINCT ?item ?itemLabel ?position ?positionLabel ?account ?party ?partyLabel ?qid WHERE {
# All accounts on party-specific instances
?item p:P4033 ?statement .
?statement ps:P4033 ?account .
# Filter for specific instances
VALUES ?instance { "linke.social" "gruene.social" "die-partei.social" "piraten-partei.social" }
FILTER(CONTAINS(STR(?account), ?instance))
# Get party affiliation (both membership and broader affiliations)
OPTIONAL {
{ ?item wdt:P102 ?party } # Party membership
UNION
{ ?item wdt:P1416 ?party } # Affiliations
}
# Get position if available
OPTIONAL {
?item p:P39 ?positionStatement .
?positionStatement ps:P39 ?position .
FILTER NOT EXISTS { ?positionStatement pq:P582 ?endtime }
}
# Extract QID
BIND(REPLACE(STR(?item), "http://www.wikidata.org/entity/", "") AS ?qid)
# Labels in German only
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
Abfrage von Institutionen
Die Suche nach Institutionen erfolgt über drei Wege:
-
Deutsche Institutionen:
- Muss eine Mastodon-Adresse haben (P4033)
- Muss in Deutschland sein (P17)
- Muss einer der folgenden Typen sein:
- Politische Partei (Q7278)
- Ministerium (Q327333)
- Legislative (Q31075)
- Behörde (Q2659904)
- Regionalparlament (Q4471)
- Jugendorganisation (Q2166081)
- Politische Stiftung (Q1663594)
- Politische Partei in Deutschland (Q2023214)
- Regionalverband (Q1672092)
- Parlamentsfraktion (Q2324813)
-
Accounts auf social.bund.de:
- Alle Accounts auf dieser Instanz werden erfasst
- Typ der Institution wird aus Wikidata ergänzt, falls vorhanden
-
Accounts auf social.hessen.de:
- Alle Accounts auf dieser Instanz werden erfasst
- Typ der Institution wird aus Wikidata ergänzt, falls vorhanden
SPARQL-Abfrage für Institutionen
Die SPARQL-Abfrage kombiniert reguläre Institutionen und spezielle Instanzen:
Diese SPARQL-Abfrage können Sie direkt im Wikidata Query Service ausprobieren und erkunden.
SELECT DISTINCT ?item ?itemLabel ?type ?typeLabel ?account ?qid WHERE {
{
SELECT DISTINCT ?item ?type ?account WHERE {
{
# Regular institutions query
?item p:P4033 ?statement . # Has Mastodon address
?statement ps:P4033 ?account .
# Must be in Germany
?item wdt:P17 wd:Q183 .
# Type of institution
?item wdt:P31 ?type .
# Filter for relevant types
VALUES ?type {
wd:Q7278 # political party
wd:Q327333 # government ministry
wd:Q31075 # legislature
wd:Q2659904 # government agency
wd:Q4471 # regional parliament
wd:Q2166081 # youth organization
wd:Q1663594 # political foundation
wd:Q2023214 # political party in Germany
wd:Q1672092 # Regionalverband
wd:Q2324813 # parliamentary group
}
}
UNION
{
# All accounts on social.bund.de
?item p:P4033 ?statement .
?statement ps:P4033 ?account .
FILTER(CONTAINS(STR(?account), "social.bund.de"))
# Get the type if available
OPTIONAL {
?item wdt:P31 ?type .
}
}
UNION
{
# All accounts on social.hessen.de
?item p:P4033 ?statement .
?statement ps:P4033 ?account .
FILTER(CONTAINS(STR(?account), "social.hessen.de"))
# Get the type if available
OPTIONAL {
?item wdt:P31 ?type .
}
}
}
}
# Extract QID
BIND(REPLACE(STR(?item), "http://www.wikidata.org/entity/", "") AS ?qid)
# Labels in German only
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
} LIMIT 10000
Mastodon-API-Abfragen
Für jeden gefundenen Account werden folgende Daten über die Mastodon-API abgefragt:
- Account-Informationen (Erstellungsdatum, Bot-Status)
- Gesamtzahl der Posts
- Anzahl der Posts in den letzten 60 Tagen
API-Endpunkte
-
Account-Lookup:
GET https://<instance>/api/v1/accounts/lookup?acct=<username>
Liefert grundlegende Account-Informationen wie Erstellungsdatum und Bot-Status.
-
Account-Posts:
GET https://<instance>/api/v1/accounts/<id>/statuses?limit=40
Liefert die letzten Posts des Accounts. Die Abfrage wird wiederholt, bis Posts gefunden werden, die älter als 60 Tage sind.
Die API-Abfragen werden in Batches von 10 Accounts mit einer Verzögerung von 1 Sekunde zwischen den Batches durchgeführt, um die Server nicht zu überlasten.
Datenverarbeitung
Die gesammelten Daten werden wie folgt verarbeitet:
- Alle Ergebnisse werden nach Partei/Institution und Name sortiert
- Doppelte Einträge werden automatisch entfernt
- Parteinamen werden in gängige Abkürzungen umgewandelt (z.B. "Bündnis 90/Die Grünen" → "Grüne")
- Fediverse-URLs werden in ein einheitliches Format gebracht
- Die Ergebnisse werden in einer Markdown-Datei gespeichert, die als Grundlage für weitere Verarbeitungen dient
Bot-Erkennung
Die Erkennung von automatisierten Accounts (Bots) erfolgt über mehrere Kriterien:
-
Bot-Flag:
- Prüfung des offiziellen Bot-Flags im Account-Profil (Mastodon-API)
- Wenn ein Account sich selbst als Bot kennzeichnet, wird er automatisch als Bot markiert
-
Automatisierungs-Keywords:
- Analyse der Account-Beschreibung auf spezifische Keywords
- Berücksichtigte Keywords:
- 'unofficial' - Hinweis auf inoffizielle/automatische Spiegelung
- 'automated' - Direkte Kennzeichnung als automatisiert
- 'mirror' - Spiegelung von Inhalten anderer Plattformen
- 'bot' - Explizite Bot-Kennzeichnung
- 'automatisiert' - Deutsche Kennzeichnung
- 'automatisch' - Alternative deutsche Kennzeichnung
- Die Suche erfolgt case-insensitive und nach Entfernung von HTML-Tags
Deduplizierung nach Aktivität
Bei mehreren Accounts der gleichen Person wird der aktivste Account bevorzugt:
-
Aktivitätskriterien:
- Primär: Anzahl der Posts in den letzten 60 Tagen
- Sekundär: Gesamtzahl der Posts
- Tertiär: Erstellungsdatum des Accounts (neuere Accounts werden bevorzugt)
-
Deduplizierungsprozess:
- Gruppierung der Accounts nach Namen und Position
- Innerhalb jeder Gruppe:
- Vergleich der Aktivität der letzten 60 Tage
- Bei gleicher Aktivität: Vergleich der Gesamtposts
- Bei gleicher Gesamtanzahl: Bevorzugung des neueren Accounts
- Nur der aktivste Account wird in der finalen Liste behalten
-
Ausnahmen:
- Accounts auf Partei-Instanzen (gruene.social, linke.social) werden immer behalten
- Accounts mit unterschiedlichen Positionen werden als separate Einträge behandelt
- Bot-Accounts werden bei der Deduplizierung nachrangig behandelt
Die SPARQL-Abfragen werden über den Wikidata-Endpunkt ausgeführt und die Ergebnisse werden in deutscher Sprache angefordert. Falls keine deutsche Bezeichnung verfügbar ist, wird auf die englische Version zurückgegriffen.