Fuseki 2.3.1 でペレット推理器を使いたい
最初: 次のように、config.ttl に Pellet reasoner を追加しました。
ja:reasoner
[ ja:reasonerClass
"org.mindswap.pellet.jena.PelletReasonerFactory";]
だから今、ペレット用の瓶をフセキに追加する必要があります
このページでは、ふせきに瓶(特にペレットではない)を追加する方法を説明します
https://jena.apache.org/documentation/permissions/example.html
だから私はこの行をcommet
exec $JAVA $JVM_ARGS -jar "$JAR" "$@"
そして、私はこの行のコメントを外します
java $JVM_ARGS -cp "$JAR:$APPJAR" org.apache.jena.fuseki.cmd.FusekiCmd "$@"
で始まる行のコメントを外しますAPPJAR=
今でもペレットのjarファイルを知ってダウンロードする必要があります.
Maven から利用可能な最新バージョンをダウンロードしました。
ペレット-jena-ignazio1977-2.4.0-ignazio1977.jar
ペレットルール-2.3.6-ansell.jar
ペレット-el-2.3.6-ansell.jar
ペレット-データ型-2.3.6-ansell.jar
ペレット-コア-ignazio1977-2.4.0-ignazio1977.jar
aterm-java-1.8.2-p1.jar
commons-collections4-4.1-javadoc.jar
commons-collections4-4.1.jar
次のように、fuseki-server スクリプトに追加しました。
APPJAR=pellet-jena-ignazio1977-2.4.0-ignazio1977.jar:pellet-rules-2.3.6-ansell.jar:pellet-el-2.3.6-ansell.jar:pellet-datatypes-2.3.6-ansell.jar:pellet-core-ignazio1977-2.4.0-ignazio1977.jar:aterm-java-1.8.2-p1.jar:commons-collections4-4.1-javadoc.jar:commons-collections4-4.1.jar
(fusekiのホームディレクトリにあります)
./fuseki-server を実行すると、このエラーが発生します
[2016-03-30 16:49:06] Server INFO Fuseki 2.3.1 2015-12-08T09:24:07+0000
[2016-03-30 16:49:07] Config INFO FUSEKI_HOME=/usr/local/apache-jena-fuseki-2.3.1
[2016-03-30 16:49:07] Config INFO FUSEKI_BASE=/usr/local/apache-jena-fuseki-2.3.1/run
[2016-03-30 16:49:07] Servlet INFO Initializing Shiro environment
[2016-03-30 16:49:07] Config INFO Shiro file: file:///usr/local/apache-jena-fuseki-2.3.1/run/shiro.ini
[2016-03-30 16:49:07] Config INFO Load configuration: file:///usr/local/apache-jena-fuseki-2.3.1/run/configuration/config.ttl
[2016-03-30 16:49:07] AssemblerHelp WARN ja:loadClass: Migration to Jena3: Converting com.hp.hpl.jena.tdb.TDB to org.apache.jena.tdb.TDB
[2016-03-30 16:49:07] Server ERROR Exception in initialization: com/hp/hpl/jena/reasoner/ReasonerFactory
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/reasoner/ReasonerFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.jena.assembler.assemblers.AssemblerBase.loadClass(AssemblerBase.java:109)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.getReasonerFactoryByClassName(ReasonerFactoryAssembler.java:140)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.getReasonerFactory(ReasonerFactoryAssembler.java:131)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.open(ReasonerFactoryAssembler.java:50)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.assembler.assemblers.InfModelAssembler.getReasonerFactory(InfModelAssembler.java:53)
at org.apache.jena.assembler.assemblers.InfModelAssembler.getReasoner(InfModelAssembler.java:46)
at org.apache.jena.assembler.assemblers.InfModelAssembler.openEmptyModel(InfModelAssembler.java:34)
at org.apache.jena.assembler.assemblers.ModelAssembler.openModel(ModelAssembler.java:36)
at org.apache.jena.assembler.assemblers.ModelAssembler.open(ModelAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.assembler.assemblers.AssemblerGroup.openModel(AssemblerGroup.java:35)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.createDataset(DatasetAssembler.java:59)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.Builder.buildDataService(Builder.java:75)
at org.apache.jena.fuseki.build.Builder.buildDataAccessPoint(Builder.java:60)
at org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:249)
at org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:223)
at org.apache.jena.fuseki.server.FusekiServer.initializeDataAccessPoints(FusekiServer.java:212)
at org.apache.jena.fuseki.server.FusekiServerListener.init(FusekiServerListener.java:78)
at org.apache.jena.fuseki.server.FusekiServerListener.contextInitialized(FusekiServerListener.java:46)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:835)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:808)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1368)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1335)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:511)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:405)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:372)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.apache.jena.fuseki.jetty.JettyFuseki.start(JettyFuseki.java:120)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:359)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:95)
at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:60)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.reasoner.ReasonerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 71 more
助けてください
ヒント: 私が試したことが正しいかどうかはわかりません。私が望むのは、ペレット推論をフセキに含めることだけです。
アップデート
イグナツィオが瓶を混ぜていると私に言った後、
私は Pellet git hut に行き、src をダウンロードし、maven を使用して jar ファイルに準拠して取得しました
次に、使用しているjarを次のように変更しました。
commons-collections4-4.1-javadoc.jar:commons-collections4-4.1.jar:pellet-cli-2.4.0-SNAPSHOT.jar:jena-core-2.13.0.jar:pellet-jena-2.4.0-SNAPSHOT.jar:pellet-modularity-2.4.0-SNAPSHOT.jar:pellet-owlapi-2.4.0-SNAPSHOT.jar:pellet-pellint-2.4.0-SNAPSHOT.jar
しかし、私はこの例外を得ました:
[2016-03-30 17:42:09] AssemblerHelp WARN ja:loadClass: Migration to Jena3: Converting com.hp.hpl.jena.tdb.TDB to org.apache.jena.tdb.TDB
[2016-03-30 17:42:10] RDFDefaultErrorHandler WARN unknown-source: {W136} Relative URIs are not permitted in RDF: specifically <ont-policy.rdf>
[2016-03-30 17:42:10] Server ERROR Exception in initialization: expected class org.apache.jena.reasoner.ReasonerFactory, but had class org.mindswap.pellet.jena.PelletReasonerFactory
[2016-03-30 17:42:10] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@5bcde458{/,file:///usr/local/apache-jena-fuseki-2.3.1/webapp/,STARTING}
org.apache.jena.assembler.exceptions.NotExpectedTypeException: expected class org.apache.jena.reasoner.ReasonerFactory, but had class org.mindswap.pellet.jena.PelletReasonerFactory
doing:
root: 79f74f0ed3a21ef24b1cbccda7d37b62 with type: http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory assembler class: class org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler
root: file:///usr/local/apache-jena-fuseki-2.3.1/run/configuration/config.ttl#model_inf with type: http://jena.hpl.hp.com/2005/11/Assembler#InfModel assembler class: class org.apache.jena.assembler.assemblers.InfModelAssembler
root: file:///usr/local/apache-jena-fuseki-2.3.1/run/configuration/config.ttl#dataset with type: http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class org.apache.jena.sparql.core.assembler.DatasetAssembler
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.mustBeReasonerFactory(ReasonerFactoryAssembler.java:169)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.getReasonerFactoryByClassName(ReasonerFactoryAssembler.java:141)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.getReasonerFactory(ReasonerFactoryAssembler.java:131)
at org.apache.jena.assembler.assemblers.ReasonerFactoryAssembler.open(ReasonerFactoryAssembler.java:50)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.assembler.assemblers.InfModelAssembler.getReasonerFactory(InfModelAssembler.java:53)
at org.apache.jena.assembler.assemblers.InfModelAssembler.getReasoner(InfModelAssembler.java:46)
at org.apache.jena.assembler.assemblers.InfModelAssembler.openEmptyModel(InfModelAssembler.java:34)
at org.apache.jena.assembler.assemblers.ModelAssembler.openModel(ModelAssembler.java:36)
at org.apache.jena.assembler.assemblers.ModelAssembler.open(ModelAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.assembler.assemblers.AssemblerGroup.openModel(AssemblerGroup.java:35)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.createDataset(DatasetAssembler.java:59)
at org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:130)
at org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:117)
at org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:81)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.Builder.buildDataService(Builder.java:75)
at org.apache.jena.fuseki.build.Builder.buildDataAccessPoint(Builder.java:60)
at org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:249)
at org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:223)
at org.apache.jena.fuseki.server.FusekiServer.initializeDataAccessPoints(FusekiServer.java:212)
at org.apache.jena.fuseki.server.FusekiServerListener.init(FusekiServerListener.java:78)
at org.apache.jena.fuseki.server.FusekiServerListener.contextInitialized(FusekiServerListener.java:46)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:835)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:808)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1368)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1335)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:511)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:405)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:372)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.apache.jena.fuseki.jetty.JettyFuseki.start(JettyFuseki.java:120)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:359)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:95)
at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:60)
[2016-03-30 17:42:10] Server INFO Started 2016/03/30 17:42:10 WEST on port 3030