Search code examples
owljenafusekiswrlpellet

Problem with setting up config for Fuseki server - Exception in initialization: org/apache/jena/reasoner/BaseInfGraph$InfFindSafeCapabilities


I was trying to set up Apache Jena Fuseki with a reasoner for SWRL Rules from protege. Followed Miguel2617/apacheJenaSetUp.md tutorial, but had this error

Exception in initialization: org/apache/jena/reasoner/BaseInfGraph$InfFindSafeCapabilities
21:48:48 WARN  WebAppContext   :: Failed startup of context oeje10w.WebAppContext@6eb089e6{Apache Jena Fuseki Server,/,b=file:///C:/Users/admin/Downloads/apache-jena-fuseki-5.0.0-rc1/webapp/,a=AVAILABLE,h=oeje10s.SessionHandler@715a70e9{STARTED}}
java.lang.NoClassDefFoundError: org/apache/jena/reasoner/BaseInfGraph$InfFindSafeCapabilities

Full error screenshot

Not sure if this is problem of Fuseki or Reasoner.

Maybe jars are in the wrong place? apache-jena-fuseki-5.0.0-rc1\lib\original-openllet-distribution-2.6.5.jar or config is wrong somewhere?

@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .

[] rdf:type fuseki:Server ;
fuseki:services (
<#service1>
) .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .

<#service1> rdf:type fuseki:Service ;
fuseki:name "FireDSS" ; # http://host:port/FireDSS
fuseki:serviceQuery "query" ; # SPARQL query service (alt name)
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
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 <#model_inf> .

<#model_inf> a ja:InfModel ;
ja:baseModel <#tdbGraph> ;
ja:reasoner [
ja:reasonerClass "openllet.jena.PelletReasonerFactory" ;
] .

<#tdbGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#tdbDataset> .

<#tdbDataset> rdf:type tdb:DatasetTDB ;
tdb:location "TDB2" ;
#set the timeout for a SPARQL query in milliseconds. 0 means no timeout and the query never times out.
ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "0" ] .

or fuseki-server.bat contains a mistake?

java -Xmx1200M -cp fuseki-server.jar;lib/* org.apache.jena.fuseki.cmd.FusekiCmd %*

I already tried to change prefix of tdb to tdb2 and change tdb to a local in-memory ttl. After I removed everything except service it worked, but there is no reasoner so it can't use SWRL rules. If there are other reasoners that's works with SWRL rules from Protege, it would be nice to know.


Solution

  • As said in the comments, Openllet 2.6.5 is not compatible with Apache Fuseki 5.0.0, it is written for Apache Fuseki 4.2.0

    The class InfFindSafeCapabilities has been removed by commit 4923bf7d and is still present in Apache Fuseki 4.7.0. You can also try this version.