Lex school 2011

1,569 views

Published on

Presentación mostrada para el Summer Lex School 2011, http://summerschoollex.cirsfid.unibo.it/

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,569
On SlideShare
0
From Embeds
0
Number of Embeds
544
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lex school 2011

  1. 1. LeyChile Sept. 10, 2011 Christian Sifaqui
  2. 2. Congreso Nacional de Chile
  3. 4. BCN roles <ul><li>Parliamentary role, to be a relevant instrument, in the opinion of MPs and the Parliament, for the full accomplishment of their commitments and also the peering into new possible country scenarios </li></ul>
  4. 5. BCN roles <ul><li>Parliamentary role, to be a relevant instrument, in the opinion of MPs and the Parliament, for the full accomplishment of their commitments and also the peering into new possible country scenarios </li></ul><ul><li>Societal role, to be the repository of the Archives of the Parliament, especially the history of law and parliamentary work </li></ul>
  5. 6. BCN roles <ul><li>Parliamentary role, to be a relevant instrument, in the opinion of MPs and the Parliament, for the full accomplishment of their commitments and also the peering into new possible country scenarios </li></ul><ul><li>Societal role, to be the repository of the Archives of the Parliament, especially the history of law and parliamentary work </li></ul><ul><li>Public role, to be the space of knowledge and understanding of the areas of social priority for the country with emphasis on the political and legal </li></ul>
  6. 7. Biblioteca del Congreso Nacional <ul><li>Metaphor </li></ul><ul><li>¿Pharmacy? Books and Magazines loan; Catalog </li></ul>
  7. 8. Biblioteca del Congreso Nacional <ul><li>Metaphor </li></ul><ul><li>¿Pharmacy? Books and Magazines loan; Catalog </li></ul><ul><li>¡Clinical laboratory! Chilean norms; Parliamentary work; History of the Law; Parliamentary biographies; GIS; Parliamentary advisory, etc. </li></ul>
  8. 9. Legislation
  9. 10. Legislation <ul><li>Set of norms (acts, laws, decrees) that frame the national juridical order </li></ul>
  10. 11. Legislation <ul><li>Set of norms (acts, laws, decrees) that frame the national juridical order </li></ul><ul><li>Information that comes from the public sector; it is generated by public organizations and financed by public resources </li></ul>
  11. 12. Legislation <ul><li>Set of norms (acts, laws, decrees) that frame the national juridical order </li></ul><ul><li>Information that comes from the public sector; it is generated by public organizations and financed by public resources </li></ul><ul><li>By nature of public interest (about general interest topics) </li></ul>
  12. 13. Legislation <ul><li>Set of norms (acts, laws, decrees) that frame the national juridical order </li></ul><ul><li>Information that comes from the public sector; it is generated by public organizations and financed by public resources </li></ul><ul><li>By nature of public interest (about general interest topics) </li></ul><ul><li>High public value (generates citizen experience that can be considered valuable) </li></ul>
  13. 14. Legislation <ul><li>Is indeed public information and must be of public domain </li></ul>
  14. 15. Legislative information on public domain <ul><li>“ Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met) </li></ul>
  15. 16. Legislative information on public domain <ul><li>“ Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met) </li></ul><ul><li>2 points of view: </li></ul><ul><ul><li>Juridical safety: guaranteed and founded certainty that the norm will be accomplished </li></ul></ul>
  16. 17. Legislative information on public domain <ul><li>“ Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met) </li></ul><ul><li>2 points of view: </li></ul><ul><ul><li>Juridical safety: guaranteed and founded certainty that the norm will be accomplished </li></ul></ul><ul><ul><li>Juridical certainty: perception of the norm and certainty of the content </li></ul></ul>
  17. 18. Mechanism for the publication of the legislation <ul><li>Publication mechanism: Official Gazette </li></ul>
  18. 19. Mechanism for the publication of the legislation <ul><li>Publication mechanism: Official Gazette </li></ul><ul><li>Legal fiction of knowledge: </li></ul><ul><ul><li>Civil Code </li></ul></ul><ul><ul><ul><li>Art. 7 “The publication of the law will be made by its insertion in the Official Gazette, and from that date it will be known by everybody, and it will be mandatory.” </li></ul></ul></ul><ul><ul><ul><li>Art. 8 “Nobody will be able to plead ignorance of the law after it has entered into force.” </li></ul></ul></ul><ul><ul><ul><li>Art. 706 “...the error of law is a presumption of bad faith, that does not admit evidence to the contrary.” </li></ul></ul></ul>
  19. 20. Mechanism for the publication of the legislation <ul><li>But in Chile: </li></ul><ul><ul><li>The Official Gazette is not free </li></ul></ul><ul><ul><li>The publishing of the laws is basically about modifying norms and not about texts in force </li></ul></ul><ul><ul><li>Access to old legislation is very difficult </li></ul></ul>
  20. 21. Example of a legal norm <ul><li>Ley 22000 </li></ul><ul><li>Artículo 1. abc. </li></ul><ul><li>Artículo 2. def. </li></ul><ul><li>Artículo 3. ghi. </li></ul><ul><li>Y por cuanto he tenido a bien </li></ul><ul><li>aprobarlo y sancionarlo… </li></ul>
  21. 22. Example of a legal norm that modifies another <ul><li>Ley 25345 </li></ul><ul><li>Artículo 1. Modifica ley 22000 de la siguiente forma: reemplázase en el Artículo 1 las palabras “a” por “xyz”. </li></ul><ul><li>Y por cuanto he tenido a bien </li></ul><ul><li>aprobarlo y sancionarlo… </li></ul>
  22. 23. Example: original and its update Ley 22000 Artículo 1. a bc. Artículo 2. def. Artículo 3. ghi. Ley 22000 Artículo 1. xyz bc. Artículo 2. def. Artículo 3. ghi. t 0 t 1
  23. 24. Model Biblioteca del Congreso Nacional Ley 22000 1.- abc 2.- def 3.- ghi (original) 1.- abc 2.- def 3.- ghi Diario oficial Ley 22000
  24. 25. Model Biblioteca del Congreso Nacional Ley 25345 1.- Modifica ley 22000 Art. 1 sustitúyase a por xyz (original) 1.- abc 2.- def 3.- ghi (actualizado) 1.- xyz bc 2.- def 3.- ghi Ley 25345 1.- Modifica ley 22000 Art. 1 sustitúyase a por xyz Diario oficial Ley 22000 Ley 25345
  25. 26. BCN <ul><li>As a way to solve the “juridical certainty” for the Congress and also for the citizens, the BCN started in the 50’s an index card system collecting the references of the norms and also classified them by subject </li></ul>
  26. 27. BCN <ul><li>In the late 70 this index card system was replaced by an IBM STAIRS system, which allowed automate this cards and annotations </li></ul><ul><li>Then in mod-90s, this system was replaced by a client-server system based on BASIS PLUS, which allowed to reconstruct the texts of the norms on the fly </li></ul>
  27. 28. Legis 1995-2009 <ul><li>Client-Server interface </li></ul>
  28. 29. Legis 1995-2009 <ul><li>Web interface </li></ul>
  29. 30. Legis 1995-2009 <ul><li>Web interface </li></ul>
  30. 31. Project “Ley Chile”
  31. 32. Project “Ley Chile” <ul><li>The BCN is the de facto reference for the entire juridical and legislative community regarding to the generation of the updated versions of the legal norms (especially the laws) </li></ul>
  32. 33. Project “Ley Chile” <ul><li>The BCN has a special expertise in the processing of the official publications of the legal norms in order to: </li></ul><ul><ul><li>Keep record of the legal norms that appear for the first time </li></ul></ul><ul><ul><li>Keep record of the legal norms that modify other norms </li></ul></ul><ul><ul><li>Keep record of the links between norms (rules, concordances, recasted texts and modifications) </li></ul></ul><ul><ul><li>Make updated versions of the modified norms </li></ul></ul><ul><ul><li>Incorporate technical notes that allow the users have all the facts to make their own interpretation </li></ul></ul>
  33. 34. Project “Ley Chile” <ul><li>The BCN has rigorous quality control processes to provide high fidelity documentation regarding the sources </li></ul>
  34. 35. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>BCN knows what </li></ul><ul><li>BCN knows how </li></ul><ul><li>BCN needs help to write the documents for the procurement (tender) </li></ul>
  35. 36. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Aimed primarily for use in the legislative process </li></ul><ul><li>Free access to citizens </li></ul><ul><li>Improve the availability of the norm </li></ul><ul><li>Juridical certainty: access to current and update norms </li></ul><ul><li>Emphasis on quality of the content </li></ul><ul><li>Search and navigation. Outputs in different formats </li></ul><ul><li>Differentiated services between registered and anonymous users </li></ul>
  36. 37. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Benefits of the new system </li></ul><ul><li>Content </li></ul><ul><ul><li>Content migration and its improvement </li></ul></ul><ul><ul><li>Removing notes, norm structure and correction </li></ul></ul><ul><li>Production management (Content Management) </li></ul><ul><ul><li>Integration with the architecture of the BCN </li></ul></ul><ul><ul><li>Improving the quality content and management </li></ul></ul><ul><ul><li>Production management </li></ul></ul><ul><li>Search services, recovery and outputs </li></ul><ul><ul><li>Free access of the entire database for all citizens </li></ul></ul><ul><li>Availability </li></ul><ul><ul><li>Acquisition of hardware </li></ul></ul><ul><li>Interoperability </li></ul><ul><ul><li>Exchange information with other state institutions. Agreements with Agencies. Submit the updated norm </li></ul></ul>
  37. 38. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Modeling the “life” of a norm </li></ul>
  38. 39. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Tender (a mix of HW and SW) </li></ul><ul><li>Declared deserted </li></ul>
  39. 40. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Tender (a mix of HW and SW) </li></ul><ul><li>Declared deserted </li></ul><ul><li>I took over as Director </li></ul>
  40. 41. Project “Ley Chile”: phase 1 (2004-2006) <ul><li>Tender (a mix of HW and SW) </li></ul><ul><li>Declared deserted </li></ul><ul><li>I took over as Director </li></ul><ul><li>Rewriting bidding documents (changes in model, debugging use cases) </li></ul><ul><li>New tender (only SW) </li></ul><ul><li>Award </li></ul>
  41. 42. Project “Ley Chile”: phase 2 (2007-2008) Project Director Project manager Coordination Production Coordination Services Ley Chile Board Director BCN Under Director BCN Heads of department BCN
  42. 43. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Production management </li></ul><ul><ul><li>New way of processing norms </li></ul></ul>
  43. 44. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Production management </li></ul><ul><ul><li>New way of processing norms </li></ul></ul><ul><li>Content </li></ul><ul><ul><li>Migration (debugging, repairing, standards, completeness) </li></ul></ul>
  44. 45. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Production management </li></ul><ul><ul><li>New way of processing norms </li></ul></ul><ul><li>Content </li></ul><ul><ul><li>Migration (debugging, repairing, standards, completeness) </li></ul></ul><ul><li>Services </li></ul><ul><ul><li>Usability, interaction, design </li></ul></ul>
  45. 46. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Production management </li></ul><ul><ul><li>New way of processing norms </li></ul></ul><ul><li>Content </li></ul><ul><ul><li>Migration (debugging, repairing, standards, completeness) </li></ul></ul><ul><li>Services </li></ul><ul><ul><li>Usability, interaction, design </li></ul></ul><ul><li>Availability </li></ul><ul><ul><li>Acquisition of ad-hoc hardware </li></ul></ul>
  46. 47. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Modeling the “structure” of a norm </li></ul>
  47. 48. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Modeling the “visualization” of a norm </li></ul>
  48. 49. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Use of activity diagrams (facilitates the understanding of business processes) </li></ul>
  49. 50. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Architecture of the system </li></ul>Output formats
  50. 51. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Architecture </li></ul>
  51. 52. Project “Ley Chile”: phase 2 (2007-2008) Capa de Presentación Capa de Negocios Capa de Datos HTTP RDBMS (oracle) Componentes API API CM Analista Documental Páginas WEB Dinámicas Digitador Workflow Planificar OT API Legis Intranet Producto Management Ej: Páginas para Módulo Producción Servicios WEB Módulos WEB Services ZOPE Python Usuarios BCN Otros Sistemas BCN “ Servicios WEB” Librerías Python Consulta Navegar Avanzada Vinculaciones Web Services Producto Delivery Ej : Páginas para Búsqueda y Navegación Convenios con instituciones Usuarios Internet “ Servicios WEB” PLONE Python Productos Páginas dinámicas ZPT-TAL
  52. 53. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>The retrieval mechanism of a norm from the XML database and its interactive navigation has been optimized to reduce the overload on the servers: </li></ul><ul><ul><li>the main processing is done in the browser of each client, which parses the delivered XML, making heavy use of asynchronous JavaScript capabilities </li></ul></ul><ul><li>Decision taken on 2006 (Google Chrome was released on 2008!) </li></ul>
  53. 54. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Retrieval : the user selects a norm for navigating, the business layer makes a request to the database, which gets the XML for the entire norm </li></ul>
  54. 55. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Retrieval : the user selects a norm for navigating, the business layer makes a request to the database, which gets the XML for the entire norm </li></ul><ul><li>Extracting version : the business layer extract the XML of the required version of the norm </li></ul>
  55. 56. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Retrieval : the user selects a norm for navigating, the business layer makes a request to the database, which gets the XML for the entire norm </li></ul><ul><li>Extracting version : the business layer extract the XML of the required version of the norm </li></ul><ul><li>Parsing : the browser parses the received XML, creating a data structure that represents the hierarchical organization of the norm, which is shown graphically as a navigation tree </li></ul>
  56. 57. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Retrieval : the user selects a norm for navigating, the business layer makes a request to the database, which gets the XML for the entire norm </li></ul><ul><li>Extracting version : the business layer extract the XML of the required version of the norm </li></ul><ul><li>Parsing : the browser parses the received XML, creating a data structure that represents the hierarchical organization of the norm, which is shown graphically as a navigation tree </li></ul><ul><li>Display : in a asynchronous form a dynamic HTML is generated with the text of the whole norm together with graphical elements, such as notes and metadata </li></ul>
  57. 58. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Retrieval : the user selects a norm for navigating, the business layer makes a request to the database, which gets the XML for the entire norm </li></ul><ul><li>Extracting version : the business layer extract the XML of the required version of the norm </li></ul><ul><li>Parsing : the browser parses the received XML, creating a data structure that represents the hierarchical organization of the norm, which is shown graphically as a navigation tree </li></ul><ul><li>Display : in a asynchronous form a dynamic HTML is generated with the text of the whole norm together with graphical elements, such as notes and metadata </li></ul><ul><li>Navigation : as the user selects different parts of the norm, the same process is done, but for a part of the norm </li></ul>
  58. 59. Project “Ley Chile”: phase 2 (2007-2008)
  59. 60. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Hardware architecture and sizing: </li></ul><ul><ul><li>For supporting the application services, we used QUAD-core processors for the physical servers </li></ul></ul><ul><ul><li>For the database servers we use dual core (database licenses restrictions) and 64-bits architecture (cpu 64-bit) </li></ul></ul><ul><ul><li>We physically separated the development and production environments </li></ul></ul><ul><ul><li>The internet platform includes load balancing and cache accelerator </li></ul></ul><ul><ul><li>We use ZEO architecture for scaling ZOPE </li></ul></ul><ul><ul><li>Production servers were conected via gigabit network </li></ul></ul><ul><ul><li>Disk storage was provided by a centralized storage (SAN) </li></ul></ul>
  60. 61. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Availability </li></ul><ul><ul><li>Acquisition of hardware (original) </li></ul></ul>
  61. 62. Project “Ley Chile”: phase 2 (2007-2008) <ul><li>Tuning and evolution </li></ul><ul><ul><li>We incorporated a cache-balacning software on the front-end </li></ul></ul><ul><ul><li>The persistence of the sessions of the connected users was handled in the database </li></ul></ul><ul><ul><li>ZEO cluster was not necessary, we set up two independent ZOPE application servers, each one with two clients balanced with Varnish </li></ul></ul><ul><ul><li>We migrate the application servers to blade servers </li></ul></ul><ul><ul><li>We added several data cache services (PDF, precomputed norms, etc.) kept in a shared NFS server (was a ZEO server initially) </li></ul></ul><ul><ul><li>We added a static content server (js, images and css) </li></ul></ul><ul><ul><li>We added a norm previsualizing server for the production environment </li></ul></ul><ul><ul><li>We added “fault tolerance” and high availability for critical servers (managed by VMWARE) </li></ul></ul>
  62. 63. Hardware today Reunión de directorio 10 marzo Arquitectura de Hardware Servidor separado Servidor BLADE Fault Tolerance Alta disponibilidad R12D R22 R20 20A R23D FT R11 FT Servidores Virtualizados VMWARE 20B R21 FT
  63. 64. Proyecto Ley Chile: etapa 2 (2007-2008) - Acceso desde Intranet a aplicación Content Management - Pocos usuarios - Tiempo de respuesta: 5 segundos - Se agrega alta disponibilidad ni balance de carga. Se habilitan los servicios de ZOPE para Content Management en modo Fault Tolerant. Se Comparte el repositorio documental y el pool de conexiones. - Acceso desde Internet a aplicación Content Delivery - Muchos usuarios - Tiempo de respuesta max.: 5 segundos - Necesita alta disponibilidad, cache y balance de carga. Debido a esto se propone habilitar en la arquitectura Balanceador , Cache Considerar pool de conexiones a la Base de Datos Al mismo tiempo se debe considerar Cluster de Oracle (RAC) para el repositorio Documental. R11 :Balanceo Y Caché R23D : Caché estático R12 y R22D : Consulta, Navegación y WS Usuarios Internet WS otros sitemas BCN y Externos Red Interna R20A : Producción 2 clientes R20 : Producción Balanceo, caché y 1 Cliente Usuarios Producción * Ingreso *Actualización * Integración * Corrección R20B :, vista previa norma R21 : NFS archivos compartidos: PDFs normas, precálculo,imágenes
  64. 65. Timeline <ul><li>2004 </li></ul><ul><li>Start project for the new version of the chilean law </li></ul><ul><li>Created a newsletter of the legislative work http://boletinlegislativo.bcn.cl </li></ul>
  65. 66. Timeline <ul><li>2007 </li></ul><ul><li>Start building phase of LeyChile </li></ul>
  66. 67. Timeline <ul><li>2008 </li></ul><ul><li>Launch blog http://bloglegal.bcn.cl </li></ul><ul><li>Release http:// www.leychile.cl </li></ul>
  67. 68. Migration <ul><li>Detailed review (example: notes) </li></ul>Right note. Located in the column 60 Text located in the position of a note. A note is detected
  68. 69. Migration <ul><li>Detection of notes </li></ul>L: indicates a normal line Notes 1: indicates the sequence N: indicates the detection of a note
  69. 70. Migration <ul><li>Initial concept </li></ul><ul><ul><li>Emphasis on data transfer </li></ul></ul><ul><ul><li>Massive correction with external resources &quot;guided&quot; by BCN </li></ul></ul><ul><li>New approach </li></ul><ul><ul><li>Takes into account the quality of information </li></ul></ul><ul><ul><li>Provides mechanisms to improve the quality of information </li></ul></ul><ul><ul><li>“ Transformation of data” over “transfer of data” </li></ul></ul>
  70. 71. Migration Carga y Transformación Texto Normas Legis I Correcciones automáticas y validaciones Planificador Correcciones manuales y masivas (XLS) Base de datos Ley Chile Supervisa todo el proceso, asigna trabajo a analistas, decide qué inconsistencias son obligatorias (errores) Inconsistencias en normas No Si Normas Rechazadas Prep. Formatos
  71. 72. Migration <ul><li>Migration environment </li></ul>BCN Servicios Digitales BCN Producción Ley Bases de Datos BASISplus Migración Bases de Datos de corregida Proceso Proceso de Corrección Base de Datos BASISplus Extractor Incremental Base de Datos de Migración Módulo de cuadratura migración Módulo de Verificación y Corrección Control migración Listados de 1…n Listados de control explotación 1…n Listados de 1…n Transformación y Carga Listado de Rechazos 1..n Ambiente Explotación BASISPlus Normas y vinculaciones extraídas 1..n Ambiente Migración Verificación Listados de 1…n
  72. 73. Migration <ul><li>Data loading </li></ul>Bases de Datos de corregida Bases de Datos XML Migrada Listados de Control carga 1…n Base de Datos de Migración Control migración Listado de 1…n Generador y Carga XML LEGIS II Listado de Rechazos 1..n Módulo de Cuadratura Carga OT Depuración Proveedor BCN Producción Ley
  73. 74. Migration <ul><li>Too much effort </li></ul><ul><ul><li>Separation of hundreds of thousands of notes </li></ul></ul><ul><ul><li>Review and adapt the structures of norms </li></ul></ul><ul><ul><li>Semi-automated process for debugging </li></ul></ul>
  74. 75. Budget <ul><li>Phase 2 </li></ul><ul><ul><li>Development: US$ 380.000 + change management </li></ul></ul><ul><ul><li>Hardware: US$ 150.000 </li></ul></ul><ul><ul><li>Database license + training: US$ 100.000 </li></ul></ul><ul><ul><li>Maintenance and support (reduced for 3 years) </li></ul></ul><ul><ul><li>Content migration/debugging: US$ 100.000 </li></ul></ul>
  75. 76. Tuning <ul><li>Layered model </li></ul><ul><li>Different layers that need to be reviewed separately </li></ul>Hardware Database ORACLE Business layer Plone-python Presentation layer JavaScript Balance layer Pound-squid Requires computers with good performance Pound-Squid was changed for Varnish Profiling must be done An external firm will be hired to audit
  76. 77. Tuning <ul><li>Actions taken </li></ul><ul><ul><li>Analyze usage statistics </li></ul></ul><ul><ul><ul><li>Days/hours a day </li></ul></ul></ul><ul><ul><ul><li>Percentage of logged users vs. anonymous users </li></ul></ul></ul><ul><ul><ul><li>More searched norms </li></ul></ul></ul><ul><ul><ul><li>More navigated norms </li></ul></ul></ul><ul><ul><li>Seen funcionality </li></ul></ul>
  77. 78. Tuning <ul><li>Presentation layer </li></ul><ul><ul><li>Symptom : slow by showing big norms (there are no more than 30, codes) </li></ul></ul><ul><ul><li>Solution: is a distributed system, we are betting that users will be use better computers, because the application makes heavy use of JavaScript </li></ul></ul><ul><ul><li>Symptom : search is slow </li></ul></ul><ul><ul><li>Problem: there are words with no meaning that generate many hits </li></ul></ul><ul><ul><li>Solution: to programm discard rules </li></ul></ul><ul><ul><ul><li>Simple search: </li></ul></ul></ul><ul><ul><ul><ul><li>Restriction of keywords (case sensitive) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Single letters: a, b…, A, B,… </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Law, decree,and so on. Use a parametric table for discarding phrases </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Pattern [one letter] spaces[number]* </li></ul></ul></ul></ul><ul><ul><ul><li>Advanced search: </li></ul></ul></ul><ul><ul><ul><ul><li>To restrict only if the type Law is selected </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Same as above </li></ul></ul></ul></ul><ul><ul><li>Symptom : slow for navigating big norms (codes) </li></ul></ul><ul><ul><li>Problem: navigation is always full text </li></ul></ul><ul><ul><li>Partial solution: </li></ul></ul><ul><ul><ul><li>Recommend using PDF for the 30 big norms </li></ul></ul></ul><ul><ul><ul><li>Navigation is always full-text, enable access to hit list at article level, without loading the entire tree or optimize tree load </li></ul></ul></ul><ul><ul><ul><li>Optimize list of versions </li></ul></ul></ul>
  78. 79. Tuning <ul><li>Load balancing layer </li></ul><ul><ul><li>Symptom: slow loading of the home page and navigation between static pages, slow loading of static pages </li></ul></ul><ul><ul><li>Problem : there are 4 clients zope, but only one or two are used, leaving the rest idle </li></ul></ul><ul><ul><li>Solution : improve load balancing, manage connected users to not lose the session during the balancing, a consultant was hired to install a server balancing that distinguishes connected sessions of anonymous, allowing also to cache pages. </li></ul></ul><ul><ul><li>Problem : Congress users use Legis. They are accustomed to a better response time but with much more limited functionality </li></ul></ul><ul><ul><li>Solution : To evaluate the possibility of creating a dedicated server </li></ul></ul>
  79. 80. Tuning <ul><li>Business layer </li></ul><ul><ul><li>Symptom : Zope shows CPU usage peaks </li></ul></ul><ul><ul><li>Solution : profiling to investigate cause </li></ul></ul><ul><ul><ul><li>Parameters SQL-Alchemy </li></ul></ul></ul><ul><ul><ul><li>Zope parameters </li></ul></ul></ul><ul><ul><li>Problem : export process is done on the server, although it is very fast, consumes resources for a short period of time </li></ul></ul><ul><ul><li>Solution : cache files generated by the export. Low server load and improve response time </li></ul></ul><ul><ul><ul><li>Each time a norm is exported, the file will be generated in the file system if it does not exist. If it exists the file will download directly </li></ul></ul></ul><ul><ul><ul><li>To keep the norms up to date, the cached file will be removed if it is modified </li></ul></ul></ul><ul><ul><li>Symptom : big norms are slow </li></ul></ul><ul><ul><li>Solution : </li></ul></ul><ul><ul><ul><li>improve the process of precalculating norms and the display of big norms </li></ul></ul></ul><ul><ul><ul><li>more storage space for precalculation </li></ul></ul></ul><ul><ul><ul><li>NFS support for the servers </li></ul></ul></ul><ul><ul><ul><li>Allow download of precalculated pdf for big norms from the hit list </li></ul></ul></ul><ul><ul><li>Symptom : versions of a norm is slow </li></ul></ul><ul><ul><ul><li>Cache of the versions apparently is not working </li></ul></ul></ul><ul><ul><ul><li>delete versions </li></ul></ul></ul>
  80. 81. Tuning <ul><li>Database </li></ul><ul><ul><li>Symptom : big norms are slow </li></ul></ul><ul><ul><li>Solution : identify double article with the name of the article associated in titulo_parte. The objective is to promote access to parts of a big norm using advanced search </li></ul></ul><ul><ul><li>Symptom : hit list is slow to specific queries </li></ul></ul><ul><ul><li>Solution : optimize phrase search in advanced search </li></ul></ul><ul><ul><li>Symptom : improve response times in general </li></ul></ul><ul><ul><li>solution : </li></ul></ul><ul><ul><ul><li>Optimize some critical stored procedures </li></ul></ul></ul><ul><ul><ul><li>Tuning of Oracle according to current use </li></ul></ul></ul>
  81. 82. Interoperability: linking <ul><li>This alternative works as a simple hyperlink that goes to the norm, in its updated version, displayed in the navigation module </li></ul><ul><li>Example: </li></ul><ul><li>http://www.leychile.cl/Navegar?idNorma=141599 </li></ul><ul><li>This link contains the parameter idNorma which is the unique number of the norm </li></ul><ul><li>As an alternative parameter (only for laws) the idLey parameter can be used </li></ul><ul><li>Example for the same norm: </li></ul><ul><li>http://www.leychile.cl/Navegar?idLey=19628 </li></ul><ul><li>By using this URL: </li></ul>
  82. 83. Interoperability: xml <ul><li>Ley Chile provides the norm in XML according to a interchange schema (see www.aem.gob.cl ): </li></ul><ul><li>http://www.leychile.cl/esquemas/EsquemaIntercambioNorma-v1-0.xsd </li></ul><ul><li>Documentation: http://www.leychile.cl/Plone/Legis/esquemas/accesoLeyesChilenas4.pdf </li></ul><ul><li>The server receives a request via HTTP with parameters opt=7 (service id) and the identification of the normwith either idNorma or idLey and returns the XML </li></ul><ul><li>Always will be delivered the updated version of the norm </li></ul><ul><li>Examples: </li></ul><ul><ul><li>Get the law 18575: </li></ul></ul><ul><ul><li>http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=18575 </li></ul></ul><ul><ul><li>Get the law 19846 by using its id </li></ul></ul><ul><ul><li>http://www.leychile.cl/Consulta/obtxml?opt=7&idNorma=206396 </li></ul></ul><ul><li>Additional parameter, foot notes: </li></ul><ul><li>notaPIE: if 1, the text will come with foot notes </li></ul><ul><li>Example: </li></ul><ul><ul><li>Get law 18575 with foot notes </li></ul></ul><ul><ul><li>http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=18575&notaPIE=1 </li></ul></ul>
  83. 84. Interoperability: xml <ul><li>Example with output for </li></ul><ul><ul><ul><li>http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=20000 </li></ul></ul></ul>
  84. 85. Interoperability: Contraloría Consume Dictámenes asociados a una ley Envía parámetros Capa de Presentación Capa de Negocios Capa de Integración Usuarios Internet www.leychile.cl Contraloría Parámetros: Número ley Prepara lista de resultados Requerimiento de dictámenes para cualquier ley AJAX AJAX Sistema Ley Chile
  85. 86. Interoperability: Organizations c Servicio: Provee XML de la norma Recibe parámetros Capa de Negocios Capa de Integración Requerimiento HTTP Organizaciones Instituciones Parámetros: * Número ley/Identificador de la norma * Fecha Versión * Notas Sistema Ley Chile Repositorio Documental Capa de Datos http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=18575 Esquema XML público de la norma (www.aem.gob.cl): http://www.leychile.cl/esquemas/EsquemaIntercambioNorma-v1-0.xsd
  86. 87. LeyChile 2009- “ Nickname”, nombre popular
  87. 88. LeyChile 2009-
  88. 89. LeyChile 2009- Other way is by using a webservice http://www.leychile.cl/Consulta/obtxml?opt=61&cadena=[texto_a_buscar][&exacta=[1|]&cantidad=[5]]
  89. 90. LeyChile 2009- <ul><li>http://www.leychile.cl/ws/LeyChile.wsdl </li></ul>
  90. 91. Workflow: norm input
  91. 93. Norm input: mail from Official Gazette
  92. 94. Norm input: text file
  93. 95. Norm input: basic marking
  94. 96. Norm input: loading file with marks
  95. 97. Norm input: planification
  96. 98. Planification: video <ul><li>PLANIFICACION.AVI </li></ul>
  97. 99. Norm input: video <ul><li>INGRESO.AVI </li></ul>
  98. 100. Norm input: norm marking (images)
  99. 101. Norm input: norm marking (linking)
  100. 102. Hiperlink <ul><li>HIPERVINCULO.AVI </li></ul>
  101. 103. Norm input: QA
  102. 104. Other workflows (more complex) <ul><li>Updating norms </li></ul><ul><li>Digitation </li></ul><ul><li>etc. </li></ul><ul><li>Videos </li></ul>
  103. 106. GTA: video <ul><li>GTA.AVI </li></ul>
  104. 108. Best practices (some) <ul><li>The hardest first </li></ul><ul><li>Define satisfaction criteria to measure success </li></ul><ul><li>Have alternative plans </li></ul><ul><li>Avoid turnover </li></ul><ul><li>Is a content system… content! </li></ul><ul><li>Test, test and… test </li></ul><ul><li>Save budget por change management </li></ul>
  105. 109. http://datos.bcn.cl <ul><li>Open/Linked data </li></ul>LeyChile datos.bcn.cl Tripletas RDF Ontologías OWL – RDF Schema Endpoint Sparql – Interfaz Web WS - SOAP Normas XML Herramientas de generación de mashup del grafo Internet etc. Linked data desde consultas
  106. 110. URI
  107. 111. URI <ul><li>cl/ley/{numero}/data.{ext} </li></ul><ul><li>cl/ley/{numero}/{lang}@{fecha_version}/data.{ext} </li></ul><ul><li>Law 17.335 in its spanish version from march, 31 2011 in JSON format </li></ul><ul><li>cl/ley/17335/es@2011-03-31/data.json </li></ul>
  108. 112. Ontology for LeyChile
  109. 113. URI <ul><li>HTML + RDFa </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/20000/datos.html </li></ul></ul><ul><li>n3 </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/20000/datos.n3 </li></ul></ul><ul><li>RDF </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/20000/datos.rdf </li></ul></ul><ul><li>JSON </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/20000/datos.json </li></ul></ul><ul><li>ntriples </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/20000/datos.ntriples </li></ul></ul><ul><li>Otro ejemplo: </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/DTO/ministerio-de-educacion/2004-09-21/173/es@2009-11-19/datos.html </li></ul></ul>
  110. 114. Endpoint Sparql <ul><li>List of organizations: </li></ul><ul><ul><li>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> </li></ul></ul><ul><ul><li>PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#> </li></ul></ul><ul><ul><li>SELECT distinct ?nombre </li></ul></ul><ul><ul><li>WHERE { </li></ul></ul><ul><ul><li>?org norms:creatorOf ?o . </li></ul></ul><ul><ul><li>?org norms:hasName ?nombre </li></ul></ul><ul><ul><li>} </li></ul></ul>
  111. 115. Endpoint Sparql <ul><li>Version of a norm: </li></ul><ul><ul><li>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> </li></ul></ul><ul><ul><li>PREFIX dc: <http://purl.org/dc/elements/1.1/> </li></ul></ul><ul><ul><li>PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#> </li></ul></ul><ul><ul><li>SELECT ?n ?id_norma ?tipo ?nro ?prDate ?pbDate ?titulo ?lang ?html </li></ul></ul><ul><ul><li>WHERE { </li></ul></ul><ul><ul><li>?n dc:identifier &quot;206396&quot; . </li></ul></ul><ul><ul><li>?n norms:hasNumber ?id_norma . </li></ul></ul><ul><ul><li>?n dc:title ?titulo . </li></ul></ul><ul><ul><li>?n dc:language ?lang . </li></ul></ul><ul><ul><li>?n norms:type ?tipo . </li></ul></ul><ul><ul><li>?n norms:hasNumber ?nro . </li></ul></ul><ul><ul><li>?n norms:promulgationDate ?prDate . </li></ul></ul><ul><ul><li>?n norms:publishDate ?pbDate . </li></ul></ul><ul><ul><li>?n norms:hasHtmlDocument ?html . </li></ul></ul><ul><ul><li>} </li></ul></ul>
  112. 116. Endpoint Sparql <ul><li>Graph of a norm: </li></ul><ul><ul><li>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> </li></ul></ul><ul><ul><li>PREFIX dc: <http://purl.org/dc/elements/1.1/> </li></ul></ul><ul><ul><li>SELECT ?n ?p ?o </li></ul></ul><ul><ul><li>WHERE { </li></ul></ul><ul><ul><li>?n rdf:about &quot;http://datos.bcn.cl/recurso/cl/LEY/ministerio-secretaria-general-de-gobierno/2003-01-04/19846/&quot; . </li></ul></ul><ul><ul><li>?n ?p ?o . </li></ul></ul><ul><ul><li>} </li></ul></ul>
  113. 117. Endpoint Sparql <ul><li>Graph of a norm: </li></ul><ul><ul><li>http://datos.bcn.cl/recurso/cl/LEY/ministerio-secretaria-general-de-gobierno/2003-01-04/19846/datos.html </li></ul></ul>
  114. 118. Endpoint Sparql <ul><li>Vinculaciones de modificatorias: </li></ul><ul><ul><li>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> </li></ul></ul><ul><ul><li>PREFIX dc: <http://purl.org/dc/elements/1.1/> </li></ul></ul><ul><ul><li>PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#> </li></ul></ul><ul><ul><li>SELECT distinct ?n ?p ?modificatoria </li></ul></ul><ul><ul><li>WHERE { </li></ul></ul><ul><ul><li>?n rdf:about &quot;http://datos.bcn.cl/recurso/cl/LEY/ministerio-secretaria-general-de-gobierno/2003-01-04/19846/&quot; . </li></ul></ul><ul><ul><li>?n ?p ?modificatoria . </li></ul></ul><ul><ul><li>?n norms:isModifiedBy ?modificatoria . </li></ul></ul><ul><ul><li>} </li></ul></ul>

×