This GitHub repository contains source code to compare two legal reasoners on Resource Description Framework (RDF) data. The first legal reasoner is based on the Shapes Constraint Language (SHACL), the second one is based on the DLV v2 automated reasoner for ASP-Core-2.
Specifically, a selected use case of legal norms is formalized both in SHACL and ASP-Core-2 formulae. Then, the formulae are executed through the corresponding reasoner on synthetic states of affairs of increasing size encoded in RDF. The execution checks compliance of the states of affairs with respect to the legal norms.
This GitHub repository includes source code and instructions to execute the reasoners both when the states of affairs are stored within RDF files and when they are stored within a Apache Jena Fuseki SPARQL endpoint. The implementations detect the violations of the legal norms and store them within an output file, together with the measured execution time.
The use case includes the following four articles:
- Article 1. The Licensor grants the Licensee a licence to evaluate the Product.
- Article 2. The Licensee must not publish the results of the evaluation of the Product without the approval of the Licensor. If the Licensee publishes results of the evaluation of the Product without approval from the Licensor, the material must be removed.
- Article 3. The Licensee must not publish comments about the evaluation of the Product, unless the Licensee is permitted to publish the results of the evaluation.
- Article 4. If the Licensee is commissioned to perform an independent evaluation of the Product, then the Licensee has the obligation to publish the evaluation results.
The two implementations are available at the links below:
- Source code and instructions for the SHACL implementation are available at this link.
- Source code and instructions for the DLV v2 implementation are available at this link.
The implementations have been tested on the synthetic (ABox) datasets available in the subfolder CORPUS. Further corpora may be created via the dataset generator available at this link.
The fuseki server, configured to upload the files in CORPUS and make them available as a SPARQL endpoint on localhost, is available in the subfolder FUSEKI.