Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Enumerations Reference

Every categorical field in the schema is represented by a closed enumeration. This chapter lists all enum types, their values, and where each is used.

ElectionType

Classifies the type of election event.

ValueDescription
GeneralRegular general election (November even years)
PrimaryParty primary election
RunoffRunoff election following an inconclusive primary or general
SpecialSpecial election to fill a vacancy
SpecialPrimaryPrimary for a special election
SpecialRunoffRunoff for a special election
MunicipalMunicipal election (may be odd-year)
RecallRecall election
RetentionJudicial retention election
OtherElection type not matching any above category

Source mapping: MEDSL’s stage column maps GENGeneral, PRIPrimary, RUNRunoff. The special boolean flag promotes any type to its Special* variant. NC SBE does not distinguish — all loaded files are general elections.

JurisdictionLevel

The geographic level at which a result is reported.

ValueDescription
StateStatewide aggregate
CountyCounty-level result
PrecinctPrecinct-level result
CongressionalDistrictCongressional district aggregate
StateLegislativeUpperState senate district aggregate
StateLegislativeLowerState house/assembly district aggregate
MunicipalityCity or town
SchoolDistrictSchool district boundary

Most records in the pipeline are Precinct. County and state aggregates appear in OpenElections data where precinct-level files are unavailable.

OfficeLevel

The level of government an office belongs to.

ValueDescription
FederalPresident, US Senate, US House
StatewideGovernor, AG, SOS, state auditor, state treasurer
StateLegislatureState senate, state house/assembly
CountyCounty commissioner, county clerk, coroner, sheriff
MunicipalMayor, city council, town board
JudicialAll judicial offices (federal, state, county, municipal)
SchoolBoardSchool board / board of education
SpecialDistrictSoil and water, fire district, utility district, transit
TownshipTownship supervisor, township trustee
OtherUnclassifiable after all four classifier tiers

Assigned by the four-tier classifier at L1 (keyword), L2 (embedding), and L3 (LLM). The Other rate is 0.56% on NC test data.

OfficeCategory

Finer-grained classification within an office level. One office level maps to many categories.

ValueDescription
ExecutivePresident, governor, mayor, county executive
LegislativeUS House, US Senate, state legislature, city council
JudicialJudge, justice, magistrate
LawEnforcementSheriff, constable, marshal
FiscalOfficerTreasurer, auditor, comptroller, tax collector
ClerkCounty clerk, clerk of court, register of deeds
EducationSchool board, board of education, superintendent
PublicWorksSoil and water, utility district, surveyor
RegulatoryCoroner, medical examiner, public service commission
PartyOfficePrecinct committee officer, party chair (when on ballot)
OtherDoes not fit the above categories

BallotMeasureType

Classifies ballot measures by their legal mechanism.

ValueDescription
BondIssueDebt authorization (general obligation or revenue bond)
LevyRenewalProperty tax levy renewal
LevyNewNew property tax levy
ConstitutionalAmendmentState constitutional amendment
CharterAmendmentMunicipal or county charter amendment
ReferendumLegislative referendum referred to voters
InitiativeCitizen-initiated ballot measure
RecallRecall question for a specific officeholder
OtherMeasure type not determinable from contest name

PartySimplified

Normalized party affiliation. Preserves the most common parties as distinct values; collapses minor parties.

ValueDescription
DemocratDemocratic Party
RepublicanRepublican Party
LibertarianLibertarian Party
GreenGreen Party
IndependentIndependent / no party affiliation
NonpartisanNonpartisan contest (no party on ballot)
WriteInWrite-in candidate (party unknown or not applicable)
OtherAny other party (Constitution, Working Families, Reform, etc.)

Source mapping: MEDSL’s party_simplified column maps directly. NC SBE’s Choice Party codes: DEMDemocrat, REPRepublican, LIBLibertarian, GREGreen, UNAIndependent, blank → Nonpartisan. FEC codes: DEM, REP, LIB, GRE, IND, NNENonpartisan.

SourceType

Identifies the origin of a record. One value per data source file type.

ValueDescription
Medsl2018MEDSL 2018 precinct-level file
Medsl2020MEDSL 2020 precinct-level file
Medsl2022MEDSL 2022 precinct-level file
Ncsbe2014NC SBE 2014 general (15-column schema)
Ncsbe2016NC SBE 2016 general
Ncsbe2018NC SBE 2018 general
Ncsbe2020NC SBE 2020 general
Ncsbe2022NC SBE 2022 general
Ncsbe2024NC SBE 2024 general
NcsbeLegacyNC SBE 2006–2012 (older schemas)
OpenElectionsOpenElections CSV (any state)
ClarityXmlClarity/Scytl ENR XML extract
VestShapefileVEST precinct shapefile
CensusFipsCensus Bureau FIPS reference file
FecCandidateFEC candidate master file (cn.txt)
ManualManually entered or corrected record

Each L1 record carries exactly one SourceType. When sources are merged at L3/L4, the provenance chain preserves the original SourceType for every contributing record.

ExtractionMethod

How a field value was obtained from the source.

ValueDescription
DirectValue copied directly from a source column
ParsedValue extracted by parsing a combined field (e.g., name decomposition)
DerivedValue computed from other fields (e.g., vote share from votes/total)
EnrichedValue added from a reference source (e.g., FIPS code from Census lookup)
InferredValue inferred by model (embedding similarity or LLM)

Confidence

The verification level assigned to a record at L4.

ValueCriteria
HighConfirmed by two or more independent sources with matching vote totals
MediumSingle source, certified state data or academic curated source
LowSingle source, community curated or unverified; or match confidence below threshold

Confidence is assigned per-record, not per-source. A record from MEDSL that is corroborated by NC SBE receives High. A record from MEDSL with no second source receives Medium. A record from OpenElections with schema inconsistencies receives Low.

ClassifierMethod

Which tier of the office classifier produced the office level and category.

ValueDescription
KeywordMatched a keyword or keyword phrase (e.g., “SHERIFF” → LawEnforcement)
RegexMatched a regex pattern (e.g., DISTRICT \d+ for legislative districts)
EmbeddingClassified by nearest-neighbor embedding similarity at L2
LlmClassified by LLM at L3 after embedding was ambiguous

Records carry the method so downstream consumers can filter by classifier reliability. Keyword and Regex are deterministic and reproducible. Embedding and Llm depend on model versions.

GeoMatchMethod

How a geographic identifier was resolved.

ValueDescription
FipsExactFIPS code present in source and matched Census reference exactly
NameExactGeographic name matched Census reference exactly (case-insensitive)
NameFuzzyGeographic name matched after fuzzy normalization (e.g., “ST. LOUIS” → “St. Louis”)
OcdLookupMatched via Open Civic Data identifier
UnresolvedCould not be matched to a canonical geographic entity

Most MEDSL records resolve via FipsExact (the source provides county_fips). NC SBE records resolve via NameExact after uppercasing the county name. OpenElections records frequently require NameFuzzy due to inconsistent county name formatting.