I've had some issues at implementing built-in jena-fuseki reasoner, I could make it work but it would not prevent me from adding incorrect triples. So I wanted to add Openllet reasoner to my jena-fuseki server.
But I can't figure how to add openllet jar to my Docker image and make it work, I've run into many java dependances issues. To add context, my docker-compose looks like that :
jena-fuseki-server:
hostname: jena-fuseki
build:
context: .
dockerfile: server.Dockerfile
restart: always
ports:
- 3030:3030
environment:
- ADMIN_PASSWORD=admin
- FUSEKI_DATASET_1=ds
my server.Dockerfile looks like that, what I'm doing is copying my config/ontologies files to my image aswell as my openllet jar, I'm then trying to execute it which produce this issue:
jena-fuseki-server_1 | /bin/sh: 1: [java,: not found
FROM stain/jena-fuseki:4.0.0
#This is made to stop Issue with JVM locks
RUN apt-get update; \
apt-get install -y --no-install-recommends procps
RUN mkdir -p /fuseki/ontologies/
RUN mkdir -p /fuseki/configuration/
RUN mkdir -p /fuseki/inference/
RUN mkdir -p /fuseki
WORKDIR /fuseki
COPY server/openllet inference
COPY server/configuration configuration
COPY server/test ontologies
CMD ["java", "-jar", inference/openllet-distribution-2.6.5-sources.jar]
My configuration file call is inspired by this without the tdb because i'm only testing for now, she looks like this and worked for OWLMini + Generic
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
<#service1> rdf:type fuseki:Service ;
fuseki:name "ds" ; # http://host:port/ds
fuseki:serviceQuery "sparql" ; # SPARQL query service
fuseki:serviceQuery "query" ; # SPARQL query service (alt name)
fuseki:serviceUpdate "update" ; # SPARQL update service
fuseki:serviceUpload "upload" ; # Non-SPARQL upload service
fuseki:serviceReadWriteGraphStore "data" ; # SPARQL Graph store protocol (read and write)
# A separate read-only graph store endpoint:
fuseki:serviceReadGraphStore "get" ; # SPARQL Graph store protocol (read only)
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#modelInf> ;
.
<#modelInf> rdf:type ja:InfModel ;
ja:content [ja:externalContent <file:/fuseki/ontologies/server_famille.ttl> ; ] ;
ja:reasoner [
ja:reasonerClass "openllet.jena.PelletReasonerFactory" ; ]
.
I'm using the familly ontology for testing purposes,
What else have you tried ?
I've been trying things described in the links bellow, most of them has been resolved and lead me to other issues which made me have to think otherwise :
I also run a lot into this issue
ERROR Exception in initialization: the class 'openllet.jena.PelletReasonerFactory' required by the object 34064d96e625bd1f4718dc614ac47d38 [ja:reasoner of file:///fuseki/configuration/db_tdb.ttl#modelInf] could not be loaded
People usually use Openllet for maven or coupled with a Java project but i'm only using config file and a Backend API to make calls, everything is configured in what I've shown you.
Since I'm still new to docker and jena-fuseki, it may be a conceptual issue with what I am trying to do, so if you have any idea about where should I seek more information, I will be very thankfull.
I couldn't find anything from google but I find this on github : The answer
I followed his step by downloading the jar into my server/openllet and extracted the file so I could copy them in the new extra folder with all dependencies
Here is my Dockerfile :
FROM stain/jena-fuseki:4.0.0
#This is made to stop Issue with JVM locks
RUN apt-get update; \
apt-get install -y --no-install-recommends procps
RUN mkdir -p /fuseki/ontologies/
RUN mkdir -p /fuseki/configuration/
RUN mkdir -p /fuseki/extra/
RUN mkdir -p /fuseki
WORKDIR /fuseki
COPY server/openllet/jar_files extra
COPY server/configuration configuration
COPY server/test ontologies
I could still verify SWRL inference. without having to use the built in GenericRuleReasoner + OWLMiniReasoner