Parliament of Australia
Overview
The Party Service seeds Australian parliamentary data at startup — political parties as Organisations (Accounts), and members of the Senate and House of Representatives as Individuals (Contacts).
The seed data lives in backend/modules/party-service/src/main/resources/sample-data/ and is loaded by
CommandLineRunner beans in backend/modules/party-service/src/main/java/org/serendipity/party/database/seed/au/.
Parliament structure
The Senate
The Senate is the upper house of the Parliament of Australia. There are 76 senators: 12 from each of the six states, and two from each of the two territories (Australian Capital Territory and Northern Territory).
A senator is elected to represent an entire state or territory, not a geographic electorate. Senators' offices are in their state or territory capital.

The House of Representatives
The House of Representatives is the lower house. There are currently 150 members, each elected to represent a single geographic electorate (also called a division or seat). Each electorate has approximately the same enrolled population.
A member's electorate office is in the electorate they represent; their parliamentary office is in Canberra.

Presiding officers
-
The President of the Senate — the presiding officer of the Senate, elected by the senators from among their number. Responsible for guiding and regulating Senate proceedings and for the administration of the Department of the Senate.
-
The Speaker of the House of Representatives — the principal office holder in the House, elected from among the 150 members. The Speaker is the House's representative and chairperson, and is responsible for the administration of the Department of the House of Representatives.
Seed data on disk
Directory layout
backend/modules/party-service/src/main/resources/sample-data/
├── electoral-divisions.csv # Current electoral divisions (150 divisions, as at the 2025 federal election)
├── house-of-representatives.csv # Current members of the House of Representatives (150 members)
├── senate.csv # Current members of the Senate (76 senators)
├── 2020/
│ ├── electoral-divisions.csv # Historical snapshot — 2020 electoral divisions
│ ├── house-of-representatives.csv# Historical snapshot — 2020 House of Representatives
│ └── senate.csv # Historical snapshot — 2020 Senate
└── 2025/
├── electoral-divisions.csv # Historical snapshot — 2025 electoral divisions
├── house-of-representatives.csv# Historical snapshot — 2025 House of Representatives
└── senate.csv # Historical snapshot — 2025 Senate
The top-level sample-data/ files are the active seed data that the CommandLineRunner beans read on startup. The 2020/ and 2025/ subdirectories are historical snapshots retained as working versions — archived copies of the CSVs as they were at those points in time. They are not read by the seed classes; they exist for reference and to preserve the record of how the data changed between elections.
The seed classes on disk are:
| Class | File read | What it seeds |
|---|---|---|
ElectoralDivisions (@Order(1)) | sample-data/electoral-divisions.csv | ElectoralDivision entities — name, state, area, date gazetted, latitude, longitude |
| Individual political party seeders | (no CSV — hardcoded) | One Organisation per political party, seeded before members |
Senate (@Order(Ordered.LOWEST_PRECEDENCE)) | sample-data/senate.csv | Individual + Name + Role(s) for each senator |
HouseOfRepresentatives (@Order(LOWEST_PRECEDENCE)) | sample-data/house-of-representatives.csv | Individual + Name + Role(s) + electorate for each member |
The political party seeders run at lower @Order values than the member seeds, so the party Organisations exist before the membership relationships are created.
Seed classes and execution order
All seed classes implement CommandLineRunner and are annotated with @Order. Lower values execute first.
Execution order:
ElectoralDivisions—@Order(1). Seeds the 150 electoral divisions. Runs first because later seeds may reference division names.- Individual political party seeders — each creates one
Organisationfor a political party (Australian Labor Party, Liberal Party of Australia, etc.). These run before the member seeds so that the membershipRoleentities can link each Member/Senator to their party's Organisation. Senate—@Order(Ordered.LOWEST_PRECEDENCE). Readssenate.csvand seeds 76 senators.HouseOfRepresentatives—@Order(Ordered.LOWEST_PRECEDENCE). Readshouse-of-representatives.csvand seeds 150 members.
Idempotency. The Senate and House of Representatives seeds both check whether data already exists before re-parsing the CSV. If the database is already populated, the seed skips the CSV. This means restarting the application does not duplicate the seed data.
Political parties
The PoliticalParty enum
The PoliticalParty enum in org.serendipity.party.database.seed.au.PoliticalParty maps a party abbreviation (as it appears in the APH CSV's Political Party column) to a display name. The seed classes use this enum to decide:
- which parties to seed as
Organisations (each enum value becomes one Organisation) - which senators/members receive a
Membershiprole linking them to their party's Organisation (so the Individual is associated with a Political Party)
Parties seeded as Organisations
The enum currently covers the major parties that appear in the APH CSV data:
| Abbreviation | Display name | Seeded as Organisation? |
|---|---|---|
| ALP | Australian Labor Party | Yes |
| LP | Liberal Party of Australia | Yes |
| LIB | Liberal Party of Australia | Yes (same Organisation as LP) |
| NATS | National Party of Australia | Yes |
| LNP | Liberal National Party of Queensland | Yes |
| AG | Australian Greens | Yes |
| PHON | Pauline Hanson's One Nation | Yes |
| ON | Pauline Hanson's One Nation | Yes (alias for PHON; same Organisation) |
| AV | Australia's Voice | Yes |
| CLP | Country Liberal Party (Northern Territory) | Yes |
| JLN | Jacqui Lambie Network | Yes |
| UAP | United Australia Party | Yes |
| CA | Centre Alliance | Yes |
| KAP | Katter's Australian Party | Yes |
Note: All 14 party abbreviations found in the APH CSV data are now seeded as
Organisations. Each has aPoliticalPartyenum constant and a dedicated seed class on disk. Members from every one of these parties receive aMembershiprole linking them to their party's Organisation.
Independents and minor parties
Senators and members whose Political Party abbreviation is IND (Independent) are not linked to a party Organisation — they are seeded with the Membership role set to false, so no party membership relationship is created.
ON is an alias for PHON — both abbreviations resolve to the same Pauline Hanson's One Nation PoliticalParty enum constant, so valueOfAbbreviation("ON") and valueOfAbbreviation("PHON") return the same constant. The enum supports multiple abbreviations per constant (the constructor accepts String...), so a single party can be recognised under more than one abbreviation.
The seed's membership switch is the real gate. Both Senate and HouseOfRepresentatives seeds use a switch on the resolved PoliticalParty constant to decide whether to create a Membership role linking the individual to a party Organisation. The switch lists all 13 constants that have dedicated seed classes on disk — AUSTRALIAN_GREENS, AUSTRALIAN_LABOR_PARTY, LIBERAL_NATIONAL_PARTY_OF_QUEENSLAND, LIBERAL_PARTY, LIBERAL_PARTY_OF_AUSTRALIA, NATIONAL_PARTY_OF_AUSTRALIA, PAULINE_HANSONS_ONE_NATION, AUSTRALIA_S_VOICE, COUNTRY_LIBERAL_PARTY, JACQUI_LAMIBE_NETWORK, UNITED_AUSTRALIA_PARTY, CENTRE_ALLIANCE, and KATTER_S_AUSTRALIAN_PARTY — so members from any of these parties receive a Membership role linking them to their party's Organisation. Senators and members whose abbreviation resolves to INDEPENDENT fall through to the default branch: no membership role is created, the individual is saved as an Individual + Contact only.
Extending the enum
If a new party abbreviation appears in a freshly downloaded APH CSV (for example, after a redistribution or a new party registering), add a new enum value with the abbreviation and display name, create a corresponding seed class on disk, and update the switch statements in both Senate.java and HouseOfRepresentatives.java. Then re-run the seed. The enum is the single place that controls which parties are recognized by abbreviation lookup. Abbreviations that remain unrecognized are logged and treated as independents (no membership role created).
For a party to be seeded as an Organisation, three things must be true:
- the abbreviation must be in the
PoliticalPartyenum (so the member'sMembershiprole is created), - a seed class must exist on disk for that enum constant (so an
Organisationentity is created), and - the enum constant must be listed in the
switchstatement in bothSenate.javaandHouseOfRepresentatives.java(so the seed actually creates the Membership role instead of falling through todefault).
If any of these three is missing, the party is recognised by the enum but its members are not linked to an Organisation in the database.
Electoral divisions
Source
The electoral divisions are seeded from sample-data/electoral-divisions.csv, which is sourced from the Australian Electoral Commission's Current federal electoral divisions page. The CSV was captured on 2026-09-26 and reflects the 150 divisions in force for the 2025 federal election.
CSV structure
| Column | Meaning |
|---|---|
name | Division name (e.g. Grayndler, Fraser) |
state | State or territory abbreviation (e.g. NSW, VIC, ACT) |
area | Area in square kilometres |
date gazetted | Date the division was gazetted |
latitude | Latitude of the division |
longitude | Longitude of the division |
What gets seeded
Each row becomes one ElectoralDivision entity with name, state, area, dateGazetted, latitude, and longitude. The ElectoralDivision entity stores latitude and longitude as String, not as numeric types — this matches the seed data.
Data quality note
All 150 current federal electoral divisions are included in the CSV, sourced from the Australian Electoral Commission's Current federal electoral divisions page (captured on 2026-09-26). Each row contains the division name, state, area in square kilometres, date gazetted, latitude, and longitude — all fields are complete with no missing values. The CSV reflects the redistributions that took effect for the 2025 federal election: all NSW, VIC, and WA divisions were redistributed in 2024, and the two NT divisions (Lingiari, Solomon) were redistributed in 2025. Two new divisions created in the 2024 redistributions — Hawke (VIC) and Bullwinkel (WA) — are included. Two abolished divisions that appeared in an earlier draft — Stirling (WA, abolished 2001) and North Sydney (NSW, abolished 2024) — have been removed. Coordinates are centroid values for each division: the Canberra division uses Canberra's coordinates (-35.297, 149.1372), and all other divisions use coordinates appropriate to their geographic location.
Senators
Source
Senators are seeded from sample-data/senate.csv, sourced from the Parliament of Australia's All Senators by Name — Electorate Office CSV file. The CSV was captured on 2026-09-26 and contains the 76 current senators.
CSV columns used by the seed
| Column | Used for |
|---|---|
Title | Name.title |
Salutation | Name.salutation |
Surname | Name.familyName |
First Name | Name.givenName |
Other Name | Name.middleName |
Preferred Name | Name.preferredName |
Initials | Name.initials |
Post Nominals | Name.honorific |
State | Senator's state/territory (informational — not linked to an ElectoralDivision) |
Political Party | Party abbreviation → PoliticalParty enum → membership role decision |
Gender | Individual.sex |
| Electorate address fields | Senator's electorate office address (not seeded as an Address entity) |
Parliamentary Titles | Ministerial/portfolio titles (informational — not seeded) |
Columns beyond Gender (electorate address, label address, parliamentary titles) are present in the CSV but are not currently used to seed entities. They are retained in the CSV for reference.
How a senator row becomes entities
For each senator row, the seed creates:
- A
Nameentity from the name columns (Title,Salutation,Surname,First Name,Other Name,Preferred Name,Initials,Post Nominals) - A
Partyentity (individual type) withdisplayNamebuilt fromTitle+Given Name+Family Name - An
Individualentity linked to the Party, with theName,sex(fromGender), and a constructed email (givenName.surname@aph.gov.au) - Optionally,
Roleentities:- A Membership role linking the individual to their political party's Organisation — created only if the resolved
PoliticalPartyconstant is one of the seven listed in the seed'sswitchstatement (AUSTRALIAN_GREENS,AUSTRALIAN_LABOR_PARTY,LIBERAL_NATIONAL_PARTY_OF_QUEENSLAND,LIBERAL_PARTY,LIBERAL_PARTY_OF_AUSTRALIA,NATIONAL_PARTY_OF_AUSTRALIA,PAULINE_HANSONS_ONE_NATION) and a seed class exists on disk for that party (so theOrganisationlookup succeeds). Senators from any other party (includingINDand the newer minor partiesAV,CLP,JLN,UAP,CA,KAP) are saved as Individuals + Contacts without a Membership role. - A Contact role (always created, linking the individual to an Account)
- A Membership role linking the individual to their political party's Organisation — created only if the resolved
The senator's State column is read but not currently linked to anything in the data model. A senator represents a whole state or territory, so there is no single electorate to link to.
Members of the House of Representatives
Source
Members are seeded from sample-data/house-of-representatives.csv, sourced from the Parliament of Australia's All Members by Name CSV file. The CSV was captured on 2026-09-26 and contains the 150 current members.
CSV columns used by the seed
| Column | Used for |
|---|---|
Honorific | Name.title |
Salutation | Name.salutation |
Post Nominals | Name.honorific |
Surname | Name.familyName |
First Name | Name.givenName |
Other Name | Name.middleName |
Preferred Name | Name.preferredName |
Initials | Name.initials |
Electorate | Individual.electorate (the division name, e.g. Grayndler) |
State | Member's state (informational — not currently used to link to an ElectoralDivision) |
Political Party | Party abbreviation → PoliticalParty enum → membership role decision |
Gender | Individual.sex |
| Electorate address / phone fields | Member's electorate office details (not seeded as entities) |
Parliamentary Title | Role title (e.g. "Prime Minister", "Deputy Prime Minister") — informational |
Ministerial Title | Ministerial portfolio — informational |
Columns beyond Gender are present in the CSV but are not currently used to seed entities, with one exception: the Electorate column is stored on the Individual entity as electorate — the name of the division the member represents.
How a member row becomes entities
For each member row, the seed creates:
- A
Nameentity from the name columns - A
Partyentity (individual type) withdisplayNamebuilt fromHonorific+Given Name+Family Name - An
Individualentity linked to the Party, withName,sex,email(givenName.surname@aph.gov.au), andelectorate(from theElectoratecolumn) - Optionally,
Roleentities:- A Membership role linking the individual to their party's Organisation (if the party abbreviation is recognised)
- A Contact role (always created)
The Electorate column links the member to the division they represent by name, but the seed does not currently resolve that name to the corresponding ElectoralDivision entity. If that linkage is needed, it can be added by looking up the ElectoralDivision by name during the seed.
Refreshing the seed data
The seed data is sourced from live CSVs published by the Parliament of Australia and the Australian Electoral Commission. These are updated after each federal election and periodically as the parliamentary composition changes (e.g. a member vacates a seat and a new member is elected in a by-election).
General recipe
- Download the latest CSVs from the APH addresses page:
- All Senators by Name — Electorate Office →
sample-data/senate.csv - All Members by Name →
sample-data/house-of-representatives.csv - Current federal electoral divisions →
sample-data/electoral-divisions.csv
- All Senators by Name — Electorate Office →
- Archive the previous version by copying the current top-level CSVs into the appropriate versioned snapshot directory (e.g.
sample-data/2026/for a 2026 update), keeping the2020/and2025/snapshots as historical records. - Check for new party abbreviations. Compare the
Political Partycolumn values in the new CSV against thePoliticalPartyenum. For each abbreviation not already in the enum:- If it's a recognised party, add a new enum value (abbreviation + display name).
- If the party is already represented under a different abbreviation, map it to the existing enum value.
- If it's an independent or minor party you don't want to seed as a membership, leave it unrecognised (it will be logged and treated as an independent).
- Update the
PoliticalPartyenum inbackend/modules/party-service/src/main/java/org/serendipity/party/database/seed/au/PoliticalParty.javaif new parties were added. - Sanity-check the row counts. The Senate should have 76 senators; the House of Representatives should have 150 members (unless a redistribution or by-election has changed the number). The electoral divisions file should have 150 divisions.
- Restart the Party Service. The
CommandLineRunnerseeds will run on startup and populate the database with the new data.
Historical snapshots
The 2020/ and 2025/ subdirectories are retained as historical records of the CSVs as they were at those points in time. When refreshing the data, copy the outgoing active CSVs into a new versioned directory (e.g. 2026/) before replacing the top-level files. This preserves a working version history without affecting the active seed.
Resources
- Spring Boot docs: Database Initialization
- Parliament of Australia: Senators and Members
- Parliament of Australia: Contacting Senators and Members
- Parliament of Australia: Senators and Members — Address labels and CSV files
- Australian Electoral Commission: Current federal electoral divisions
- Australian Electoral Commission: Political party names and abbreviations
- Wikipedia: Divisions of the Australian House of Representatives
- Wikipedia: List of political parties in Australia