EU Datathon : National and EU law using ELI Thomas Francart thomas.francart@sparna.fr – 2018-06-08
ELI History European Legislation Identifier Work started in “European Forum of Official Gazettes” Conclusions of the EU Council “European Legislation Identifier (ELI)” Published in the Official Journal of the European Union on October 26th 2012, “2012/C 325/02” EU funding for the project starting 2014
ELI Stakeholders and documentation (http://eur-lex.europa.eu/eli)
1. Identifiers 2. Metadata Browse Describe Link Identify legislation Browse 2. Metadata Describe legislation Link 3. Content structure ? Not in scope of ELI !
ELI proposes URI components that can be selected and arranged in any order to define your own URI structure.
What are the datasets ? Datasets available under the « ELI » group on the ODP : https://data.europa.eu/euodp/en/data/group/eli?groups=eli EU (Eur-Lex) Finland Luxembourg Ireland Denmark Soon : Portugal Soon : Italy Others
How were the datasets created ? ELI publishers embed structured metadata in their webpages, using RDFa Volunteer ELI publishers have submitted their list of ELI URIs The pages were fetched and parsed to extract structured data and aggregate it into a dataset Luxembourg & Finland directly provided their ELI datasets
RDFa : metadata « for machines »
Sample ELI list http://www.retsinformation.dk/eli/fob/1989/100 http://www.retsinformation.dk/eli/fob/1989/104 http://www.retsinformation.dk/eli/fob/1989/109 http://www.retsinformation.dk/eli/fob/1989/112 http://www.retsinformation.dk/eli/fob/1989/119 http://www.retsinformation.dk/eli/fob/1989/122 http://www.retsinformation.dk/eli/fob/1989/130 http://www.retsinformation.dk/eli/fob/1989/134 http://www.retsinformation.dk/eli/fob/1989/138 http://www.retsinformation.dk/eli/fob/1989/141 http://www.retsinformation.dk/eli/fob/1989/148 http://www.retsinformation.dk/eli/fob/1989/152 http://www.retsinformation.dk/eli/fob/1989/157 http://www.retsinformation.dk/eli/fob/1989/159 http://www.retsinformation.dk/eli/fob/1989/164 http://www.retsinformation.dk/eli/fob/1989/165 http://www.retsinformation.dk/eli/fob/1989/168 http://www.retsinformation.dk/eli/fob/1989/171 http://www.retsinformation.dk/eli/fob/1989/175 http://www.retsinformation.dk/eli/fob/1989/184 http://www.retsinformation.dk/eli/fob/1989/188 http://www.retsinformation.dk/eli/fob/1989/192 http://www.retsinformation.dk/eli/fob/1989/197 …
Which information can be found ? ELI URIs of country legislation in scope of ELI (Countries usually apply ELI on a subset of their legislation) Type of act Law, decree, decision, etc… (depending on jurisdiction) Dates : … of signature/decision … of publication … of entry into force / no longer in force Keywords Titles Can be multilingual Links to other acts (« Legal graph ») Cites, changes, corrects, repeals, consolidates, etc. Links to transposed EU legislation Pointers to content (XHTML, PDF, etc.) files Others… refer to ELI model : http://publications.europa.eu/mdr/eli
Which file formats ? Datasets are provided in RDF (semantic web data format) https://www.w3.org/RDF/ Usually in 2 variants (containing same data) : Turtle syntax RDF/XML syntax The list of ELI URIs is also available for most datasets
How to parse/use the data ? Use an RDF API Java : Eclipse RDF4J http://rdf4j.org/ Java : Apache Jena https://jena.apache.org/ Python : RDFLib https://github.com/RDFLib/rdflib PHP : EasyRDF http://www.easyrdf.org/ C : librdf http://librdf.org/ … Or use an RDF database (triplestore) https://en.wikipedia.org/wiki/Triplestore Or (but bad practice) use an XSLT to parse the RDF/XML variant Or … be creative :-)
« List all EU Directives with their english title, ordered by date » How to query the data ? Navigate the data graph using an API… … or issue SPARQL queries https://www.w3.org/TR/sparql11-query/ « List all EU Directives with their english title, ordered by date » PREFIX eli: <http://data.europa.eu/eli/ontology#> PREFIX lang: <http://publications.europa.eu/resource/authority/language/> SELECT ?directive ?title ?date WHERE { ?directive a eli:LegalResource . ?directive eli:type_document <http://publications.europa.eu/resource/authority/resource-type/DIR> . ?directive eli:date_document ?date . ?directive eli:is_realized_by ?expression . ?expression eli:language lang:ENG . ?expression eli:title ?title . } ORDER BY ?date
Layers of ELI description (FRBR) A specific legislation, independently of one of its « version » or language Directive 80/181/CEE A specific (temporal) version of this legislation, independently of its language OJ version or consolidated version A specific linguistic variant of this version of the legislation An english translation A specific file format for given language of given version of this legislation Signed PDF vs. HTML
in its original OJ version 1 Legal Resource in its original OJ version 23 Legal Expressions 3 Formats for each expressions http://eur-lex.europa.eu/legal-content/TXT/?uri=CELEX%3A32011D1219
Think in graph ! (it helps)
LegalResource LegalExpression Format (Abstract) LegalResource .../eli/dir/2013/37 Has multiple versions in .../eli/dir/2013/37/oj LegalResource Can be expressed in various .../eli/dir/2013/37/oj/deu LegalExpression Can be published in various .../eli/dir/2013/37/oj/deu/pdf Format Is expressed in concrete files Each conceptual level is identified with a URI using extra components.
Different levels of description Content Keywords, dates, links, author, etc. LegalResource Can be expressed in various Text/signs Title, language, etc. LegalExpression Can be published in various File media type, publisher, legal value, etc. Format Each level of abstraction will be associated with specific metadata.
Link legal texts (Luxembourg) Project 20140166 idParlement:60720 cites Law /loi/1988/12/13/n1 related_to cites Directive 1991/0440 basis_for Reglementation /rgd/2015/07/24/n3 Law /loi/2014/21/19/n11 SEQ:A cited_by Law /loi/2015/07/30/n1 changes Law /loi/2010/12/17/n2 changes changed_by Law /loi/2009/05/05/n8 changes Law ../loi/1860/12/04/n1 Law /loi/2015/05/31/n1 Creating a graph of legislation.
Detailled ELI ontology diagrams
Legend V1.1 LegalResource Class defined in the model skos:Concept Class defined in another ontology LegalResource date_document Literal properties (strings, integer, float, dates, booleans, xsd:anyURI, etc.) on a class physicalMedium (*) AnnotationProperty, that can take as a value either a literal or a URI Class/subclass relationship (rdfs:subclassOf) is_about Property linking 2 ressources has_legalresource [1..*] Min and max cardinalities on a property : [1] one and only one value, [1..*] at least one value. If nothing is written, assume [0..*], no restriction. Object property and its inverse property based_on / basis_for V1.1
Is expressed in concrete files ELI « backbone » Can contain other LegalResource Can be expressed in various LegalExpression Can be published in various Format Is expressed in concrete files
LegalResourceSubdivision rdac:Work owl:Thing LegalResource id_local uri_schema has_part / is_part_of has_member / is_member_of rdac:Expression is_realized_by / realizes [1..*] LegalExpression id_local LegalResourceSubdivision rdac:Manifestion is_embodied_by / embodies Format id_local is_exemplified_by owl:Thing « ELI part 1 » : backbone V1.1
« ELI part 2 » : LegalResource level V1.1 skos:Concept related_to cites / cites_by owl:Thing version Version LegalResource Or LegalExpression number description version_date first_date_entry_in_force date_no_longer_in_force date_applicability relevant_for jurisdiction Admin.Area in_force InForce changed_by / changes consolidates / consolidated_by commences / commenced_by repeals / repealed_by corrects / corrected_by* amends / amended_by type_document [1..*] ResourceType Agent basis_for transposes passed_by responsibility_of_agent LegalResource responsibility_of date_document date_publication based_on transposed_by is_about applies / applied_by is_another_publication_of / has_another_publication « ELI part 2 » : LegalResource level V1.1 * : also applies to Format
« ELI part 3 » : LegalExpression level V1.1 skos:Concept related_to cites / cites_by owl:Thing version Version LegalResource Or LegalExpression number description version_date first_date_entry_in_force date_no_longer_in_force date_applicability relevant_for Admin.Area in_force InForce changed_by / changes consolidates / consolidated_by commences / commenced_by repeals / repealed_by corrects / corrected_by* amends / amended_by Language language [1..*] LegalExpression title [1..*] title_short title_alternative publisher basis_for transposes based_on transposed_by LegalResource « ELI part 3 » : LegalExpression level V1.1
« ELI part 4 » : Format level V1.1 legal_value skos:Concept Format rights rightsholder published_in publisher publishes / published_in_format publisher_agent rightsholder_agent licence format [1..1] Agent owl:Thing « ELI part 4 » : Format level V1.1
V1.1 Property Range (class) Corresponding ELI scheme Existing EU Publications Office table ? type_document eli:ResourceType Eli:ResourceTypeTable - relevant_for eli:AdministrativeArea Eli:AdministrativeAreaTable Administrative Territorial Units (+ local extensions) jurisdiction passed_by eli:Agent n/a responsibility_of_agent publisher_agent rightsholder_agent is_about skos:Concept Eurovoc + values to be locally defined in_force eli:InForce eli:InForceTable ELI includes a value set (in force, not in force, partially in force). No local extensions needed. language eli:Language No ELI scheme : referring to OPEU language scheme language (no local extensions needed) version eli:Version eli:VersionTable None legal_value eli:LegalValue eli:LegalValueTable ELI includes a value set (unofficial, official > authoritative > definitive). No local extensions needed. V1.1
Thomas Francart thomas.francart@sparna.fr Thank you Thomas Francart thomas.francart@sparna.fr