fuseki多个服务发现异常

时间:2016-04-05 09:41:44

标签: java sparql jena fuseki

我正在使用此配置,它正在运行

compile

现在我想要另一项服务有任何推理,我将配置更改为:

@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 ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .

[] rdf:type fuseki:Server ;
    fuseki:services (
        <#serviceTDBwithReasoner>
# <#serviceInMemoryWithReasoner>

    )
.

# TDB
    tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
    tdb:GraphTDB    rdfs:subClassOf  ja:Model .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .

<#serviceTDBwithReasoner> rdf:type fuseki:Service ;
    fuseki:name                       "rs" ;       # http://host:port/ds
    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)

    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:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
   ]
.


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

<#RSDataSet> rdf:type  tdb:DatasetTDB ;
    tdb:location "RS" ;
 tdb:unionDefaultGraph true ;
.

但是当我运行我的fuseki服务器时,我收到此错误:

@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 ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .

[] rdf:type fuseki:Server ;
    fuseki:services (
        <#serviceTDBwithReasoner>
# <#serviceInMemoryWithReasoner>
    <#serviceWithoutReasoner>
    )
.

# TDB
    tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
    tdb:GraphTDB    rdfs:subClassOf  ja:Model .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .

<#serviceTDBwithReasoner> rdf:type fuseki:Service ;
    fuseki:name                       "rs" ;       # http://host:port/ds
    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)

    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:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner>
   ]


.


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

<#RSDataSet> rdf:type  tdb:DatasetTDB ;
    tdb:location "RS" ;
 tdb:unionDefaultGraph true ;
.


<#serviceWithoutReasoner> rdf:type fuseki:Service ;
fuseki:name                       "rswithoutreasoner" ;
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)

fuseki:serviceReadGraphStore      "get" ;      # SPARQL Graph store protocol (read only)
fuseki:dataset                   <#datasetwithoutreasoner> ;
.

<#datasetwithoutreasoner> rdf:type      ja:RDFDataset ;
ja:defaultGraph       <#model_infwithoutreasoner> ;
.

<#model_infwithoutreasoner> a ja:InfModel ;
ja:baseModel <#tdbGraphwithoutreasoner> ;
.

<#tdbGraphwithoutreasoner> rdf:type tdb:GraphTDB ;
tdb:dataset <#RSDataSetwithoutreasoner> .

<#RSDataSetwithoutreasoner> rdf:type  tdb:DatasetTDB ;
tdb:location "RSWithoutReasoner" ;
tdb:unionDefaultGraph true ;
.

有人知道怎么解决吗?

更新

我试图调试问题,我会删除我添加的每个三元组,直到没有问题出现,

当我删除2016-04-05 10:32:08] Server INFO Fuseki 2.3.1 2015-12-08T09:24:07+0000 [2016-04-05 10:32:08] Config INFO FUSEKI_HOME=/usr/local/apache-jena-fuseki-2.3.1 [2016-04-05 10:32:08] Config INFO FUSEKI_BASE=/usr/local/apache-jena-fuseki-2.3.1/run [2016-04-05 10:32:08] Servlet INFO Initializing Shiro environment [2016-04-05 10:32:08] Config INFO Shiro file: file:///usr/local/apache-jena-fuseki-2.3.1/run/shiro.ini [2016-04-05 10:32:08] Config INFO Load configuration: file:///usr/local/apache-jena-fuseki-2.3.1/run/configuration/config.ttl [2016-04-05 10:32:08] Config ERROR Multiple services found [2016-04-05 10:32:08] Server ERROR Exception in initialization: null [2016-04-05 10:32:08] WebAppContext WARN Failed startup of context o.e.j.w.WebAppContext@4275c20c{/,file:///usr/local/apache-jena-fuseki-2.3.1/webapp/,STARTING} org.apache.jena.fuseki.FusekiConfigException at org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:244) 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) 的三元组时,我发现它有效,但我不知道这些三元组有什么问题以及如何解决它们

Update2

听起来好像fuseki 2.3不支持多项服务,但我不确定

更新3

正如@Joshua Taylor建议的那样,我尝试了fueseki 2.0.0上的配置并且它运行良好,这意味着在fuseki 2.3中,他们停止使用mutil服务,这使得它很容易不是我的错误。

1 个答案:

答案 0 :(得分:1)

documentation page表示每个文件只能有一个服务 。因此,您可能有多个服务,但您需要多个配置文件,或使用单个服务配置文件。从文档(重点添加):

  

数据服务配置可以来自:

     
      
  1. 目录FUSEKI_BASE / configuration /每个文件包含一个数据服务汇编程序(包括端点详细信息和数据集说明。)
  2.   
  3. 系统数据库。这包括上传的汇编程序文件。它还保持每个数据服务的状态(无论是活动还是离线)。
  4.   
  5. 服务配置文件。为了兼容性,服务配置文件也可以具有数据服务。见下文。
  6.   
  7. 命令行,如果没有从.war文件作为Web应用程序运行。
  8.   

即便如此,旧的配置文件也应该“正常工作”。从同一页面:

  

与Fuseki 1配置的兼容性

     

Fuseki 1的配置,其中包含所有数据集和服务器设置   单个配置文件仍然有效。它不太灵活(你   在正在运行的服务器中停止后无法重启这些服务)   并且用户应该计划迁移到新布局。

     

要将Fuseki 1配置设置转换为Fuseki 2样式,请移动每个设置   数据服务汇编程序并将其放在自己的文件下   FUSEKI_BASE /配置/

也就是说,也许你想要一个带有推理的命名图和一个没有推理的命名图,两者都在同一个数据集中。我不认为你需要多个服务,只需要数据集中的多个图表。