fuseki发现多个服务异常 [英] fuseki Multiple services found exception

查看:63
本文介绍了fuseki发现多个服务异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此配置,并且可以正常工作

I was using this config and it is working

@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 ;
.

现在,我要拥有没有没有任何推理程序的另一项服务,我将配置更改为:

Now I want to have another service that does not have any reasoner, I changed my config to this:

@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 ;
.

但是当我运行fuseki服务器时,出现此错误:

but when i run my fuseki server, i get this error:

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)

有人知道如何解决吗?

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

I tried to debug the problem, i would remove each triple that I add until there is no problem appears,

我发现我删除了serviceWithoutReasoner的三元组时,它可以工作,但是我不知道这些三元组出了什么问题以及如何解决它们

I found out when i remove the triples for serviceWithoutReasoner, it works, but i couldn't know what was wrong with these triples and how to solve them

Update2

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

Update2

It sounds like fuseki 2.3 doesn't support multi services, but i am not sure

正如 @Joshua Taylor 所建议的那样,我尝试在fueseki 2.0.0上进行配置,并且效果很好,表示在fuseki 2.3中,他们停止使用mutil服务,这很容易就不是我的错了.

As @Joshua Taylor suggests, i tried the configuration on fueseki 2.0.0 and it works perfectly, that means in fuseki 2.3, they stopped using mutil services, that makes it easy that it is not my mistake.

推荐答案

The documentation page says that you can only have one service per file. So you can probably have multiple services, but you'll need multiple config files, or to use the single service configuration file. From the documentation (emphasis added):

数据服务配置可以来自:

The data services configuration can come from:

  1. 目录FUSEKI_BASE/configuration/,每个文件带有一个数据服务汇编程序(包括端点详细信息和数据集描述.)
  2. 系统数据库.这包括上载的汇编器文件.它还可以保持每个数据服务的状态(处于活动状态还是脱机状态).
  3. 服务配置文件.为了兼容,服务配置文件也可以具有数据服务.见下文.
  4. 命令行(如果未从.war文件作为Web应用程序运行).
  1. The directory FUSEKI_BASE/configuration/ with one data service assembler per file (includes endpoint details and the dataset description.)
  2. The system database. This includes uploaded assembler files. It also keeps the state of each data service (whether it's active or offline).
  3. The service configuration file. For compatibility, the service configuration file can also have data services. See below.
  4. The command line, if not running as a web application from a .war file.

即使如此,旧配置文件也应该正常工作".也一样在同一页面上:

Even so, the old configuration files are supposed to "just work" as well. From the same page:

与Fuseki 1配置兼容

来自Fuseki 1的配置,其中所有数据集和服务器设置都在 单个配置文件仍然可以使用.它不太灵活(您 在正在运行的服务器中停止这些服务后将无法重新启动它们) 并且用户应该计划迁移到新版式.

Compatibility with Fuseki 1 configuration

Configurations from Fuseki 1, where all dataset and server setup is in a single configuration file, will still work. It is less flexible (you can't restart these services after stopping them in a running server) and user should plan to migrate to the new layout.

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

To convert a Fuseki 1 configuration setup to Fuseki 2 style, move each data service assembler and put in it's own file under FUSEKI_BASE/configuration/

也就是说,也许您想要在同一个数据集中都具有推理的命名图和没有推理的命名图.我认为您不需要为此提供多种服务,只需数据集中的多个图形即可.

That said, maybe you want a named graph with reasoning and a named graph without reasoning, both in the same dataset. I don't think you'd need multiple services for that, just multiple graphs in the dataset.

这篇关于fuseki发现多个服务异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆