Lex school 2011

118
LeyChile Sept. 10, 2011 Christian Sifaqui

description

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

Transcript of Lex school 2011

Page 1: Lex school 2011

LeyChile

Sept. 10, 2011Christian Sifaqui

Page 2: Lex school 2011

Congreso Nacional de Chile

Page 3: Lex school 2011
Page 4: Lex school 2011

BCN roles

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

Page 5: Lex school 2011

BCN roles

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

Societal role, to be the repository of the Archives of the Parliament, especially the history of law and parliamentary work

Page 6: Lex school 2011

BCN roles

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

Societal role, to be the repository of the Archives of the Parliament, especially the history of law and parliamentary work

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

Page 7: Lex school 2011

Biblioteca del Congreso Nacional

Metaphor¿Pharmacy? Books and Magazines loan;

Catalog

Page 8: Lex school 2011

Biblioteca del Congreso Nacional

Metaphor¿Pharmacy? Books and Magazines loan;

Catalog¡Clinical laboratory! Chilean norms; Parliamentary

work; History of the Law; Parliamentary biographies; GIS; Parliamentary advisory, etc.

Page 9: Lex school 2011

Legislation

Page 10: Lex school 2011

Legislation

Set of norms (acts, laws, decrees) that frame the national juridical order

Page 11: Lex school 2011

Legislation

Set of norms (acts, laws, decrees) that frame the national juridical order

Information that comes from the public sector; it is generated by public organizations and financed by public resources

Page 12: Lex school 2011

Legislation

Set of norms (acts, laws, decrees) that frame the national juridical order

Information that comes from the public sector; it is generated by public organizations and financed by public resources

By nature of public interest (about general interest topics)

Page 13: Lex school 2011

Legislation

Set of norms (acts, laws, decrees) that frame the national juridical order

Information that comes from the public sector; it is generated by public organizations and financed by public resources

By nature of public interest (about general interest topics)

High public value (generates citizen experience that can be considered valuable)

Page 14: Lex school 2011

Legislation

Is indeed public information and must be of public domain

Page 15: Lex school 2011

Legislative information on public domain

“Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met)

Page 16: Lex school 2011

Legislative information on public domain

“Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met)

2 points of view:Juridical safety: guaranteed and founded

certainty that the norm will be accomplished

Page 17: Lex school 2011

Legislative information on public domain

“Fulfillment of legal certainty” concept (founded expectation that citizens have about in-force legislation that must be met)

2 points of view:Juridical safety: guaranteed and founded

certainty that the norm will be accomplishedJuridical certainty: perception of the norm and

certainty of the content

Page 18: Lex school 2011

Mechanism for the publication of the legislation

Publication mechanism: Official Gazette

Page 19: Lex school 2011

Mechanism for the publication of the legislation

Publication mechanism: Official GazetteLegal fiction of knowledge:

Civil CodeArt. 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.”

Art. 8 “Nobody will be able to plead ignorance of the law after it has entered into force.”

Art. 706 “...the error of law is a presumption of bad faith, that does not admit evidence to the contrary.”

Page 20: Lex school 2011

Mechanism for the publication of the legislation

But in Chile:The Official Gazette is not freeThe publishing of the laws is basically about

modifying norms and not about texts in forceAccess to old legislation is very difficult

Page 21: Lex school 2011

Example of a legal norm

Ley 22000

Artículo 1. abc.Artículo 2. def.Artículo 3. ghi.

Y por cuanto he tenido a bienaprobarlo y sancionarlo…

Page 22: Lex school 2011

Example of a legal norm that modifies another

Ley 25345

Artículo 1. Modifica ley 22000 de la siguiente forma: reemplázase en el Artículo 1 las palabras “a” por “xyz”.

Y por cuanto he tenido a bienaprobarlo y sancionarlo…

Page 23: Lex school 2011

Example: original and its update

Ley 22000

Artículo 1. abc.Artículo 2. def.Artículo 3. ghi.

Ley 22000

Artículo 1. abc.Artículo 2. def.Artículo 3. ghi.

Ley 22000

Artículo 1. xyzbc.Artículo 2. def.Artículo 3. ghi.

Ley 22000

Artículo 1. xyzbc.Artículo 2. def.Artículo 3. ghi.

t0 t1

Page 24: Lex school 2011

Model

Biblioteca del Congreso Nacional

Biblioteca del Congreso Nacional

Ley 220001.- abc2.- def3.- ghi

Ley 220001.- abc2.- def3.- ghi

(original)1.- abc2.- def3.- ghi

(original)1.- abc2.- def3.- ghi

Diario oficialDiario oficial

Ley 22000Ley 22000

Page 25: Lex school 2011

Model

Biblioteca del Congreso Nacional

Biblioteca del Congreso Nacional

Ley 253451.- Modificaley 22000

Art. 1sustitúyase a

por xyz

Ley 253451.- Modificaley 22000

Art. 1sustitúyase a

por xyz

(original)1.- abc2.- def3.- ghi

(original)1.- abc2.- def3.- ghi

(actualizado)1.- xyzbc

2.- def3.- ghi

(actualizado)1.- xyzbc

2.- def3.- ghi

Ley 253451.- Modificaley 22000

Art. 1sustitúyase a

por xyz

Ley 253451.- Modificaley 22000

Art. 1sustitúyase a

por xyz

Diario oficialDiario oficial

Ley 22000Ley 22000

Ley 25345Ley 25345

Page 26: Lex school 2011

BCN

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

Page 27: Lex school 2011

BCN

In the late 70 this index card system was replaced by an IBM STAIRS system, which allowed automate this cards and annotations

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

Page 28: Lex school 2011

Legis 1995-2009

Client-Server interface

Page 29: Lex school 2011

Legis 1995-2009

Web interface

Page 30: Lex school 2011

Legis 1995-2009

Web interface

Page 31: Lex school 2011

Project “Ley Chile”

Page 32: Lex school 2011

Project “Ley Chile”

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)

Page 33: Lex school 2011

Project “Ley Chile”

The BCN has a special expertise in the processing of the official publications of the legal norms in order to:Keep record of the legal norms that appear for the

first timeKeep record of the legal norms that modify other

normsKeep record of the links between norms (rules,

concordances, recasted texts and modifications)Make updated versions of the modified normsIncorporate technical notes that allow the users

have all the facts to make their own interpretation

Page 34: Lex school 2011

Project “Ley Chile”

The BCN has rigorous quality control processes to provide high fidelity documentation regarding the sources

Page 35: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

BCN knows what

BCN knows how

BCN needs help to write the documents for the procurement (tender)

Page 36: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Aimed primarily for use in the legislative process

Free access to citizensImprove the availability of the normJuridical certainty: access to current and

update normsEmphasis on quality of the contentSearch and navigation. Outputs in different

formatsDifferentiated services between registered

and anonymous users

Page 37: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Benefits of the new systemContent

Content migration and its improvementRemoving notes, norm structure and correction

Production management (Content Management)Integration with the architecture of the BCNImproving the quality content and managementProduction management

Search services, recovery and outputsFree access of the entire database for all citizens

Availability Acquisition of hardware

InteroperabilityExchange information with other state institutions.

Agreements with Agencies. Submit the updated norm

Page 38: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Modeling the “life” of a norm

Page 39: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Tender (a mix of HW and SW)Declared deserted

Page 40: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Tender (a mix of HW and SW)Declared deserted

I took over as Director

Page 41: Lex school 2011

Project “Ley Chile”: phase 1 (2004-2006)

Tender (a mix of HW and SW)Declared deserted

I took over as Director

Rewriting bidding documents (changes in model, debugging use cases)

New tender (only SW)Award

Page 42: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Project Director

Project manager

CoordinationProduction

Coordination Services

Ley Chile Board

Director BCN

Under Director BCN

Heads of department BCN

Page 43: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Production managementNew way of processing norms

Page 44: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Production managementNew way of processing norms

ContentMigration (debugging, repairing, standards,

completeness)

Page 45: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Production managementNew way of processing norms

ContentMigration (debugging, repairing, standards,

completeness)

ServicesUsability, interaction, design

Page 46: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Production managementNew way of processing norms

ContentMigration (debugging, repairing, standards,

completeness)

ServicesUsability, interaction, design

AvailabilityAcquisition of ad-hoc hardware

Page 47: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Modeling the “structure” of a norm

Page 48: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Modeling the “visualization” of a norm

Page 49: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Use of activity diagrams (facilitates the understanding of business processes)

Page 50: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Architecture of the system

Outputformats

Page 51: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Architecture

Python

Cap

a d

e P

resen

tació

n Lóg

ica d

e

Negocio

A

cceso a

D

ato

s

Repositorio Documental

cx_ Oracle

Zope

ZXOracle DA

ZODB

Plone

Content Delivery

Content Managment

Web Services

Usuarios BCN Instituciones Usuarios Externos

CMFExternalFile

File System

Gestión y Auditoría

APILEGIS

Page 52: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Capa de Presentación

Capa de Negocios

Capa de Datos

HTTP

RDBMS(oracle)

Componentes API

API CM

AnalistaDocumental

Páginas WEB Dinámicas

Digitador WorkflowPlanificar OT

API Legis

Intranet

Producto Management

Ej: Páginas para Módulo Producción

Servicios WEB Módulos

WEBServices

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

“ServiciosWEB”

PLONE

Python

Productos

Páginas dinámicas ZPT-TAL

Page 53: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

The retrieval mechanism of a norm from the XML database and its interactive navigation has been optimized to reduce the overload on the servers:the main processing is done in the browser of

each client, which parses the delivered XML, making heavy use of asynchronous JavaScript capabilities

Decision taken on 2006 (Google Chrome was released on 2008!)

Page 54: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

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

Page 55: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

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

Extracting version: the business layer extract the XML of the required version of the norm

Page 56: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

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

Extracting version: the business layer extract the XML of the required version of the norm

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

Page 57: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

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

Extracting version: the business layer extract the XML of the required version of the norm

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

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

Page 58: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

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

Extracting version: the business layer extract the XML of the required version of the norm

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

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

Navigation: as the user selects different parts of the norm, the same process is done, but for a part of the norm

Page 59: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Page 60: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Hardware architecture and sizing:For supporting the application services, we used

QUAD-core processors for the physical serversFor the database servers we use dual core

(database licenses restrictions) and 64-bits architecture (cpu 64-bit)

We physically separated the development and production environments

The internet platform includes load balancing and cache accelerator

We use ZEO architecture for scaling ZOPEProduction servers were conected via gigabit

networkDisk storage was provided by a centralized storage

(SAN)

Page 61: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

AvailabilityAcquisition of hardware (original)

Page 62: Lex school 2011

Project “Ley Chile”: phase 2 (2007-2008)

Tuning and evolutionWe incorporated a cache-balacning software on the front-endThe persistence of the sessions of the connected users was

handled in the databaseZEO cluster was not necessary, we set up two independent

ZOPE application servers, each one with two clients balanced with Varnish

We migrate the application servers to blade serversWe added several data cache services (PDF, precomputed

norms, etc.) kept in a shared NFS server (was a ZEO server initially)

We added a static content server (js, images and css)We added a norm previsualizing server for the production

environmentWe added “fault tolerance” and high availability for critical

servers (managed by VMWARE)

Page 63: Lex school 2011

Hardware today

Reunión de directorio 10 marzo Arquitectura de Hardware

Servidorseparado

ServidorBLADE

Fault ToleranceAlta disponibilidad

R12D R22R20 20AR23DFTR11FT

Servidores VirtualizadosVMWARE

20BR21FT

Page 64: Lex school 2011

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:BalanceoY Caché

R23D: Cachéestático

R12 y R22D: Consulta, Navegación y WS

Usuarios Internet

WS otros sitemasBCN y Externos

Red Interna

R20A: Producción2 clientes

R20: ProducciónBalanceo, 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

Page 65: Lex school 2011

Timeline

2004

Start project for the new version of the chilean law

Created a newsletter of the legislative work http://boletinlegislativo.bcn.cl

Page 66: Lex school 2011

Timeline

2007

Start building phase of LeyChile

Page 67: Lex school 2011

Timeline

2008

Launch blog http://bloglegal.bcn.cl Release http://www.leychile.cl

Page 68: Lex school 2011

Migration

Detailed review (example: notes)

Right note. Located in the column 60

Text located in the position of a note. A note is detected

Page 69: Lex school 2011

Migration

Detection of notes

L: indicates a normal line Notes

1: indicates the sequence

N: indicates the detection of a note

Page 70: Lex school 2011

Migration

Initial conceptEmphasis on data transferMassive correction with external resources

"guided" by BCN

New approachTakes into account the quality of informationProvides mechanisms to improve the quality of

information“Transformation of data” over “transfer of data”

Page 71: Lex school 2011

Migration

Carga y TransformaciónTexto

NormasLegis I

Correccionesautomáticas yvalidaciones

Planificador

Correccionesmanuales

y masivas (XLS)

Base de datosLey Chile

Supervisa todo el proceso, asigna trabajo a analistas, decide qué inconsistencias son obligatorias (errores)

Inconsistenciasen normas

No

Si

NormasRechazadas

Prep.Formatos

Page 72: Lex school 2011

Migration

Migration environmentBases de Datos

BASISplus

Migración

Bases de Datosde corregida

Proceso

Proceso de Corrección

Base de DatosBASISplus

ExtractorIncremental

Base de Datosde Migración

Módulo de cuadraturamigración

Módulo de Verificación yCorrección

Control migraciónListados de

1…n

Listados de control explotación1…n

Listados de

1…n

Transformación y Carga Listado de

Rechazos 1..n

Ambiente ExplotaciónBASISPlus

Normas yvinculacionesextraídas1..n

Ambiente Migración

VerificaciónListados de

1…n

BCNServicios Digitales

BCNProducción

Ley

Page 73: Lex school 2011

Migration

Data loading

Bases de Datosde corregida

Bases de DatosXML Migrada

Listados de Control carga

1…n

Base de Datosde MigraciónControl migración

Listado de

1…n

Generador y Carga XML LEGIS II

Listado de Rechazos 1..n

Módulo de CuadraturaCarga

OT Depuración

Proveedor

BCNProducciónLey

Page 74: Lex school 2011

Migration

Too much effortSeparation of hundreds of thousands of notesReview and adapt the structures of normsSemi-automated process for debugging

Page 75: Lex school 2011

Budget

Phase 2Development: US$ 380.000 + change

managementHardware: US$ 150.000Database license + training: US$ 100.000

Maintenance and support (reduced for 3 years)Content migration/debugging: US$ 100.000

Page 76: Lex school 2011

Tuning

Layered modelDifferent layers that need to be reviewed

separately

Hardware

DatabaseORACLE

Business layerPlone-python

Presentation layerJavaScript

Balance layerPound-squid

Requires computers with

good performance

Pound-Squid was changed for Varnish

Profiling must be done

An external firm will be hired to

audit

Page 77: Lex school 2011

Tuning

Actions takenAnalyze usage statistics

Days/hours a dayPercentage of logged users vs. anonymous usersMore searched normsMore navigated norms

Seen funcionality

Page 78: Lex school 2011

Tuning

Presentation layerSymptom: slow by showing big norms (there are no more than 30,

codes)Solution: is a distributed system, we are betting that users will be use

better computers, because the application makes heavy use of JavaScript

Symptom: search is slowProblem: there are words with no meaning that generate many hitsSolution: to programm discard rules

Simple search:Restriction of keywords (case sensitive)Single letters: a, b…, A, B,…Law, decree,and so on. Use a parametric table for discarding phrasesPattern [one letter] spaces[number]*

Advanced search:To restrict only if the type Law is selectedSame as above

Symptom: slow for navigating big norms (codes)Problem: navigation is always full textPartial solution:

Recommend using PDF for the 30 big normsNavigation is always full-text, enable access to hit list at article level, without

loading the entire tree or optimize tree loadOptimize list of versions

Page 79: Lex school 2011

Tuning

Load balancing layerSymptom: slow loading of the home page and navigation

between static pages, slow loading of static pagesProblem: there are 4 clients zope, but only one or two are

used, leaving the rest idleSolution: 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.

Problem: Congress users use Legis. They are accustomed to a better response time but with much more limited functionality

Solution: To evaluate the possibility of creating a dedicated server

Page 80: Lex school 2011

Tuning

Business layerSymptom: Zope shows CPU usage peaksSolution: profiling to investigate cause

Parameters SQL-AlchemyZope parameters

Problem: export process is done on the server, although it is very fast, consumes resources for a short period of time

Solution: cache files generated by the export. Low server load and improve response time

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

To keep the norms up to date, the cached file will be removed if it is modifiedSymptom: big norms are slowSolution:

improve the process of precalculating norms and the display of big normsmore storage space for precalculationNFS support for the serversAllow download of precalculated pdf for big norms from the hit list

Symptom: versions of a norm is slowCache of the versions apparently is not workingdelete versions

Page 81: Lex school 2011

Tuning

DatabaseSymptom: big norms are slowSolution: 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

Symptom: hit list is slow to specific queriesSolution: optimize phrase search in advanced

searchSymptom: improve response times in generalsolution:

Optimize some critical stored proceduresTuning of Oracle according to current use

Page 82: Lex school 2011

Interoperability: linking

This alternative works as a simple hyperlink that goes to the norm, in its updated version, displayed in the navigation module

Example: http://www.leychile.cl/Navegar?idNorma=141599

This link contains the parameter idNorma which is the unique number of the norm

As an alternative parameter (only for laws) the idLey parameter can be used

Example for the same norm: http://www.leychile.cl/Navegar?idLey=19628

By using this URL:

Page 83: Lex school 2011

Interoperability: xml

Ley Chile provides the norm in XML according to a interchange schema (see www.aem.gob.cl):

http://www.leychile.cl/esquemas/EsquemaIntercambioNorma-v1-0.xsd

Documentation: http://www.leychile.cl/Plone/Legis/esquemas/accesoLeyesChilenas4.pdf

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

Always will be delivered the updated version of the normExamples:

Get the law 18575: http://www.leychile.cl/Consulta/obtxml?opt=7&idLey=18575 Get the law 19846 by using its idhttp://www.leychile.cl/Consulta/obtxml?opt=7&idNorma=206396

Additional parameter, foot notes:notaPIE: if 1, the text will come with foot notes

Example:Get law 18575 with foot noteshttp://www.leychile.cl/Consulta/obtxml?opt=7&idLey=18575&notaPIE=1

Page 84: Lex school 2011

Interoperability: xml

Example with output forhttp://www.leychile.cl/Consulta/obtxml?opt=7&idLey=20000

Page 85: Lex school 2011

Interoperability: Contraloría

Consume Dictámenes asociados a una ley

Envía parámetros

Capa de Presentación

Capa de Negocios

Cap

a d

e I

nte

gra

ció

n

Usuarios Internetwww.leychile.cl

Contraloría

Parámetros:Número ley

Prepara lista de resultados

Requerimiento de dictámenes paracualquier ley

AJAX

AJAX

Sistema Ley Chile

Page 86: Lex school 2011

c

Interoperability: Organizations

Servicio:Provee XMLde la norma

Recibe parámetrosCapa de

Negocios

Cap

a d

e I

nte

gra

ció

n

Requerimiento HTTP

OrganizacionesInstituciones

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

Page 87: Lex school 2011

LeyChile 2009-

“Nickname”, nombre popular

Page 88: Lex school 2011

LeyChile 2009-

Page 89: Lex school 2011

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]]

Page 90: Lex school 2011

LeyChile 2009-

http://www.leychile.cl/ws/LeyChile.wsdl

Page 91: Lex school 2011

Workflow: norm input

Page 92: Lex school 2011
Page 93: Lex school 2011

Norm input: mail from Official Gazette

Page 94: Lex school 2011

Norm input: text file

Page 95: Lex school 2011

Norm input: basic marking

Page 96: Lex school 2011

Norm input: loading file with marks

Page 97: Lex school 2011

Norm input: planification

Page 98: Lex school 2011

Planification: video

PLANIFICACION.AVI

Page 99: Lex school 2011

Norm input: video

INGRESO.AVI

Page 100: Lex school 2011

Norm input: norm marking (images)

Page 101: Lex school 2011

Norm input: norm marking (linking)

Page 102: Lex school 2011

Hiperlink

HIPERVINCULO.AVI

Page 103: Lex school 2011

Norm input: QA

Page 104: Lex school 2011

Other workflows (more complex)

Updating normsDigitationetc.

Videos

Page 105: Lex school 2011
Page 106: Lex school 2011

GTA: video

GTA.AVI

Page 107: Lex school 2011

CambiaPlanificaciónpor defecto

Solicitud Digitación

Perfil Planificador

OT para planificar

PlanificióndigitaciónExterna ?

OT Digitación Planificada

SI

Si

OT GTA Cerrada

No

Si

Genera OT Digitación

NO

Asignar etapa distribución

OT Digitación Planificada

Bandeja OT Digitación Digitador

Bandeja Distribucuón Digitador

DistribuirSeleccionar

Empresa Dig.

OT Digitación Planificada

Cargar Archivo

Tiene corrección de

pruebas ?

Archivo XMLInterno o Externo

No

OT Digitación Cerrada

Bandeja Ingreso Planificador Flujo de Ingreso

OT IngresoPara planificar

Revisa Archivo

SI

Aprueba ?

SINo

NOTA: Se chequea corrección de

pruebas una sola vez

Bandeja Corrección de Pruebas

Digitador

Page 108: Lex school 2011

Best practices (some)

The hardest firstDefine satisfaction criteria to measure

successHave alternative plansAvoid turnoverIs a content system… content!Test, test and… testSave budget por change management

Page 109: Lex school 2011

http://datos.bcn.cl

Open/Linked data

LeyChileLeyChile datos.bcn.cldatos.bcn.cl

Tripletas RDFOntologías OWL – RDF Schema

Endpoint Sparql – Interfaz Web WS - SOAP

Normas XML

Herramientas de generaciónde mashup del grafo

Internet

etc.etc.Linked data desde consultas

Page 110: Lex school 2011

URI

Page 111: Lex school 2011

URI

cl/ley/{numero}/data.{ext}

cl/ley/{numero}/{lang}@{fecha_version}/data.{ext}

Law 17.335 in its spanish version from march, 31 2011 in JSON format

cl/ley/17335/es@2011-03-31/data.json

Page 112: Lex school 2011

Ontology for LeyChile

Page 113: Lex school 2011

URI

HTML + RDFahttp://datos.bcn.cl/recurso/cl/LEY/20000/datos.html

n3http://datos.bcn.cl/recurso/cl/LEY/20000/datos.n3

RDFhttp://datos.bcn.cl/recurso/cl/LEY/20000/datos.rdf

JSONhttp://datos.bcn.cl/recurso/cl/LEY/20000/datos.json

ntripleshttp://datos.bcn.cl/recurso/cl/LEY/20000/datos.ntriples

Otro ejemplo:http://datos.bcn.cl/recurso/cl/DTO/ministerio-de-educacion/2004-09-21/173/es@2009-11-19/datos.html

Page 114: Lex school 2011

Endpoint Sparql

List of organizations:

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#>

SELECT distinct ?nombre WHERE {?org norms:creatorOf ?o .?org norms:hasName ?nombre}

Page 115: Lex school 2011

Endpoint Sparql

Version of a norm:

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX dc: <http://purl.org/dc/elements/1.1/>PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#>

SELECT ?n ?id_norma ?tipo ?nro ?prDate ?pbDate ?titulo ?lang ?html WHERE { ?n dc:identifier "206396" . ?n norms:hasNumber ?id_norma . ?n dc:title ?titulo . ?n dc:language ?lang . ?n norms:type ?tipo . ?n norms:hasNumber ?nro . ?n norms:promulgationDate ?prDate . ?n norms:publishDate ?pbDate . ?n norms:hasHtmlDocument ?html .}

Page 116: Lex school 2011

Endpoint Sparql

Graph of a norm:

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX dc: <http://purl.org/dc/elements/1.1/>

SELECT ?n ?p ?o WHERE { ?n rdf:about

"http://datos.bcn.cl/recurso/cl/LEY/ministerio-secretaria-general-de-gobierno/2003-01-04/19846/" .

?n ?p ?o .}

Page 117: Lex school 2011

Endpoint Sparql

Graph of a norm:

http://datos.bcn.cl/recurso/cl/LEY/ministerio-secretaria-general-de-gobierno/2003-01-04/19846/datos.html

Page 118: Lex school 2011

Endpoint Sparql

Vinculaciones de modificatorias:

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>PREFIX dc: <http://purl.org/dc/elements/1.1/>PREFIX norms: <http://datos.bcn.cl/ontologies/bcn-norms#>

SELECT distinct ?n ?p ?modificatoria WHERE { ?n rdf:about "http://datos.bcn.cl/recurso/cl/LEY/ministerio-

secretaria-general-de-gobierno/2003-01-04/19846/" . ?n ?p ?modificatoria . ?n norms:isModifiedBy ?modificatoria .}