Technical Stuff

Michael Allan mike at
Sun Aug 22 19:07:40 EDT 2010

David Bovill wrote:
> 1. Descriptions of the Restful API's that I can use for interfaces /
>    prototypes / mobile apps

I wish we had an architectural overview.  You'll be a little lost
without it.  I'll describe the pollserver and pollwiki APIs for now,
just to get you started.

These are currently flat file, for the most part (I'll explain why
later).  Here's an overview of the pollserver data:

The latest local votes are here:

The latest external votes (mirrored from other pollservers) are here:

The compiled count (tree structure etc.) isn't properly exposed.  It
would have to be scraped from this user interface:!p!sandbox
But once we have an idea of the client requirements, we can look at
adding a proper API for this.

Pollwiki (also streetwiki, which doesn't exist yet)
MediaWiki provides 3 basic interfaces (see top of page):

In addition, you have Semantic MediaWiki's interfaces:

The first is the richest.  It's essentially a query interface for all
of the formalized data in the wiki.  Take this page for example.  It's
an electoral district:

Here's all the polls, registrants, etc. in that district:[[Division%3A%3ATor%2Friding%2FTrinity-Spadina]]

You can get them in various data formats, too.  Here's JSON:[[Division%3A%3ATor%2Friding%2FTrinity-Spadina]]&p=format%3Djson

> 2. Database schema

Database schemas are extremely simple (no secondary keys or joins).
Here's the raw votes (see "CREATE TABLE"):

Counted results (the tree):

The most complicated thing is the naming of count tables.  We can
mount multiple counts simultaneously, and remount old ones from the
archive.  Each unique mount creates a separate table in the DB.
There's a namespacing scheme to prevent collisions.  See:

> 3. Installation instructions + minimal requirements for installing
>    on a public web server
It may need updating.  When you're ready to install (and we have a
better idea of which parts you'll actually need) I can do an update.

Please let me know if you need more info,
Michael Allan

Toronto, +1 647-436-4521

More information about the Votorola mailing list