Code Monkey home page Code Monkey logo

caselawanalytics's Introduction

Build Status DOI

CaseLawAnalytics

This repository contains code for the case law query app: an application to query Dutch law cases and extract a network to use in the case law visualization app.

If you use this software, please acknowledge by citing the DOI.

Prerequisites:

  • Python 3

The python package

The python package caselawnet provides the following main functionalities:

  • Search the rechtspraak.nl api to retrieve relevant law cases.
  • Retrieve metadata from rechtspraak.nl for a list of cases (given their ECLI identifier)
  • Retrieve metadata from HuDOC to retrieve relevant law cases.
  • Retrieve references between cases from LiDO). This requieres a valid login for the LiDO services.
  • Calculate network statistics and create json file that can be used in the case law visualization app.

To install caselawnet, clone the repository and run in the root of the repository:

pip install .

To run tests:

pytest tests/

The web app

The web application provides a graphical user interface to the caselawnet package.

Copy the settings file:

cp settings.cfg_dist settings.cfg

If necessary, configure attributes in the config file, such as database.

To run the web app:

export FLASK_APP=caselawnet_webapp.py

and run the app:

flask run

The app runs much quicker if it connects to a database with the parsed cases.

Setting up a database

The application works with SQLAlchemy. You can use any database as a backend for this. If using MySQL, the python package mysql=connector-python needs to be installed.

The script fill_database.py can be used to initiate and fill the database. Adjust the settings within this file to point to the database (this should be the same location as defined in settings.cfg), and to the location of a downloaded version of the Rechtspraak.nl data collection.

caselawanalytics's People

Contributors

c-martinez avatar gijsvd avatar wrvhage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

caselawanalytics's Issues

Add "wet" entities to rdf store

We want to be able to grab the name of the law articles that are referenced officially. It must be possible to retrieve these entities based on the links, so we should add at least the name to the rdf store.

Add article-mentions to RDFstore

  • Can we use the regex-functionality of blazegraph? (if we have the complete uitspraken in blazegraph)
  • write function to extract from text to sparql query
  • script that runs it for all uitspraken

Make json for test network

  • define what fields are necessary for the visualization
  • add links between the cases to the triple stores
  • Get this desired data from Sparql
  • Create json

Apply filters on LiDO retrieved cases

When extra cases are retrieved through the LiDO parser, that are linked to cases in the search querier, we don't apply any filters on these extra data. The same filters for search should be applied to these as well.

meta data not complete after search

The rechtspraak search API doesn't give complete metadata, for example the creator ( 'instantie') is missing. This should be retrieved elsewhere.

Proper error catching

raise specific errors or warnings for e.g.:

  • nodes could not be parsed (in search)
  • Metadata of nodes not available
  • API's do not respond as expected

Include LiDO id as url

Right now, the 'id' field gets constructed by creating a rechtspraak.nl url from the ECLI. But for e.g. EU case law this is incorrect. LiDO provides correct identifiers and source URLs, these should be used.

This connects to issue #25 to use the meta data from LiDO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.