-
Notifications
You must be signed in to change notification settings - Fork 5
DataStructure
Data is stored in quite a loose manner so that it will be flexible. Note that the way data is presented may be very different from the way it is stored. The structure is a work in progress and will change to accommodate the data that we need to store.
Each person has a single entry in the system. This one person entry is then linked to the various positions that they have held.
We store jobs as 'positions' internally. A position is simply a person being linked to an organisation with a start and end date. For example Joe Bloggs might be a member of the Freedom Party:
person: joe-bloggs
role: member
place: -
organisation: freedom-party
start-date: 1 Jan 2007
end-date: -
They might also be a Member of Parliament:
person: joe-bloggs
role: member-of-parliament
place: nairobi-constituency
organisation: parliament
start-date: 15 May 2010
end-date: -
So for MP the organisation they are related to is the Parliament, not their party. Note that being a member of a party has no place associated with it, but being an MP does.
Using this structure we can quickly see who is a member of which party, and who works for a particular organisation. We can also have people having several jobs or positions at the same time. For example it is possible to be a member of more than one party.
We can also create a chronology using the start and end dates so that it is possible to see where party allegiances changed, and for how long a role was held (and how long ago). We can also tell you what positions the person held at a certain date in the past.
We treat aspirants the same way - it is just a position held. So Joe Bloggs would have an entry like this:
person: joe-bloggs
role: mp-aspirant
place: nairobi-constiteuncy
organisation: parliament
start-date: 12 Nov 2009
end-date: 15 May 2010
The start-date would be when he announced that he was running and the end-date would be the election. It will be possible to have people run for several seats at once if that is needed.
We store a set of job titles separately to prevent misspellings. Currently there are no constraints between job titles and organisations.