-
Notifications
You must be signed in to change notification settings - Fork 13
Using Rulewerk via Maven
Project rulewerk-example shows a simple example of how Rulewerk can be used via Maven. It is a skeleton projects that includes dependencies to all Rulewerk modules in its pom.xml file. In order to use Rulewerk, you simply need to extend this project with your own code using Java 1.8 or above.
The current pre-release of Rulewerk is version 0.6.0-SNAPSHOT. This version number is declared inside <properties></properties>
in the pom.xml file of project rulewerk-example:
<rulewerkVersion>0.6.0-SNAPSHOT</rulewerkVersion>
The pom.xml file of project rulewerk-example includes the following lines in its <dependencies></dependencies>
:
<dependency>
<groupId>${rulewerkGroupId}</groupId>
<artifactId>rulewerk-core</artifactId>
<version>${rulewerkVersion}</version>
</dependency>
<dependency>
<groupId>${rulewerkGroupId}</groupId>
<artifactId>rulewerk-parser</artifactId>
<version>${rulewerkVersion}</version>
</dependency>
<dependency>
<groupId>${rulewerkGroupId}</groupId>
<artifactId>rulewerk-owlapi</artifactId>
<version>${rulewerkVersion}</version>
</dependency>
<dependency>
<groupId>${rulewerkGroupId}</groupId>
<artifactId>rulewerk-graal</artifactId>
<version>${rulewerkVersion}</version>
</dependency>
<dependency>
<groupId>${rulewerkGroupId}</groupId>
<artifactId>rulewerk-rdf</artifactId>
<version>${rulewerkVersion}</version>
</dependency>
The modules available via Maven include:
- rulewerk-core: essential data models for rules and facts, and essential reasoner functionality
- rulewerk-parser: support for processing knowledge bases in Rulewerk syntax
- rulewerk-owlapi: support for converting rules from OWL ontology, loaded with the OWL API
- rulewerk-graal: support for converting rules, facts and queries from Graal API objects and DLGP files
- rulewerk-rdf: support for reading from RDF files in Java (not required for loading RDF directly during reasoning)
The released packages use rulewerk-base, which packages system-dependent binaries for Linux, MacOS, and Windows, and should work out of the box with current versions of these systems. In case of problems, or if you are using the current development version, own binaries can be compiled as follows:
- Run build-vlog-library.sh or execute the commands in this file manually. This will compile a local jar file on your system, copy it to
./rulewerk-core/lib/jvlog-local.jar
, and install the new jar locally in Maven in place of the distributed version of rulewerk-base. - Run
mvn install
to test if the setup works
- The module rulewerk-examples includes short example programs that demonstrate various features and use cases
- JavaDoc is available online and through the Maven packages.