Open Legislation

  “Browse, search and share
legislative Information from the
    New York State Senate”
The Developers

         Nathan Freitas
         Jared Williams
          Graylin Kim


#nyss_openlegislation @ freenode
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
Summer 2010
Improving as a Platform
We'll look at then and now
to make clear our trajectory.


Then, end with an open discussion
on the destination of the platform.
The RESTful Interface
Then
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
Now
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
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!
Data
 <response>                                {
    <metadata>                                 "metadata": {
       <total>20</total>                            "total":20,
       <status>SUCCESS</status>                     "status":"success"
    </metadata>                                },
    <results>                                  "results": [
       <result>                                     {
              <type>bill</type>                            "type":"bill",
              <data>                                       "data":{
                 <id>S60023</id>                               "id":"S60023",
                 <text> ..... </text>                          "text":"....",
                 ...                                           ...
              </data>                                      }
       </result>                                    },
       ....                                         ....


Reflection driven dumps of all (useful) available data!
The Response Speed
We don't have metrics
 (we probably should)

Just trust us, it got faster
    Lets look at how
3 Stage Process
1. Populating MySQL


2. Populating Lucene


3. Serving the Data
   –   Routing the Requests
   –   Load the Data
   –   Render the Data
Then
Now
Looking to the Future
Some thoughts...
Complete decoupling of Data Models


Automation with Reflection/Annotation


Standards for Data Models


Client Libraries for more languages, platforms
Work is always ongoing
Suggestions, issues, and concerns are
         ALWAYS welcome.

Nyss Open legislation

  • 1.
    Open Legislation “Browse, search and share legislative Information from the New York State Senate”
  • 2.
    The Developers Nathan Freitas Jared Williams Graylin Kim #nyss_openlegislation @ freenode
  • 3.
    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
  • 4.
  • 5.
    We'll look atthen and now to make clear our trajectory. Then, end with an open discussion on the destination of the platform.
  • 6.
  • 7.
  • 8.
    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
  • 9.
  • 10.
    API Rules 1. URLLayout 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
  • 11.
    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!
  • 12.
    Data <response> { <metadata> "metadata": { <total>20</total> "total":20, <status>SUCCESS</status> "status":"success" </metadata> }, <results> "results": [ <result> { <type>bill</type> "type":"bill", <data> "data":{ <id>S60023</id> "id":"S60023", <text> ..... </text> "text":"....", ... ... </data> } </result> }, .... .... Reflection driven dumps of all (useful) available data!
  • 13.
  • 14.
    We don't havemetrics (we probably should) Just trust us, it got faster Lets look at how
  • 15.
    3 Stage Process 1.Populating MySQL 2. Populating Lucene 3. Serving the Data – Routing the Requests – Load the Data – Render the Data
  • 16.
  • 20.
  • 24.
  • 25.
    Some thoughts... Complete decouplingof Data Models Automation with Reflection/Annotation Standards for Data Models Client Libraries for more languages, platforms
  • 26.
    Work is alwaysongoing Suggestions, issues, and concerns are ALWAYS welcome.