How to contribute to the seismograph #jpd14

C. Catalan

The seismograph (sismògraf in Catalan)  is just the beginning (explanation). We believe we can build much more useful services and prettier data visualizations based on this data .

Here are some ideas about what we think we could do with this seismograph:

  • Build an alert service by subject area, for example “20 most recent changes in the Dept. of Justice”
  • Build a journalist-robot that publishes daily changes on a blog and/or on Twitter.
  • Build a change frequency chart, similar to a real seismometer
  • Look for the most neglected areas
  • Look for people who are responsible for a few entities

Please contact @opengovcat if you are interested in building any of the above. Below you will find some details to know about the API.

The seismograph API

So far, the API has only one endpoint: 

http://18.184.0.9/sismograf/api/canvis/<departamento>/<comienzo>/<fin>

For example:

http://18.184.0.9/sismograf/api/canvis/all/2014-01-01/2014-01-31

 

The result

 { status : "ok",
   resultados : { borados    : [ (... list of erased entities ...) ],
                  canvisnom  : [ (... list of entities with new names ...) ],          

                  canvisresp : [ (... list of entities with new responsibilities ...) ],

                  nuevos     : [ (... list of new entities ...) ]
                 }
 }

Properties:

  • “centres”: List of centres for entities with several headquarters, value copied from the source.
  • “cid”:  internal ID of the change. On the URL http://18.184.0.9/sismograf/c/<id> you can obtain an HTML representation.
  • “class”:   CSS  change class
  • “id”: “15377”: ID of the entity. On the URL http://www14.gencat.cat/sacgencat/AppJava/organisme_fitxa.jsp?codi=<id> you can obtain the entity index card
  • “iddep”: “5823”: ID of the higher entity. On the URL http://www14.gencat.cat/sacgencat/AppJava/organisme_fitxa.jsp?codi=<id> you can obtain the entity index card
  • “nom”: Name according to the source
  • “oldnom” : Previous name
  • “oldresp”: Previous person responsible
  • “oldstamp”: Date when a person responsible or a previous name was registered for the first time
  • “resp”: Present person responsible
  • “stamp”: Date of change
  • “test” : see below.

The entities that have changed have a “test” property, a number between 0 and 2. A value higher than that means that there were more changes in it than the name (canvisnom) or the person responsible (canvisresp). Some such changes are simple spelling corrections and this “test” property makes them easier to identify. The changes with “test”<0.1 are filtered by the API and don’t show in the results. “test” is calculated as follows: Leveshtein edit distance(old,new) / Max(len(old),len(new)).

The parametres of the API Call

http://18.184.0.9/sismograf/api/canvis/<departamento>/<comienzo>/<fin>
  • <comienzo> – day one, format is YYYY-MM-DD.
  • <fin> – last day, format is YYYY-MM-DD.
  • <dep> – ‘all’ (as in the example) or the code of the Department in which changes took place. The codes are the following:
    • 6: Presidència (Presidency)
    • 655: Governació i Relacions Institucionals (Government and Institutional Relations, also Vice-presidency)
    • 1103: Economia i Coneixement (Economy and Knowledge)
    • 1599: Ensenyament (Education)
    • 2221: Cultura (Culture)
    • 2803: Salut (Health)
    • 3392: Territori i Sostenibilitat (Territory and Sustainability)
    • 4163: Agricultura, Ramaderia, Pesca, Alimentació i Medi Natural (Agriculture, Cattle Industry, Fishery, Food and Environment)
    • 5823: Benestar Social i Família (Social Welfare and Family)
    • 6581: Parlament de Catalunya (Catalan Parliament)
    • 6611: Sindicatura de Comptes de Catalunya (Auditor’s Office)
    • 6618: Síndic de Greuges de Catalunya (Ombudsperson’s Office)
    • 6619: Consell de Garanties Estatutàries (Council for Statutory Guarantees)
    • 7735: Consell Assessor de Ràdio i Televisió Espanyola (RTVE) a Catalunya (Advisory Board of the Spanish Radio and TV Broadcasting  in Catalonia)
    • 7938: Consell de Treball, Econòmic i Social de Catalunya (Council of Labor Economic and Social Catalonia)
    • 11757: Comissió Jurídica Assessora (Advisory Legal Board)
    • 13123: Autoritat Catalana de la Competència (Catalan Competency Board)
    • 13751: Autoritat Catalana de Protecció de Dades (Catalan Data Protection Board)
    • 13755: Oficina de l’Expresident Pujol (Former President Pujol’s Office)
    • 13757: Justícia (Department of Justice)
    • 13760: Interior (Home Office, Internal Affairs)
    • 13793: Institut Català Internacional per la Pau (ICIP) (International Catalan Institute for Peace)
    • 13961: Consell de l’Audiovisual de Catalunya (CAC) (Catalan Broadcasting Council)
    • 15006: President de la Generalitat (President of the Generalitat)
    • 15638: Empresa i Ocupació (Department of Business and Employment)
    • 15932: Oficina de l’Expresident Maragall (Former President Maragall’s Office)
    • 17194: Oficina Antifrau de Catalunya (Catalan Anti-Fraud Board)
    • 18076: Oficina de l’Expresident Montilla (Former President Montilla’s Office)