guarded-saturation

Resolution-based rewriting algorithm from Guarded Tuple Generating Dependencies (GTGDs) to Datalog

https://github.com/krr-oxford/guarded-saturation

Science Score: 52.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization krr-oxford has institutional domain (www.cs.ox.ac.uk)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Resolution-based rewriting algorithm from Guarded Tuple Generating Dependencies (GTGDs) to Datalog

Basic Info
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • Open Issues: 9
  • Releases: 4
Created about 7 years ago · Last pushed 12 months ago
Metadata Files
Readme License Citation

README.md

Guarded-saturation

The software implements a Resolution-based rewriting algorithm from Guarded Tuple Generating Dependencies (GTGDs) to Datalog, along with some functions for running the resulting Datalog rules.

Saturating

The main functionality of GSat is to compute the saturation of a set of GTGDs. To do this, download the JAR file available with the releases and use the command line:

bash java -jar guarded-saturation-1.0.0-jar-with-dependencies.jar <syntax> <TGD file>

where <syntax> is the one of the syntax dlgp, owl and <TGD file> is a file containing the input GTGDs in the syntax <syntax>.

By default, the output saturation is printed in the console, it can be written to a file instead by setting write_output to true in the file config.properties.

Example

Consider a DLGP file example.dlgp that contains the following two TGDs:

b(X, Y), c(Y) :- a(X). d(X) :- b(X, Y), c(Y).

Calling:

bash java -jar guarded-saturation-1.0.0-jar-with-dependencies.jar dlgp example.dlgp

returns the saturation containing:

b(X, Y), c(Y) :- a(X). d(X) :- a(X).

The choice of the saturation algorithm

This project implements different saturation algorithms. You can set the algorithm to use by changing saturation_alg's value in the file config.properties to either:

  • gsat (default) corresponding to ExbDR in the article
  • skolem_sat corresponding to SkolemDR
  • hyper_sat corresponding to HyperDR
  • simple_sat corresponding to SimDR
  • ordered_skolem_sat also called KAON3

Additionally, KAON2 can be used to get the saturation of the set of TGDs in an OWL file using the following command:

bash java -cp guarded-saturation-1.0.0-jar-with-dependencies.jar "uk.ac.ox.cs.gsat.ExecutorOWL" <OWL file> <timeout>

where the <timeout> is expressed in seconds.

Compilation (For developers)

Prerequisites

To build the software we require

Kaon2 is only relevant for some experiments, and is not part of the delivered product.

Installing PDQ in Maven

  1. Download from PDQ releases
    • pdq-common-1.0.0.jar
  2. Install as in the official documentation
    • mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile="pdq-common-1.0.0.jar"

Installing KAON 2

Install the JAR of KAON2 using:

mvn install:install-file -Dfile=./gsat-kaon2/src/main/resources/kaon2.jar -DgroupId=org.semanticweb.kaon2 -DartifactId=kaon2 -Dversion=2008-06-29 -Dpackaging=jar -DgeneratePom=true

Installing

If you are a developer and you want to run the tests, you need to:

  1. Download the "test-all.zip" file from GSat test datasets
  2. Extract it in the root of the project

Otherwise, you can simply run the download-test-datasets.sh script.

Build the project:

sh mvn verify

That's it! If you look in the target subdirectory, you should find the build output.

Running the saturation on Chase Bench

In addition to what have been said in the usage section ChaseBench format can also be used for the input.

To run on a ChaseBench scenario, you need to specify the cb option and add:

  • <NAME OF THE SCENARIO> the name of the scenario as in the ChaseBench format
    • example: doctors
  • <PATH OF THE BASE FOLDER> the directory that contains this scenario
    • example: test/ChaseBench/scenarios/doctors
  • [<FACT/QUERY SIZE>] (optional) the size of the scenario that you want to test
    • example: 100k

Useful Maven commands for developers

Check PDM violations and bugs in code:

```sh mvn pmd:check

mvn spotbugs:check ```

Update Maven dependencies and Plugins:

```sh mvn versions:display-dependency-updates

mvn versions:display-plugin-updates ```

Generate Javadoc:

sh mvn javadoc:javadoc

Experiments

Experiments are available in a submodule, which may be large. You can initialize the experiments folder using:

sh git submodule init

Here you can download the files used in our experiments.

Credits

Information Systems GroupDepartment of Computer ScienceUniversity of Oxford

License

This project is licensed under the MIT License

Owner

  • Name: KRR
  • Login: KRR-Oxford
  • Kind: organization
  • Location: Oxford

Knowledge Representation and Reasoning Group - University of Oxford

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Benedikt"
  given-names: "Michael"
  orcid: "https://orcid.org/0000-0003-2964-0880"
- family-names: "Buron"
  given-names: "Maxime"
  orcid: "https://orcid.org/0000-0002-8227-4771"
- family-names: "Germano"
  given-names: "Stefano"
  orcid: "https://orcid.org/0000-0001-6993-0618"
- family-names: "Kappelmann"
  given-names: "Kevin"
  orcid: "https://orcid.org/0000-0003-1421-6497"
- family-names: "Motik"
  given-names: "Boris"
  orcid: "https://orcid.org/0000-0003-2506-4118"
title: "Guarded Saturation: Rewriting the Infinite Chase for Guarded TGDs"
version: 1.0.0
doi: 10.5281/zenodo.13742500
date-released: 2024-09-10
url: "https://github.com/KRR-Oxford/Guarded-saturation"

GitHub Events

Total
  • Delete event: 30
  • Issue comment event: 36
  • Push event: 3
  • Pull request event: 46
  • Create event: 20
Last Year
  • Delete event: 30
  • Issue comment event: 36
  • Push event: 3
  • Pull request event: 46
  • Create event: 20

Dependencies

.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
pom.xml maven
  • fr.lirmm.graphik:graal-io-dlgp 1.3.1
  • fr.lirmm.graphik:graal-io-owl 1.3.1
  • fr.lirmm.graphik:graal-io-rdf 1.3.1
  • fr.lirmm.graphik:graal-io-sparql 1.3.1
  • net.sourceforge.owlapi:owlapi-apibinding 4.0.1
  • org.semanticweb.kaon2:kaon2 2008-06-29
  • uk.ac.ox.cs.pdq:pdq-common 2.0.0
  • org.junit.jupiter:junit-jupiter-engine 5.9.2 test