What is Slider?
Slider is an incremental forward-chaining reasoner supporting the following rule sets:
- ρdf Default
- ρdf Full
- RDFS Light
- RDFS Default
- RDFS Full
Slider allows to custom these fragments by selecting the rules to use for the inference. Additional rules can be easily added by implementing a single method.
Slider provides both batch and incremental reasoning, and supports data streams.
It is a full Java project.
Requirements
- Java 1.7 or greater
- Git to clone the project
- Maven to install and run it easily
Installation
To install Slider, clone the repository and compile it through Maven:
git clone git@github.com:juleschevalier/slider.git
cd slider/
mvn install
Running Slider
Command Line use
Slider can be run as a standalone software. The exec-maven-plugin is configured, and can be used to run it. For example, for launch the inference on the file "toto.nt" for RDFS:
mvn exec:java -q -Dexec.args="-p RDFS toto.nt"
Here is the list of the different options (accesible via -h,--help option):
usage: main
-b,--buffer-size <time>......set the buffer size
-d,--directory <directory>...infers on all ontologies in the directory
-h,--help....................print this message
-i,--iteration <number>......how many times each file
-n,--threads <number>........set the number of threads by available core (0 means the jvm manage)
-o,--output..................save output into file
-p,--profile <profile>.......set the fragment [RHODF, BRHODF, RDFS, BRDFS, LRDFS]
-t,--timeout <arg>...........set the buffer timeout in ms
-v,--verbose.................enable verbose mode
-w,--warm-up.................insert a warm-up lap before the inference
Examples
Reason on all ontologies in the folder "~/Ontologies" with RDFS
mvn exec:java -q -Dexec.args="-p RDFS -d ~/Ontologies"
Reason over the ontology "ontology1.nt" with ρdf with a buffer timeout of 1000ms
mvn exec:java -q -Dexec.args="-p rhodf -t 1000 ~/Ontologies/ontology1.nt"
Reason on all ontologies in the folder "~/Ontologies" with RDFS with a warm-up lap (no included in results) and 10 iterations for each file
mvn exec:java -q -Dexec.args="-p RDFS -w -i 10 -d ~/Ontologies"
Reason over the ontology "ontology1.nt" with ρdf and write the output into "infered1.nt"
mvn exec:java -q -Dexec.args="-p rhodf -o infered.nt ~/Ontologies/ontology1.nt"
Use Slider's API
Slider can also be used as a library. It provides both bash and incremental reasoning.
Batch reasoning
final TripleStore tripleStore = new VerticalPartioningTripleStoreRWLock();
final Dictionary dictionary = new DictionaryPrimitrivesRWLock();
final BatchReasoner reasoner = new BatchReasoner(tripleStore, dictionary, ReasonerProfile.RDFS);
final Parser parser = new ParserImplNaive(dictionary, tripleStore);
final Collection<Triple> triples = parser.parse(file);
reasoner.reasonOn(triples);
Incremental reasoning
final TripleStore tripleStore = new VerticalPartioningTripleStoreRWLock();
final Dictionary dictionary = new DictionaryPrimitrivesRWLock();
final IncrementalReasoner reasoner = new IncrementalReasoner(tripleStore, dictionary, ReasonerProfile.RDFS);
final Parser parser = new ParserImplNaive(dictionary, tripleStore);
reasoner.start();
parser.parseStream(file.getAbsolutePath(), reasoner);
reasoner.closeAndWait();
Maven dependency
Setup the server in your pom.xml:
<repositories>
<repository>
<id>slider-mvn-repo</id>
<url>https://raw.github.com/juleschevalier/slider/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
Then use the following dependency :
<dependency>
<groupId>fr.ujm.tse.lt2c.satin</groupId>
<artifactId>slider</artifactId>
<version>0.9.7-SNAPSHOT</version>
</dependency>
Correctness
The correctness of Slider's inference has been verified using Jena's reasoner as ground truth.
How to reproduce
All the details to reproduce our experimentations on Slider.
Ontologies
The BSBM ontologies have been generated thanks to this script. It generates the following ontologies:
- dataset_100k.nt
- dataset_200k.nt
- dataset_500k.nt
- dataset_1M.nt
- dataset_5M.nt
The subClassOf ontologies have been generated thanks to this script. We used it to generate the following ontologies:
- subClassOf10.nt
- subClassOf20.nt
- subClassOf50.nt
- subClassOf100.nt
- subClassOf200.nt
- subClassOf500.nt
You can download the two real life zipped ontologies here:
All these ontologies can be downloaded here
Run the experimentations
To benchmark Slider's performances, the easiest way is to use the commande line interface provided by the Main class. You can use the maven exec plugin preconfigured. First install Slider (see section Installation). For better results, we launch the inference 10 times on each ontology, and used the average time. We also add a warm-up lap, which is a first iteration of inference which does not appear in the results. This first step allow Java to operate the on-the-fly optimisation of the binaries.
To run an experimentation on the ontologies contained in a folder "Ontologies" for RDFS, please use the following command
mvn exec:java -q -Dexec.args="-p RDFS -i 10 -w -d ~/Ontologies"
To run experimentation on the parameters of Slider, please use the same command with the corresponding options:
-b,--buffer-size <time>......set the buffer size
-n,--threads <number>........set the number of threads by available core (0 means the jvm manage)
-t,--timeout <arg>.......... set the buffer timeout in ms (0 means timeout will be disabled)
Bug reports
If you discover any bug, feel free to create an issue on GitHub: https://github.com/juleschevalier/slider/issues.
Contributors
- Jules Chevalier @juleschevalier
- Julien Subercaze @jsubercaze
- Christophe Gravier @flaforest
- Frédérique Laforest @cgravier
Licence
Slider is provided under Apache License, Version 2.0. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Contact
For any question, please contact us at jules.chevalier@univ-st-etienne.fr
Acknowledgement
This work is part of the Open Cloudware project, funded by the French Fonds national pour la Société Numérique(FSN), and supported by Pôles Minalogic, Systematic and SCS.