Nyss Open legislation

26
Open Legislation Browse, search and share legislative Information from the New York State Senate

description

The slides from my presentation on the internal architecture and future plans for the New York State Senate's Open Legislation project @ Capitol Camp.

Transcript of Nyss Open legislation

Page 1: Nyss Open legislation

Open Legislation

“Browse, search and share legislative Information from the

New York State Senate”

Page 2: Nyss Open legislation

The Developers

Nathan FreitasJared Williams

Graylin Kim

#nyss_openlegislation @ freenode

Page 3: Nyss Open legislation

Announcements

Opened our platform– Eclipse J2EE, detailed setup instructions– Moved to Github!

● http://github.com/nysenatecio/OpenLegislation

Went Mobile!– On the iPhone, Android, Blackberry, and iPad

Gathering outside interest

Page 4: Nyss Open legislation

Summer 2010

Improving as a Platform

Page 5: Nyss Open legislation

We'll look at then and nowto make clear our trajectory.

Then, end with an open discussionon the destination of the platform.

Page 6: Nyss Open legislation

The RESTful Interface

Page 7: Nyss Open legislation

Then

Page 8: Nyss Open legislation

API

Collection – /api/1.0/<format>/<otype>/<oid>– /api/1.0/html/bill/S66026

– /api/1.0/html/calendar/cal-floor-00001-2009-2010

– /api/1.0/html/transcript/1401

Search – search/?term=<query>&format=<format>– /search/?term=otype:action&pageIdx=5&pageSize=40

Shortcuts - /<shortcut>– /actions

– /bills

– /votes

Page 9: Nyss Open legislation

Now

Page 10: Nyss Open legislation

API Rules

1. URL Layout Should be Consistent and Unified– /2.0/<command>

2. Required Arguments Should be explicit– /2.0/<command>/<the>/<required>.<format>

3. Arguments should be clear and understandable– /2.0/bill/<bill_id>-<session year>.<format>

– /2.0/calendar/<type>-<MM-DD-YYYY>.<format>

– /2.0/transcript/<type>-<MM-DD-YYYY>.<format>

4. Provide as much information as possible

Page 11: Nyss Open legislation

API

/2.0/command(/<required_arg>)*.<format>

Examples– /2.0/search.html?term=oid:S66026 AND otype:bill– /2.0/bill/S66026-2009.json– /2.0/transcript/regular-06-22-2010.xml– /2.0/calendar/tomorrow.html

Not backwards compatible!

Page 12: Nyss Open legislation

Data

<response>

<metadata>

<total>20</total>

<status>SUCCESS</status>

</metadata>

<results>

<result>

<type>bill</type>

<data>

<id>S60023</id>

<text> ..... </text>

...

</data>

</result>

....

{

"metadata": {

"total":20,

"status":"success"

},

"results": [

{

"type":"bill",

"data":{

"id":"S60023",

"text":"....",

...

}

},

....

Reflection driven dumps of all (useful) available data!

Page 13: Nyss Open legislation

The Response Speed

Page 14: Nyss Open legislation

We don't have metrics(we probably should)

Just trust us, it got fasterLets look at how

Page 15: Nyss Open legislation

3 Stage Process

1. Populating MySQL

2. Populating Lucene

3. Serving the Data– Routing the Requests– Load the Data– Render the Data

Page 16: Nyss Open legislation

Then

Page 17: Nyss Open legislation
Page 18: Nyss Open legislation
Page 19: Nyss Open legislation
Page 20: Nyss Open legislation

Now

Page 21: Nyss Open legislation
Page 22: Nyss Open legislation
Page 23: Nyss Open legislation
Page 24: Nyss Open legislation

Looking to the Future

Page 25: Nyss Open legislation

Some thoughts...

Complete decoupling of Data Models

Automation with Reflection/Annotation

Standards for Data Models

Client Libraries for more languages, platforms

Page 26: Nyss Open legislation

Work is always ongoingSuggestions, issues, and concerns are

ALWAYS welcome.