On 10/10/13 07:25, Alexei Golovko wrote:
Could not enable pellet reasoner.
If I use approach from the quoted thread, I see:
Error 500: tried to access field
com.hp.hpl.jena.reasoner.BaseInfGraph.isPrepared from class
org.mindswap.pellet.jena.PelletInfGraph
Is the version of Pellet you are using compatible with the version of
Jena in the Fuseki you have?
(start fuseki with argument "--version" to get the version of components.)
(running fuseki as
java -cp "${JARS}" org.apache.jena.fuseki.FusekiCmd --update
--desc=pellet-ex.ttl /inf
, where content of pellet-ex.ttl is given below).
If I try select pellet reasoner in modified config-inf-tdb.ttl (running
fuseki as
java -cp "${JARS}" org.apache.jena.fuseki.FusekiCmd --config=pellet.ttl /inf
, where pellet.ttl is given below), fuseki does not start with message:
com.hp.hpl.jena.assembler.exceptions.AmbiguousSpecificTypeException: cannot
find a most specific type for
file:///home/i/jena-fuseki-1.0.0/pellet.ttl#myReasoner, which has as
possibilities: ja:ReasonerFactory ja:InfModel.
doing:
root: file:///home/i/jena-fuseki-1.0.0/pellet.ttl#model_inf with type:
http://jena.hpl.hp.com/2005/11/Assembler#InfModel assembler class: class
com.hp.hpl.jena.assembler.assemblers.InfModelAssembler
root: file:///home/i/jena-fuseki-1.0.0/pellet.ttl#dataset with type:
http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
com.hp.hpl.jena.sparql.core.assembler.DatasetAssembler
What am I missing?
Something in the config is wrong at <#myReasoner_inf> -- it coudl be
that it is both a model and an inference engine.
Andy
2013/10/7 Alexei Golovko <[email protected]>
Thank you, I will try Pellet. (Actually, this was already in my plans, but
section of Pellet documentation about using with Jena is so short. Though
there seems to exist configuration example in
http://mail-archives.apache.org/mod_mbox/jena-users/201106.mbox/%[email protected]%3E.)
I use fuseki-1.0.0, pellet-2.3.1.
echo ${JARS}
/home/i/jena-fuseki-1.0.0/fuseki-server.jar:/home/i/pellet-2.3.1/lib/aterm-java-1.6.jar:/home/i/pellet-2.3.1/lib/pellet-cli.jar:/home/i/pellet-2.3.1/lib/pellet-core.jar:/home/i/pellet-2.3.1/lib/pellet-datatypes.jar:/home/i/pellet-2.3.1/lib/pellet-el.jar:/home/i/pellet-2.3.1/lib/pellet-explanation.jar:/home/i/pellet-2.3.1/lib/pellet-jena.jar:/home/i/pellet-2.3.1/lib/pellet-modularity.jar:/home/i/pellet-2.3.1/lib/pellet-owlapiv3.jar:/home/i/pellet-2.3.1/lib/pellet-pellint.jar:/home/i/pellet-2.3.1/lib/pellet-query.jar:/home/i/pellet-2.3.1/lib/pellet-rules.jar:/home/i/pellet-2.3.1/lib/pellet-test.jar
pellet-ex.ttl (used as --desc=pellet-ex.ttl):
@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#> .
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#inf_graph> ;
.
<#inf_graph> rdf:type ja:InfModel ;
ja:reasoner [ja:reasonerClass
"org.mindswap.pellet.jena.PelletReasonerFactory" ;
] ;
ja:baseModel <#baseGraph>
.
<#baseGraph> a ja:MemoryModel ;
ja:content [ja:externalContent
<file:///home/i/jena-fuseki-1.0.0/Data/books.ttl>]
.
pellet.ttl (used as config):
# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0
@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@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 ;
ja:context [ ja:cxtName "arq:outputGraphBNodeLabels" ; ja:cxtValue
"true" ] ;
fuseki:services (
<#service1>
) .
# Custom code.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
# TDB
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
## ---------------------------------------------------------------
## Service with only SPARQL query on an inference model.
## Inference model bbase data in TDB.
<#service1> rdf:type fuseki:Service ;
fuseki:name "inf" ; # http://host/inf
fuseki:serviceQuery "sparql" ; # SPARQL query service
fuseki:serviceUpdate "update" ;
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#model_inf> ;
.
<#model_inf> a ja:InfModel ;
###ja:baseModel <#tdbGraph> ;
#ja:baseModel <#memGraph> ; ##
ja:reasoner <#myReasoner> . <#myReasoner> #[
#ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
ja:reasoner [ja:reasonerClass
"org.mindswap.pellet.jena.PelletReasonerFactory"];
rdf:type ja:ReasonerFactory;
#rdf:type [owl:complementOf ja:InfModel]
. #] .
###<#tdbDataset> rdf:type tdb:DatasetTDB ;
### tdb:location "DB" ;
# If the unionDefaultGraph is used, then the "update" service should be
removed.
# The unionDefaultGraph is read only.
# tdb:unionDefaultGraph true ;
### .
###<#tdbGraph> rdf:type tdb:GraphTDB ;
### tdb:dataset <#tdbDataset> .
##
<#memGraph> a ja:MemoryModel .