Overview

This page is the complete column-level reference for all 12 tables in the Popolo-Graph database. Every column, its type, nullability, constraints, and purpose is documented here. Use it as the authoritative source when querying the database or building downstream analyses.

Conventions

:::note

  • All dates are stored in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS).
  • All text is UTF-8 encoded.
  • Foreign keys are enforced (PRAGMA foreign_keys = ON).
  • NULL means “not specified” or “not applicable”. No sentinel values are used.
  • identifiers_json fields contain valid JSON arrays or objects.
  • The "group" column in the vote table uses SQL quoting because group is a reserved keyword in SQLite.
  • Cascading deletes on membership (person_id, org_id) ensure referential integrity when a person or organization is removed. :::

Core Tables

area

Geographic areas used to map electoral districts, states, and constituencies.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix A01, A02, etc.
nombreTEXTNO—Name of the area (state, district, or constituency)
clasificacionTEXTNOCHECK IN (‘estado’,‘distrito’,‘circunscripcion’)Classification of the geographic area
parent_idTEXTYESFK → area(id)Parent area (e.g., district within a state)
geometryTEXTYES—Optional GeoJSON geometry for map visualization

organization

Political parties, parliamentary blocs, coalitions, government bodies, and other organizations.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix O01, O02, etc.
nombreTEXTNOUNIQUEOfficial name of the organization
abbrTEXTYES—Abbreviation (MORENA, PAN, PRI, etc.)
clasificacionTEXTNOCHECK IN (‘partido’,‘bancada’,‘coalicion’,‘gobierno’,‘institucion’,‘otro’)Type of organization
fundacionTEXTYES—Founding date in ISO 8601 format
disolucionTEXTYES—Dissolution date in ISO 8601 format

person

Legislators and other individuals tracked in the system.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix P01, P02, etc.
nombreTEXTNO—Full name of the person
fecha_nacimientoTEXTYES—Date of birth in ISO 8601 format
generoTEXTYESCHECK IN (‘M’,‘F’,‘NB’)Gender: M=male, F=female, NB=non-binary
curul_tipoTEXTYESCHECK IN (‘mayoria_relativa’,‘plurinominal’,‘suplente’)Seat type: MR, proportional representation, or substitute
circunscripcionINTEGERYESCHECK BETWEEN 1 AND 5Electoral constituency (1-5)
start_dateTEXTYES—Start date of legislative term
end_dateTEXTYES—End date of legislative term
corriente_internaTEXTYESIS NULL OR IN (‘Monreal’,‘AMLO’,‘Sheinbaum’,‘institucionalista’)Internal party faction (for loyalty analysis)
vulnerabilidadTEXTYESIS NULL OR IN (‘alta’,‘media’,‘baja’)Estimated vulnerability level (game theory)
observacionesTEXTYES—Free-text notes about the legislator
identifiers_jsonTEXTYES—JSON with external identifiers (e.g., {"sitl_id": 108})

membership

Links a person to an organization with a specific role and time period.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix M01, M02, etc.
person_idTEXTNOFK → person(id) ON DELETE CASCADEReference to the person
org_idTEXTNOFK → organization(id) ON DELETE CASCADEReference to the organization
rolTEXTNO—Role within the organization (diputado, senador, suplente)
labelTEXTYES—Human-readable description (e.g., “Diputado plurinominal, Circ. 4”)
start_dateTEXTNO—Start date of membership
end_dateTEXTYES—End date (NULL = currently active)
on_behalf_ofTEXTYESFK → organization(id)Organization on whose behalf the role is exercised (e.g., coalition)

post

Formal positions within an organization (chamber), optionally tied to a geographic area.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix T01, T02, etc.
org_idTEXTNOFK → organization(id)Organization (chamber) this post belongs to
area_idTEXTYESFK → area(id)Geographic area associated with the post
labelTEXTNO—Human-readable description of the position
start_dateTEXTNO—Start date of the position
end_dateTEXTYES—End date of the position

motion

Legislative initiatives: constitutional reforms, secondary laws, and ordinary bills.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix Y01, Y02, etc.
textoTEXTNO—Full text or summary of the initiative
clasificacionTEXTNOCHECK IN (‘reforma_constitucional’,‘ley_secundaria’,‘ordinaria’,‘otra’)Type of legislative initiative
requirementTEXTNOCHECK IN (‘mayoria_simple’,‘mayoria_calificada’,‘unanime’)Majority type required for approval
resultTEXTYESIS NULL OR IN (‘aprobada’,‘rechazada’,‘pendiente’,‘retirada’)Result of the vote (NULL if not yet voted)
dateTEXTYES—Date of the vote
legislative_sessionTEXTYES—Legislative session name (e.g., “LXVI Legislatura”)
fuente_urlTEXTYES—URL of the official source

vote_event

A specific voting event (roll call) on a motion, held by a chamber.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix VE01, VE02, etc.
motion_idTEXTNOFK → motion(id)Reference to the motion being voted
start_dateTEXTNO—Date/time when the vote event started
organization_idTEXTNOFK → organization(id)Chamber that held the vote
resultTEXTYESIS NULL OR IN (‘aprobada’,‘rechazada’,‘empate’)Outcome of the vote
sitl_idINTEGERYES—SITL system voting identifier (votaciont parameter)
voter_countINTEGERYES—Number of legislators who participated
legislaturaTEXTYES—Legislature identifier (LX, LXI, …, LXVI)
requirementTEXTYESIS NULL OR IN (‘mayoria_simple’,‘mayoria_calificada’,‘unanime’)Majority requirement (copied from motion)
source_idTEXTYES—Original portal ID for deduplication across sources
identifiers_jsonTEXTYES—JSON with Popolo external identifiers

vote

Individual vote cast by a legislator in a vote event.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix V01, V02, etc.
vote_event_idTEXTNOFK → vote_event(id)Reference to the vote event
voter_idTEXTNOFK → person(id)Reference to the legislator who voted
optionTEXTNOCHECK IN (‘a_favor’,‘en_contra’,‘abstencion’,‘ausente’)Vote option: yes, no, abstain, absent
”group”TEXTYES—Party/bloc the legislator belonged to at vote time

Note: The group column name is a SQLite reserved keyword and must be quoted in queries.


count

Aggregated vote counts per option per party within a vote event.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix C01, C02, etc.
vote_event_idTEXTNOFK → vote_event(id)Reference to the vote event
optionTEXTNOCHECK IN (‘a_favor’,‘en_contra’,‘abstencion’,‘ausente’)Vote option being counted
valueINTEGERNOCHECK >= 0Number of votes in this count
group_idTEXTYESFK → organization(id)Party contributing these votes

Extension Tables

These three tables extend the Popolo schema to support power network analysis. They model external political actors, relationships between entities, and political events that shape legislative behavior.

actor_externo

Political actors outside the legislature: governors, mayors, former presidents, party leaders, judges, and others who influence legislative outcomes.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix AE01, AE02, etc.
nombreTEXTNO—Full name of the external actor
tipoTEXTNOCHECK IN (‘gobernador’,‘alcalde’,‘ex_presidente’,‘dirigente’,‘juez’,‘otro’)Type of external actor
area_idTEXTYESFK → area(id)Geographic area of influence
start_dateTEXTYES—Start date of their relevance/term
end_dateTEXTYES—End date of their relevance/term
observacionesTEXTYES—Free-text notes about the actor

relacion_poder

Power relationships between any two entities (persons, organizations, or external actors). Used for loyalty analysis, pressure mapping, and coalition tracking.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix RP01, RP02, etc.
source_typeTEXTNOCHECK IN (‘person’,‘organization’,‘actor_externo’)Type of the source entity
source_idTEXTNO—ID of the source entity
target_typeTEXTNOCHECK IN (‘person’,‘organization’,‘actor_externo’)Type of the target entity
target_idTEXTNO—ID of the target entity
tipoTEXTNOCHECK IN (‘lealtad’,‘presion’,‘influencia’,‘familiar’,‘clientelismo’,‘conflicto’,‘alianza’)Type of power relationship
pesoINTEGERNOCHECK BETWEEN 1 AND 5Relationship strength (1=very weak, 5=very strong)
start_dateTEXTYES—Start date of the relationship
end_dateTEXTYES—End date of the relationship
fuenteTEXTYES—Source of the information (URL or reference)
notaTEXTYES—Additional notes about the relationship

evento_politico

Political events (reforms, crises, agreements) that may or may not be tied to a legislative motion.

ColumnTypeNullableConstraintsDescription
idTEXTNOPRIMARY KEYUnique ID with prefix EP01, EP02, etc.
fechaTEXTNO—Date of the event
tipoTEXTNO—Type of event (free text: reforma, votacion, crisis, acuerdo, etc.)
descripcionTEXTNO—Detailed description of the event
consecuenciaTEXTYES—Consequence or impact of the event
fuente_urlTEXTYES—URL of the source
motion_idTEXTYESFK → motion(id)Related legislative motion (if applicable)

Indexes Reference

-- Membership lookups
CREATE INDEX idx_membership_person ON membership(person_id);
CREATE INDEX idx_membership_org    ON membership(org_id);

-- Vote event lookups
CREATE INDEX idx_vote_event_motion ON vote_event(motion_id);
CREATE INDEX idx_vote_event_source ON vote_event(source_id);

-- Vote event filters
CREATE INDEX idx_vote_event_legislatura ON vote_event(legislatura);
CREATE INDEX idx_vote_event_org ON vote_event(organization_id);
CREATE INDEX idx_vote_event_start_date ON vote_event(start_date);

-- Individual vote lookups
CREATE INDEX idx_vote_voter ON vote(voter_id);
CREATE INDEX idx_vote_event ON vote(vote_event_id);

-- Count aggregations
CREATE INDEX idx_count_event ON count(vote_event_id);
CREATE INDEX idx_count_group ON count(group_id);

-- Deduplication (UNIQUE)
CREATE UNIQUE INDEX idx_vote_unique ON vote(vote_event_id, voter_id);
CREATE UNIQUE INDEX idx_count_unique ON count(vote_event_id, option, group_id);

-- Power relationship traversals
CREATE INDEX idx_relacion_source ON relacion_poder(source_type, source_id);
CREATE INDEX idx_relacion_target ON relacion_poder(target_type, target_id);
CREATE INDEX idx_relacion_tipo   ON relacion_poder(tipo);

-- Loyalty analysis
CREATE INDEX idx_person_corriente ON person(corriente_interna);

-- External actor filtering
CREATE INDEX idx_actor_tipo ON actor_externo(tipo);

Triggers Reference

Four triggers enforce the constraint end_date >= start_date on the person and membership tables, for both INSERT and UPDATE operations.

-- Person: validate dates on INSERT
CREATE TRIGGER trg_person_dates
BEFORE INSERT ON person
WHEN NEW.end_date IS NOT NULL AND NEW.start_date IS NOT NULL
BEGIN
    SELECT CASE WHEN NEW.end_date < NEW.start_date
    THEN RAISE(ABORT, 'end_date debe ser >= start_date en person')
    END;
END;

-- Person: validate dates on UPDATE
CREATE TRIGGER trg_person_dates_update
BEFORE UPDATE ON person
WHEN NEW.end_date IS NOT NULL AND NEW.start_date IS NOT NULL
BEGIN
    SELECT CASE WHEN NEW.end_date < NEW.start_date
    THEN RAISE(ABORT, 'end_date debe ser >= start_date en person')
    END;
END;

-- Membership: validate dates on INSERT
CREATE TRIGGER trg_membership_dates
BEFORE INSERT ON membership
WHEN NEW.end_date IS NOT NULL AND NEW.start_date IS NOT NULL
BEGIN
    SELECT CASE WHEN NEW.end_date < NEW.start_date
    THEN RAISE(ABORT, 'end_date debe ser >= start_date en membership')
    END;
END;

-- Membership: validate dates on UPDATE
CREATE TRIGGER trg_membership_dates_update
BEFORE UPDATE ON membership
WHEN NEW.end_date IS NOT NULL AND NEW.start_date IS NOT NULL
BEGIN
    SELECT CASE WHEN NEW.end_date < NEW.start_date
    THEN RAISE(ABORT, 'end_date debe ser >= start_date en membership')
    END;
END;