Skip to content

digitalheir/java-rechtspraak-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠ This library mostly superseded by Rechtspraak.js and no longer actively maintained

It may still be of use for XSD files and Java bindings to the Rechtspraak.nl API

Rechtspraak.nl library

GitHub version Build Status

A Java interface to the judgment database of rechtspraak.nl.

Documentation

This project is part of my master's thesis in Artificial Intelligence. A HTML copy of my thesis is available at here.

Usage

Download the latest JAR or grab from Maven:

<dependencies>
        <dependency>
            <groupId>org.leibnizcenter</groupId>
            <artifactId>rechtspraak</artifactId>
            <version>2.0.4</version>
        </dependency>
</dependencies>

or Gradle:

compile 'org.leibnizcenter:rechtspraak:2.0.4'

You can access the Rechtspraak.nl search API through org.leibnizcenter.rechtspraak.SearchRequest.Builder and org.leibnizcenter.rechtspraak.SearchResult. All builder options are optional. For instance:

        SearchResult iterator = new SearchRequest.Builder()
                .max(1000) // Results per page. Cannot be larger than and defaults to 1000
                .returnType(ReturnType.DOC) // Return documents for which Rechtspraak.nl lists at least metadata (META) or metadata and a transcription of the case (DOC)
                .from(0) // Offset in results, used for pagination
                .sort(Sort.ASC) //Sort results on modification date ascending or descending. Default is ascending (oldest first).
                .build().execute();

        Assert.assertTrue(iterator.hasNext());
        iterator = iterator.next();
        Assert.assertTrue(iterator.hasNext());
        iterator = iterator.next();

For all options, see the JavaDoc for SearchRequest.Builder

Search results contain judgment metadata (accessed through SearchResult#getJudgments()). For fetching and parsing the actual documents, use org.leibnizcenter.rechtspraak.RechtspraakNlInterface. For example, given an ECLI:

            OpenRechtspraak doc = parseXml(
                        // For purists that don't trust the parsing scheme (there is no official doctype), you can work with the raw XML stream as well
                        requestXmlForEcli("ECLI:NL:RBNNE:2014:1005").body().byteStream() 
            );

OpenRechtspraak is a Java object which represents the unmarshalled XML document at http://data.rechtspraak.nl/uitspraken/content?id=ECLI:NL:RBNNE:2014:1005

Requirements

  • Versions 1.X.X require Java 7
  • Versions 2.X.X require Java 8

More

Inquiries go to maarten.trompper@gmail.com.