2025 Activity

59 views
Skip to first unread message

David Lu!!

unread,
Jan 9, 2025, 10:18:25 AMJan 9
to openelections
Hey all,
I've been doing some work to keep this project moving forward. I've been having some conversations with Derek in private, but now I have access to this group, so I can be more open.

So far, I've been trying to refine the exact specifications for the data, and examining the overall compliance with the spec. I've also been updating the clarify parser.

One particular number missing from my compliance calculations is the coverage (# elections with data / # of elections). It seems like that the dashboard is down, and I've been running into problems getting the bootstrapped openelections-core environment running with Python 3.

My main questions:
 * Is there a particular location for specifying the elections that have happened? i.e. beyond a primary/general every year...
 * Is anyone working on Python3 updates?

Trying to channel my despair into positive action,
David!! 

Peter Karman

unread,
Jan 14, 2025, 5:39:32 PMJan 14
to openel...@googlegroups.com
David,

Glad to hear you are channeling your despair.

I am not aware of any conventions for specifying elections, as they seem to be very state-dependent (and even county-dependent), because of special elections, presidential primaries, etc. If it was up to me, I would probably define a repo (state) level `elections.json` file (or even elections.yaml) with pairs like "date" and "type" where "type" is one of "general", "primary", "presidentialPrimary" or "special".

I am unaware of Python 3 work.

pek

--
You received this message because you are subscribed to the Google Groups "openelections" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openelection...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openelections/da4f8de1-a970-40e2-ace2-e82bf0ddca72n%40googlegroups.com.


--
Peter Karman  .  he/him/his  .  https://karpet.github.io/ . 785.337.0405

Erik Paulson

unread,
Jan 16, 2025, 4:46:41 PMJan 16
to openel...@googlegroups.com
There are a couple of things in the election identifiers that I'd highlight - 

NIST has had a bunch of projects in election data interchange over the years: 

some of these data file formats have places for contest identifiers, and while NIST is not a place where you can go to find "here are the elections that were held in Wisconsin in 2024: the spring nonpartisan primary, the spring nonpartisan general and presidential primary, the special election for Assembly district  48 in June, the August partisan primary, the november general election and special election for county executive", all of the results of those elections could be published using NIST formats, and it would be good if any election identifier that OpenElections uses could be taken directly out of a file that contains data using the NIST formats. 

The other format is the OCD-ID for elections identifier from Open Civic Data, which apparently is now an "accepted standard" for them: 

Now, personally I think most OCD-ID standards that "can be minted by anyone" are deeply flawed as since they're literally just UUIDs with a type stuck on the front of it, and are of absolutely no help for interoperability because they have no indicator of the issuer, so you can't look them up (literally, if someone gives you an ID of ocd-election/ebaff054-05df-11e3-a53b-f0def1bd7298 you have no idea who issued it and what system it might be valid in - is this OpenElections, is this VEST, is this the California Sec of State? Who knows!)  That said, it's probably better to adopt something that maybe others are using rather than inventing something new that it's guaranteed no one else is using right now. 

(To not sound too grumpy, I think the OCD-IDs for divisions and are awesome!)

-Erik


David Lu!!

unread,
Jan 20, 2025, 10:41:18 PMJan 20
to openel...@googlegroups.com
Thanks for your responses. Better than shouting into the void :)

Are there any data dumps using OCD-ID standards for elections?

Lately I've been playing with WikiData which if nothing else has a wealth of knowledge about translating from one unique identifier to another.

Erik Paulson

unread,
Jan 21, 2025, 6:11:16 PMJan 21
to openel...@googlegroups.com
I am unfortunately not aware of any data dumps using OCD standards for elections.

Of note, on Wikidata, there is a property to link to OCD-IDs. In the election entity for that special election you linked to (Q42317676), it has an 'applies to jurisdiction' property to link that election to the PA 18th congressional district (Q7163552), which has an OCD-ID property for the identifier ocd-division/country:us/state:pa/cd:18 so you can work backwards to find it:

https://query.wikidata.org/index.html#%23election%0ASELECT%20%3Felection%20%3FelectionLabel%0AWHERE%0A%7B%0A%20%20%3Fdistrict%20wdt%3AP8651%20%22ocd-division%2Fcountry%3Aus%2Fstate%3Apa%2Fcd%3A18%22%20.%0A%20%20%3Felection%20wdt%3AP1001%20%3Fdistrict%20.%0A%20%20%3Felection%20wdt%3AP31%20%3FelectionClass%20.%0A%20%20%3FelectionClass%20wdt%3AP31%20wd%3AQ107359024%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cmul%2Cen%22.%20%7D%20%23%20Helps%20get%20the%20label%20in%20your%20language%2C%20if%20not%2C%20then%20default%20for%20all%20languages%2C%20then%20en%20language%0A%7D

(SPARQL: 
SELECT ?election ?electionLabel
WHERE
{
  ?district wdt:P8651 "ocd-division/country:us/state:pa/cd:18" .  # find the congressional district that matches this ocd-id
  ?election wdt:P1001 ?district .  # find "things" that 'applies to jurisdiction' for that CD
  ?election wdt:P31 ?electionClass . # for "things" that apply to that CD, keep track of what it is an 'instance' of
  ?electionClass wdt:P31 wd:Q107359024 . # only keep "things" that are some kind of 'instance of' "class of election" - there's probably a better way to do this with sparql path queries for subclassing but this should be fast
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } # Helps get the label in your language, if not, then default for all languages, then en language

) - there's probably better ways to do that, I'm not really that great at SPARQL.

One bummer is that query only returns one item, and I think that's kind of a shortcoming of some of the data on wikidata. Unfortunately sometimes wikipedia bleeds a bit too much into wikidata and wikipedia pages that are summaries get turned into one big wikidata item instead of multiple items of its constituent parts, and election results are a good example. For example, https://en.wikipedia.org/wiki/2024_United_States_House_of_Representatives_elections_in_Wisconsin is a single page of all the election results, and unfortunately the corresponding wikidata item is also just an entity for the entire state and not for any individual congressional district, so it's not a very useful wikidata item on its own. (There was a special election in WI in 2024 concurrent to the november general for the 8th CD when Mike Gallagher resigned early, and there's a wikipedia page for and a wikidata item for that special election, but that item has the 'applies to jurisdiction' set to Wisconsin instead of the more specific 8th CD, - I'm not sure if that's an oversight or if that's convention) 

Anyway I think wikidata is pretty slick. I don't think they'd want to be in the same business as openelections - I don't think they want to store precinct level results - but having references from wikidata to the corresponding openelection dataset for each election would be cool.

-Erik

 

Reply all
Reply to author
Forward
0 new messages