1

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

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)

Does anyone know how to solve it please?

Update

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

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

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

Update 3

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.

Ania David
  • 1,168
  • 1
  • 15
  • 36

1 Answers1

1

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. 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:

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.

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.

Community
  • 1
  • 1
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • In fuseki 2.0 I used to have 3 services, so they change this in fuseki 2.3, kindly do you know how can i tell fuseki to use the reasoner just on the default graph and not use it on the other graph (let's say the other graph is named rsWithoutReasoner). Bty this is the work around that I am doing because there is no owl2 reasoner, i will extract my triples from protege and insert them to fuseki. – Ania David Apr 05 '16 at 11:31
  • @AniaDavid If the issue is not that this broke in fuseki 2.3 when you added another service description, but that a description with multiple services *stopped working* when you upgraded from 2.0 to 2.3, it might be good to phrase the question that way. Does your second configuration file work in Fuseki 2.0? – Joshua Taylor Apr 05 '16 at 12:33
  • @AniaDavid And did you upgrade from 2.0 or from a 1.x series? At the bottom of the same documentation page, there's a note: "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/", which makes it sound like multiple services in the same file should never have worked with Fuseki 2. – Joshua Taylor Apr 05 '16 at 12:35
  • I am sorry for late, stuck in another urgent, task I will continue with you later today, but yes I was using 2.0.0. and when I finish i will test that config on it. – Ania David Apr 05 '16 at 12:46
  • meanwhile I am checking your answer, if you get some time, i really highly value if you can have a look at my new quesiton – Ania David Apr 05 '16 at 13:13
  • I tried the `config.ttl` on fuseki 2.0.0 and it works pefectly without any change. that means the *problem* happens on fuseki 2.3 right? – Ania David Apr 05 '16 at 13:34
  • @AniaDavid It would certainly seem to suggest that. – Joshua Taylor Apr 05 '16 at 15:53
  • sorry what does *that* refer to ? – Ania David Apr 05 '16 at 15:57
  • "That means the problem halogens on fuseki 2.3 right? " – Joshua Taylor Apr 05 '16 at 16:26
  • To what? You asked what I was referring to. That's what I was referring to: your earlier comment. – Joshua Taylor Apr 05 '16 at 19:09
  • Yes I got u now, sorry bad English, I am sorry – Ania David Apr 05 '16 at 23:26
  • The configuration file shown is in the style of the server's overall config.ttl (has a server section). It should not go in `configuration/` as is but shoudl be split into its separate services. (The command line arguments to start the server also matter. for this question.) – AndyS Apr 06 '16 at 11:37
  • @AndyS are you telling me that in fuseki 2.3 we should have a one config file for each service and then when we run fuseki-server we select which config we want to use? if that is the case, then i would say that they (the fuseki guys) select an old approach (which already exists in fuseki 2.00), which is running the server and select the config by command line, and they remove the good one which is having many services. for me, it is okay i am doing a one config for each serivce, and everytime i want a speciic service, i name that file as "confige.ttl" and it works – Ania David Apr 06 '16 at 12:19
  • @AniaDavid No, I'm not saying that at all. The documentation (that I've already linked to) says: **"The data services configuration can come from: The directory FUSEKI_BASE/configuration/ with one data service assembler per file (includes endpoint details and the dataset description.)"** So when there are multiple files in that directory, Fuseki reads them all, and you get multiple services. But you also have the option of using a single services configuration file, too. I've updated my answer. – Joshua Taylor Apr 06 '16 at 12:56
  • @AniaDavid : service can be defined in the server wide "config.ttl" and in configuration/. – AndyS Apr 07 '16 at 08:37