You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Svensson, Lars" <L....@dnb.de> on 2019/01/16 09:25:59 UTC

How to configure Fuseki to work with several graphs as a joint dataset?

Greetings,

I have several TDB2 datasets that I want to expose as named graphs and as a joint dataset. My basic idea is to have each TDB2 dataset as its own graph and then a joint dataset combining all graphs with the default graph being the union of all named graphs. My configuration is:

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

<#service1> rdf:type fuseki:Service ;
    fuseki:name                     "/dnb" ;   # http://host:port/dnb
    fuseki:serviceQuery             "query" ;    # SPARQL query service
    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
    fuseki:dataset           <#dnb> ;
    .

<#dnb> a ja:RDFDataset ;
    tdb2:unionDefaultGraph true ;
    ja:namedGraph [
        ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
        ja:graph <#authorities>
    ];
    ja:namedGraph [
        ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
        ja:graph <#bib>
    ];
    ja:namedGraph [
        ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
        ja:graph <#dnb-all>
    ];
    ja:namedGraph [
        ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
        ja:graph <#zdb>
    ];
    .
<#authorities> a tdb2:GraphTDB ;
    tdb2:dataset <#dataset-authorities> .
<#bib> a tdb2:GraphTDB ;
    tdb2:dataset <#dataset-bib> .
<#dnb-all> a tdb2:GraphTDB ;
    tdb2:dataset <#dataset-dnb-all> .
<#zdb> a tdb2:GraphTDB ;
    tdb2:dataset <#dataset-zdb> .

<#dataset-authorites> a tdb2:DatasetTDB ;
    tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
<#dataset-bib> a tdb2:DatasetTDB ;
    tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
<#dataset-dnb-all> a tdb2:DatasetTDB ;
    tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
<#dataset-zdb> a tdb2:DatasetTDB ;
    tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .

When I start Fuseki, I get the following error message:

[2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
[2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
  doing:
    root: file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#dnb with type: http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class org.apache.jena.sparql.core.assembler.DatasetAssembler

Have I missed something obvious?

Thanks in advance,

Lars

Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by ajs6f <aj...@apache.org>.
You should be able to use the --graph option with tdb2.tdbloader. 

In general, it's useful to check the options for the Jena CLI utilities. There's a lot of functionality there.

ajs6f

> On Jan 16, 2019, at 11:02 AM, Svensson, Lars <L....@dnb.de> wrote:
> 
> OK, thank you. I think I got the general pattern.
> 
> That leaves me with the question how to import a set of n-triples into a specific graph in a TDB2 dataset.
> 
> Thanks,
> 
> Lars


RE: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by "Svensson, Lars" <L....@dnb.de>.
Hi Andy,

On Wednesday, January 16, 2019 4:44 PM, Andy Seaborne [mailto:andy@apache.org] wrote:

> For my understanding here:
> Is there a reason not to have a single TDB2 dataset with several graphs
> in it with "union graph" set?

I guess the main reason is that I couldn't figure out how to load an RDF file in n-triples into a specific graph in a TDB2 dataset...

More comments in-line.

> On 16/01/2019 09:25, Svensson, Lars wrote:
> > Greetings,
> >
> > I have several TDB2 datasets that I want to expose as named graphs and as a
> joint dataset.
> 
> > My basic idea is to have each TDB2 dataset as its own graph and then a joint
> dataset combining all graphs with the default graph being the union of all named
> graphs. My configuration is:
> 
> You won't get the union that way because union is a feature of the
> storage.
> 
> A union is formed by
> <urn:x-arq:UnionGraph> and API call DatasetGraph.getUnionGraph() work on
> any dataset,
> 
> You can use in the query:
> 
> FROM <urn:x-arq:UnionGraph>
> 
> or GRAPH <urn:x-arq:UnionGraph>
> 
> and you can build a general (i.e. ad hoc graph combination) dataset with
> a union graph as default graph.
> 
> More below.
> 
> >
> > @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
> > @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
> > @prefix :        <#> .
> >
> > <#service1> rdf:type fuseki:Service ;
> >      fuseki:name                     "/dnb" ;   # http://host:port/dnb
> >      fuseki:serviceQuery             "query" ;    # SPARQL query service
> >      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
> (read only)
> >      fuseki:dataset           <#dnb> ;
> >      .
> >
> > <#dnb> a ja:RDFDataset ;
> >      tdb2:unionDefaultGraph true ;
> 
> No effect. This is a ja:RDFDataset, not tdb2:DatasetTDB2.
> tdb2:unionDefaultGraph only applies to tdb2:DatasetTDB2.

OK.
 
> ---- Example / works for me:
> 
> 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 tdb2:    <http://jena.apache.org/2016/tdb#>
> PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>
> 
> <#service_tdb> rdf:type fuseki:Service ;
>      rdfs:label                      "Selection of TDB2 graphs" ;
>      fuseki:name                     "ds" ;
>      fuseki:serviceQuery             "query" ;
>      fuseki:serviceQuery             "sparql" ;
>      fuseki:serviceUpdate            "update" ;
>      fuseki:serviceUpload            "upload" ;
>      fuseki:serviceReadWriteGraphStore      "data" ;
>      # A separate read-only graph store endpoint:
>      fuseki:serviceReadGraphStore       "get" ;
>      fuseki:dataset           <#dataset> ;
>      .
> 
> # Dataset with default graph the union graph from the storage TDB2 and 2
> named graphs.
> <#dataset> rdf:type      ja:RDFDataset ;
>      ja:defaultGraph <#graph> ;
>      ja:namedGraph [
>            ja:graphName <https://example/ng1> ;
>            ja:graph <#graph2>
>        ];
>      ja:namedGraph [
>            ja:graphName <https://example/ng2> ;
>            ja:graph <#graph3>
>        ];
>      .
> 
> ## Graphs out of DB2.
> 
> <#graph> rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "urn:x-arq:UnionGraph" ;
>      tdb2:location "DB2" ;
>      .
> 
> <#graph2>  rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "https://example/ng1" ;
>      tdb2:location "DB2" ;
>      .
> <#graph3>  rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "https://example/ng" ;
>      tdb2:location "DB2" ;
>      .
> 
> 
> 
> >      ja:namedGraph [
> >          ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
> >          ja:graph <#authorities>
> >      ];
> >      ja:namedGraph [
> >          ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
> >          ja:graph <#bib>
> >      ];
> >      ja:namedGraph [
> >          ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
> >          ja:graph <#dnb-all>
> >      ];
> >      ja:namedGraph [
> >          ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
> >          ja:graph <#zdb>
> >      ];
> >      .
> > <#authorities> a tdb2:GraphTDB ;
> 
> tdb2:GraphTDB2

OK.

> >      tdb2:dataset <#dataset-authorities> .
> 
> tdb2:location works here but I also checked with:
> 
> ## Graphs out of DB2.
> 
> <#graph> rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "urn:x-arq:UnionGraph" ;
>      tdb2:dataset <#DB2> ;
>      .
> 
> <#graph2>  rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "https://example/ng1" ;
>      tdb2:dataset <#DB2> ;
>      .
> <#graph3>  rdf:type tdb2:GraphTDB2 ;
>      tdb2:graphName "https://example/ng" ;
>      tdb2:dataset <#DB2> ;
>      .
> 
> <#DB2>  rdf:type tdb2:DatasetTDB2 ;
>      tdb2:location "DB2" ;

OK, thank you. I think I got the general pattern.

That leaves me with the question how to import a set of n-triples into a specific graph in a TDB2 dataset.

Thanks,

Lars

Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by Andy Seaborne <an...@apache.org>.
Hi there,

For my understanding here:
Is there a reason not to have a single TDB2 dataset with several graphs 
in it with "union graph" set?


On 16/01/2019 09:25, Svensson, Lars wrote:
> Greetings,
> 
> I have several TDB2 datasets that I want to expose as named graphs and as a joint dataset.

> My basic idea is to have each TDB2 dataset as its own graph and then a joint dataset combining all graphs with the default graph being the union of all named graphs. My configuration is:

You won't get the union that way because union is a feature of the 
storage.

A union is formed by
<urn:x-arq:UnionGraph> and API call DatasetGraph.getUnionGraph() work on 
any dataset,

You can use in the query:

FROM <urn:x-arq:UnionGraph>

or GRAPH <urn:x-arq:UnionGraph>

and you can build a general (i.e. ad hoc graph combination) dataset with 
a union graph as default graph.

More below.

> 
> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
> @prefix :        <#> .
> 
> <#service1> rdf:type fuseki:Service ;
>      fuseki:name                     "/dnb" ;   # http://host:port/dnb
>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
>      fuseki:dataset           <#dnb> ;
>      .
> 
> <#dnb> a ja:RDFDataset ;
>      tdb2:unionDefaultGraph true ;

No effect. This is a ja:RDFDataset, not tdb2:DatasetTDB2. 
tdb2:unionDefaultGraph only applies to tdb2:DatasetTDB2.

---- Example / works for me:

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 tdb2:    <http://jena.apache.org/2016/tdb#>
PREFIX ja:      <http://jena.hpl.hp.com/2005/11/Assembler#>

<#service_tdb> rdf:type fuseki:Service ;
     rdfs:label                      "Selection of TDB2 graphs" ;
     fuseki:name                     "ds" ;
     fuseki:serviceQuery             "query" ;
     fuseki:serviceQuery             "sparql" ;
     fuseki:serviceUpdate            "update" ;
     fuseki:serviceUpload            "upload" ;
     fuseki:serviceReadWriteGraphStore      "data" ;
     # A separate read-only graph store endpoint:
     fuseki:serviceReadGraphStore       "get" ;
     fuseki:dataset           <#dataset> ;
     .

# Dataset with default graph the union graph from the storage TDB2 and 2 
named graphs.
<#dataset> rdf:type      ja:RDFDataset ;
     ja:defaultGraph <#graph> ;
     ja:namedGraph [
           ja:graphName <https://example/ng1> ;
           ja:graph <#graph2>
       ];
     ja:namedGraph [
           ja:graphName <https://example/ng2> ;
           ja:graph <#graph3>
       ];
     .

## Graphs out of DB2.

<#graph> rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "urn:x-arq:UnionGraph" ;
     tdb2:location "DB2" ;
     .

<#graph2>  rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "https://example/ng1" ;
     tdb2:location "DB2" ;
     .
<#graph3>  rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "https://example/ng" ;
     tdb2:location "DB2" ;
     .



>      ja:namedGraph [
>          ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
>          ja:graph <#authorities>
>      ];
>      ja:namedGraph [
>          ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
>          ja:graph <#bib>
>      ];
>      ja:namedGraph [
>          ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
>          ja:graph <#dnb-all>
>      ];
>      ja:namedGraph [
>          ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
>          ja:graph <#zdb>
>      ];
>      .
> <#authorities> a tdb2:GraphTDB ;

tdb2:GraphTDB2

>      tdb2:dataset <#dataset-authorities> .

tdb2:location works here but I also checked with:

## Graphs out of DB2.

<#graph> rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "urn:x-arq:UnionGraph" ;
     tdb2:dataset <#DB2> ;
     .

<#graph2>  rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "https://example/ng1" ;
     tdb2:dataset <#DB2> ;
     .
<#graph3>  rdf:type tdb2:GraphTDB2 ;
     tdb2:graphName "https://example/ng" ;
     tdb2:dataset <#DB2> ;
     .

<#DB2>  rdf:type tdb2:DatasetTDB2 ;
     tdb2:location "DB2" ;
     .


> <#bib> a tdb2:GraphTDB ;
>      tdb2:dataset <#dataset-bib> .
> <#dnb-all> a tdb2:GraphTDB ;
>      tdb2:dataset <#dataset-dnb-all> .
> <#zdb> a tdb2:GraphTDB ;
>      tdb2:dataset <#dataset-zdb> .
> 
> <#dataset-authorites> a tdb2:DatasetTDB ;
>      tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
> <#dataset-bib> a tdb2:DatasetTDB ;
>      tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
> <#dataset-dnb-all> a tdb2:DatasetTDB ;
>      tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
> <#dataset-zdb> a tdb2:DatasetTDB ;
>      tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
> 
> When I start Fuseki, I get the following error message:



> 
> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
>    doing:
>      root: file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#dnb with type: http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class org.apache.jena.sparql.core.assembler.DatasetAssembler
> 
> Have I missed something obvious?
> 
> Thanks in advance,
> 
> Lars
> 

Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by ajs6f <aj...@apache.org>.
Merged, thanks very much!

(It won't show up at the public site until we rebuild that site.)

ajs6f

> On Jan 17, 2019, at 8:57 AM, Svensson, Lars <L....@dnb.de> wrote:
> 
> On Wednesday, January 16, 2019 5:36 PM, ajs6f [mailto:ajs6f@apache.org] wrote:
> 
>> In the top right corner of any Jena documentation webpage, you should see an
>> "Improve This Page" link, which will allow you to submit an edit to improve that
>> page. Please do, and thanks in advance!
> 
> Done.
> 
> /Lars


RE: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by "Svensson, Lars" <L....@dnb.de>.
On Wednesday, January 16, 2019 5:36 PM, ajs6f [mailto:ajs6f@apache.org] wrote:

> In the top right corner of any Jena documentation webpage, you should see an
> "Improve This Page" link, which will allow you to submit an edit to improve that
> page. Please do, and thanks in advance!

Done.

/Lars

Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by ajs6f <aj...@apache.org>.
In the top right corner of any Jena documentation webpage, you should see an "Improve This Page" link, which will allow you to submit an edit to improve that page. Please do, and thanks in advance!

ajs6f

> On Jan 16, 2019, at 11:12 AM, Svensson, Lars <L....@dnb.de> wrote:
> 
> Thanks ajs6f and Andy!
> 
> On Wednesday, January 16, 2019 5:08 PM, Andy Seaborne [mailto:andy@apache.org] wrote:
> 
>> 
>> On 16/01/2019 16:04, Svensson, Lars wrote:
>>> On Wednesday, January 16, 2019 5:02 PM, ajs6f [mailto:ajs6f@apache.org]
>> wrote:
>>> 
>>>> Yes, the approach that Andy suggested in an email earlier today (use _one_
>> TDB2
>>>> instance, load your graphs into different named graphs in it, and enable the
>> "default
>>>> graph = union graph" option) is the right choice.
>>> 
>>> OK, thanks for confirming this. What I haven't understood so far is how to load a
>> set of n-triples into a named graph in a TDB2 dataset. Can you give any hints on
>> that?
>> 
>> As ajs6f says "tdb2.tdbloader --graph"
> 
> That should be the easiest solution since I'm starting from scratch here. I simply wasn't aware of all the CLI options for the tdbloader and thought that the ones listed in the documentation [1] were the only ones.
> 
> [1] https://jena.apache.org/documentation/tdb2/tdb2_cmds.html
> 
> Thanks again!
> 
> Best,
> 
> Lars


RE: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by "Svensson, Lars" <L....@dnb.de>.
Thanks ajs6f and Andy!

On Wednesday, January 16, 2019 5:08 PM, Andy Seaborne [mailto:andy@apache.org] wrote:

> 
> On 16/01/2019 16:04, Svensson, Lars wrote:
> > On Wednesday, January 16, 2019 5:02 PM, ajs6f [mailto:ajs6f@apache.org]
> wrote:
> >
> >> Yes, the approach that Andy suggested in an email earlier today (use _one_
> TDB2
> >> instance, load your graphs into different named graphs in it, and enable the
> "default
> >> graph = union graph" option) is the right choice.
> >
> > OK, thanks for confirming this. What I haven't understood so far is how to load a
> set of n-triples into a named graph in a TDB2 dataset. Can you give any hints on
> that?
> 
> As ajs6f says "tdb2.tdbloader --graph"

That should be the easiest solution since I'm starting from scratch here. I simply wasn't aware of all the CLI options for the tdbloader and thought that the ones listed in the documentation [1] were the only ones.

[1] https://jena.apache.org/documentation/tdb2/tdb2_cmds.html

Thanks again!

Best,

Lars

Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by Andy Seaborne <an...@apache.org>.

On 16/01/2019 16:04, Svensson, Lars wrote:
> On Wednesday, January 16, 2019 5:02 PM, ajs6f [mailto:ajs6f@apache.org] wrote:
> 
>> Yes, the approach that Andy suggested in an email earlier today (use _one_ TDB2
>> instance, load your graphs into different named graphs in it, and enable the "default
>> graph = union graph" option) is the right choice.
> 
> OK, thanks for confirming this. What I haven't understood so far is how to load a set of n-triples into a named graph in a TDB2 dataset. Can you give any hints on that?

As ajs6f says "tdb2.tdbloader --graph"

or in the server with update available:

  s-put "http://localhost:3030/ds2" "https://example/ng2" TheData.nt

or the Fuseki UI

or (there are many ways!) write a little script to turn the N-triples 
files into one big N-quads file and load it either way.

     Andy

> 
> Thanks,
> 
> Lars
>   
>>> On Jan 16, 2019, at 10:50 AM, Svensson, Lars <L....@dnb.de> wrote:
>>>
>>> On Wednesday, January 16, 2019 4:17 PM, ajs6f [mailto:ajs6f@apache.org]
>> wrote:
>>>
>>>> I'm not quite sure what's going on here. It looks like you are trying to load entire
>>>> datasets as named graphs in another dataset, but that doesn't make any sense.
>>>> Datasets contain graphs. You can't shove an entire dataset into a graph.
>>>>
>>>> Are you trying to extract a particular graph from each of these datasets to insert
>> into
>>>> another?
>>>>
>>>> Perhaps you can tell us a bit more about what you are trying to accomplish here,
>> and
>>>> we can help you find out how to do that.
>>>
>>> My use case is that I have some (fairly large) RDF files (in n-triples) that I want to
>> expose through Fuseki.
>>> The contents of each file must be in its own named graph.
>>> I also want the default graph to be the union of all the named graphs.
>>>
>>> So far I have loaded each RDF file into its own TDB2 store, but if I understand you
>> correctly that is the wrong approach...
>>>
>>> Thanks,
>>>
>>> Lars
>>>
>>>>> On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
>>>>>
>>>>> Greetings,
>>>>>
>>>>> I have several TDB2 datasets that I want to expose as named graphs and as a
>>>> joint dataset. My basic idea is to have each TDB2 dataset as its own graph and
>> then
>>>> a joint dataset combining all graphs with the default graph being the union of all
>>>> named graphs. My configuration is:
>>>>>
>>>>> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
>>>>> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
>>>>> @prefix :        <#> .
>>>>>
>>>>> <#service1> rdf:type fuseki:Service ;
>>>>>    fuseki:name                     "/dnb" ;   # http://host:port/dnb
>>>>>    fuseki:serviceQuery             "query" ;    # SPARQL query service
>>>>>    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
>>>> (read only)
>>>>>    fuseki:dataset           <#dnb> ;
>>>>>    .
>>>>>
>>>>> <#dnb> a ja:RDFDataset ;
>>>>>    tdb2:unionDefaultGraph true ;
>>>>>    ja:namedGraph [
>>>>>        ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
>>>>>        ja:graph <#authorities>
>>>>>    ];
>>>>>    ja:namedGraph [
>>>>>        ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
>>>>>        ja:graph <#bib>
>>>>>    ];
>>>>>    ja:namedGraph [
>>>>>        ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
>>>>>        ja:graph <#dnb-all>
>>>>>    ];
>>>>>    ja:namedGraph [
>>>>>        ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
>>>>>        ja:graph <#zdb>
>>>>>    ];
>>>>>    .
>>>>> <#authorities> a tdb2:GraphTDB ;
>>>>>    tdb2:dataset <#dataset-authorities> .
>>>>> <#bib> a tdb2:GraphTDB ;
>>>>>    tdb2:dataset <#dataset-bib> .
>>>>> <#dnb-all> a tdb2:GraphTDB ;
>>>>>    tdb2:dataset <#dataset-dnb-all> .
>>>>> <#zdb> a tdb2:GraphTDB ;
>>>>>    tdb2:dataset <#dataset-zdb> .
>>>>>
>>>>> <#dataset-authorites> a tdb2:DatasetTDB ;
>>>>>    tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
>>>>> <#dataset-bib> a tdb2:DatasetTDB ;
>>>>>    tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
>>>>> <#dataset-dnb-all> a tdb2:DatasetTDB ;
>>>>>    tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
>>>>> <#dataset-zdb> a tdb2:DatasetTDB ;
>>>>>    tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
>>>>>
>>>>> When I start Fuseki, I get the following error message:
>>>>>
>>>>> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root
>>>> file:///home/svensson/apache-jena-fuseki-
>>>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that
>> is a
>>>> subclass of ja:Object
>>>>> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context
>>>> o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki
>>>> Server,/,file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/webapp/,UNAVAILABLE}
>>>>> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root
>>>> file:///home/svensson/apache-jena-fuseki-
>>>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that
>> is a
>>>> subclass of ja:Object
>>>>> doing:
>>>>>    root: file:///home/svensson/apache-jena-fuseki-
>>>> 3.10.0/run/configuration/service1.ttl#dnb with type:
>>>> http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
>>>> org.apache.jena.sparql.core.assembler.DatasetAssembler
>>>>>
>>>>> Have I missed something obvious?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Lars
>>>
> 

RE: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by "Svensson, Lars" <L....@dnb.de>.
On Wednesday, January 16, 2019 5:02 PM, ajs6f [mailto:ajs6f@apache.org] wrote:

> Yes, the approach that Andy suggested in an email earlier today (use _one_ TDB2
> instance, load your graphs into different named graphs in it, and enable the "default
> graph = union graph" option) is the right choice.

OK, thanks for confirming this. What I haven't understood so far is how to load a set of n-triples into a named graph in a TDB2 dataset. Can you give any hints on that?

Thanks,

Lars
 
> > On Jan 16, 2019, at 10:50 AM, Svensson, Lars <L....@dnb.de> wrote:
> >
> > On Wednesday, January 16, 2019 4:17 PM, ajs6f [mailto:ajs6f@apache.org]
> wrote:
> >
> >> I'm not quite sure what's going on here. It looks like you are trying to load entire
> >> datasets as named graphs in another dataset, but that doesn't make any sense.
> >> Datasets contain graphs. You can't shove an entire dataset into a graph.
> >>
> >> Are you trying to extract a particular graph from each of these datasets to insert
> into
> >> another?
> >>
> >> Perhaps you can tell us a bit more about what you are trying to accomplish here,
> and
> >> we can help you find out how to do that.
> >
> > My use case is that I have some (fairly large) RDF files (in n-triples) that I want to
> expose through Fuseki.
> > The contents of each file must be in its own named graph.
> > I also want the default graph to be the union of all the named graphs.
> >
> > So far I have loaded each RDF file into its own TDB2 store, but if I understand you
> correctly that is the wrong approach...
> >
> > Thanks,
> >
> > Lars
> >
> >>> On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
> >>>
> >>> Greetings,
> >>>
> >>> I have several TDB2 datasets that I want to expose as named graphs and as a
> >> joint dataset. My basic idea is to have each TDB2 dataset as its own graph and
> then
> >> a joint dataset combining all graphs with the default graph being the union of all
> >> named graphs. My configuration is:
> >>>
> >>> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
> >>> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
> >>> @prefix :        <#> .
> >>>
> >>> <#service1> rdf:type fuseki:Service ;
> >>>   fuseki:name                     "/dnb" ;   # http://host:port/dnb
> >>>   fuseki:serviceQuery             "query" ;    # SPARQL query service
> >>>   fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
> >> (read only)
> >>>   fuseki:dataset           <#dnb> ;
> >>>   .
> >>>
> >>> <#dnb> a ja:RDFDataset ;
> >>>   tdb2:unionDefaultGraph true ;
> >>>   ja:namedGraph [
> >>>       ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
> >>>       ja:graph <#authorities>
> >>>   ];
> >>>   ja:namedGraph [
> >>>       ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
> >>>       ja:graph <#bib>
> >>>   ];
> >>>   ja:namedGraph [
> >>>       ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
> >>>       ja:graph <#dnb-all>
> >>>   ];
> >>>   ja:namedGraph [
> >>>       ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
> >>>       ja:graph <#zdb>
> >>>   ];
> >>>   .
> >>> <#authorities> a tdb2:GraphTDB ;
> >>>   tdb2:dataset <#dataset-authorities> .
> >>> <#bib> a tdb2:GraphTDB ;
> >>>   tdb2:dataset <#dataset-bib> .
> >>> <#dnb-all> a tdb2:GraphTDB ;
> >>>   tdb2:dataset <#dataset-dnb-all> .
> >>> <#zdb> a tdb2:GraphTDB ;
> >>>   tdb2:dataset <#dataset-zdb> .
> >>>
> >>> <#dataset-authorites> a tdb2:DatasetTDB ;
> >>>   tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
> >>> <#dataset-bib> a tdb2:DatasetTDB ;
> >>>   tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
> >>> <#dataset-dnb-all> a tdb2:DatasetTDB ;
> >>>   tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
> >>> <#dataset-zdb> a tdb2:DatasetTDB ;
> >>>   tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
> >>>
> >>> When I start Fuseki, I get the following error message:
> >>>
> >>> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root
> >> file:///home/svensson/apache-jena-fuseki-
> >> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that
> is a
> >> subclass of ja:Object
> >>> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context
> >> o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki
> >> Server,/,file:///home/svensson/apache-jena-fuseki-
> 3.10.0/webapp/,UNAVAILABLE}
> >>> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root
> >> file:///home/svensson/apache-jena-fuseki-
> >> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that
> is a
> >> subclass of ja:Object
> >>> doing:
> >>>   root: file:///home/svensson/apache-jena-fuseki-
> >> 3.10.0/run/configuration/service1.ttl#dnb with type:
> >> http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
> >> org.apache.jena.sparql.core.assembler.DatasetAssembler
> >>>
> >>> Have I missed something obvious?
> >>>
> >>> Thanks in advance,
> >>>
> >>> Lars
> >


Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by ajs6f <aj...@apache.org>.
Yes, the approach that Andy suggested in an email earlier today (use _one_ TDB2 instance, load your graphs into different named graphs in it, and enable the "default graph = union graph" option) is the right choice.

ajs6f

> On Jan 16, 2019, at 10:50 AM, Svensson, Lars <L....@dnb.de> wrote:
> 
> On Wednesday, January 16, 2019 4:17 PM, ajs6f [mailto:ajs6f@apache.org] wrote:
> 
>> I'm not quite sure what's going on here. It looks like you are trying to load entire
>> datasets as named graphs in another dataset, but that doesn't make any sense.
>> Datasets contain graphs. You can't shove an entire dataset into a graph.
>> 
>> Are you trying to extract a particular graph from each of these datasets to insert into
>> another?
>> 
>> Perhaps you can tell us a bit more about what you are trying to accomplish here, and
>> we can help you find out how to do that.
> 
> My use case is that I have some (fairly large) RDF files (in n-triples) that I want to expose through Fuseki.
> The contents of each file must be in its own named graph.
> I also want the default graph to be the union of all the named graphs.
> 
> So far I have loaded each RDF file into its own TDB2 store, but if I understand you correctly that is the wrong approach...
> 
> Thanks,
> 
> Lars
> 
>>> On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
>>> 
>>> Greetings,
>>> 
>>> I have several TDB2 datasets that I want to expose as named graphs and as a
>> joint dataset. My basic idea is to have each TDB2 dataset as its own graph and then
>> a joint dataset combining all graphs with the default graph being the union of all
>> named graphs. My configuration is:
>>> 
>>> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
>>> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
>>> @prefix :        <#> .
>>> 
>>> <#service1> rdf:type fuseki:Service ;
>>>   fuseki:name                     "/dnb" ;   # http://host:port/dnb
>>>   fuseki:serviceQuery             "query" ;    # SPARQL query service
>>>   fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
>> (read only)
>>>   fuseki:dataset           <#dnb> ;
>>>   .
>>> 
>>> <#dnb> a ja:RDFDataset ;
>>>   tdb2:unionDefaultGraph true ;
>>>   ja:namedGraph [
>>>       ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
>>>       ja:graph <#authorities>
>>>   ];
>>>   ja:namedGraph [
>>>       ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
>>>       ja:graph <#bib>
>>>   ];
>>>   ja:namedGraph [
>>>       ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
>>>       ja:graph <#dnb-all>
>>>   ];
>>>   ja:namedGraph [
>>>       ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
>>>       ja:graph <#zdb>
>>>   ];
>>>   .
>>> <#authorities> a tdb2:GraphTDB ;
>>>   tdb2:dataset <#dataset-authorities> .
>>> <#bib> a tdb2:GraphTDB ;
>>>   tdb2:dataset <#dataset-bib> .
>>> <#dnb-all> a tdb2:GraphTDB ;
>>>   tdb2:dataset <#dataset-dnb-all> .
>>> <#zdb> a tdb2:GraphTDB ;
>>>   tdb2:dataset <#dataset-zdb> .
>>> 
>>> <#dataset-authorites> a tdb2:DatasetTDB ;
>>>   tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
>>> <#dataset-bib> a tdb2:DatasetTDB ;
>>>   tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
>>> <#dataset-dnb-all> a tdb2:DatasetTDB ;
>>>   tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
>>> <#dataset-zdb> a tdb2:DatasetTDB ;
>>>   tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
>>> 
>>> When I start Fuseki, I get the following error message:
>>> 
>>> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root
>> file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
>> subclass of ja:Object
>>> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context
>> o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki
>> Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
>>> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root
>> file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
>> subclass of ja:Object
>>> doing:
>>>   root: file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#dnb with type:
>> http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
>> org.apache.jena.sparql.core.assembler.DatasetAssembler
>>> 
>>> Have I missed something obvious?
>>> 
>>> Thanks in advance,
>>> 
>>> Lars
> 


Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by Andy Seaborne <an...@apache.org>.

On 16/01/2019 15:50, Svensson, Lars wrote:
> On Wednesday, January 16, 2019 4:17 PM, ajs6f [mailto:ajs6f@apache.org] wrote:
> 
>> I'm not quite sure what's going on here. It looks like you are trying to load entire
>> datasets as named graphs in another dataset, but that doesn't make any sense.
>> Datasets contain graphs. You can't shove an entire dataset into a graph.
>>
>> Are you trying to extract a particular graph from each of these datasets to insert into
>> another?
>>
>> Perhaps you can tell us a bit more about what you are trying to accomplish here, and
>> we can help you find out how to do that.
> 
> My use case is that I have some (fairly large) RDF files (in n-triples) that I want to expose through Fuseki.
> The contents of each file must be in its own named graph.

Fine - each NG ina  database can be loaded separately.

> I also want the default graph to be the union of all the named graphs.
> 
> So far I have loaded each RDF file into its own TDB2 store, but if I understand you correctly that is the wrong approach...

Not wrong ... I wanted to understand the situation and see if a simpler 
setup meet your needs. In my example I put them all in one DB to get the 
union - the RDFDataset means that the visible dataset is those named 
graph and maybe some non-TDB2 ones.

     Andy

> 
> Thanks,
> 
> Lars
> 
>>> On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
>>>
>>> Greetings,
>>>
>>> I have several TDB2 datasets that I want to expose as named graphs and as a
>> joint dataset. My basic idea is to have each TDB2 dataset as its own graph and then
>> a joint dataset combining all graphs with the default graph being the union of all
>> named graphs. My configuration is:
>>>
>>> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
>>> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
>>> @prefix :        <#> .
>>>
>>> <#service1> rdf:type fuseki:Service ;
>>>     fuseki:name                     "/dnb" ;   # http://host:port/dnb
>>>     fuseki:serviceQuery             "query" ;    # SPARQL query service
>>>     fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
>> (read only)
>>>     fuseki:dataset           <#dnb> ;
>>>     .
>>>
>>> <#dnb> a ja:RDFDataset ;
>>>     tdb2:unionDefaultGraph true ;
>>>     ja:namedGraph [
>>>         ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
>>>         ja:graph <#authorities>
>>>     ];
>>>     ja:namedGraph [
>>>         ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
>>>         ja:graph <#bib>
>>>     ];
>>>     ja:namedGraph [
>>>         ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
>>>         ja:graph <#dnb-all>
>>>     ];
>>>     ja:namedGraph [
>>>         ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
>>>         ja:graph <#zdb>
>>>     ];
>>>     .
>>> <#authorities> a tdb2:GraphTDB ;
>>>     tdb2:dataset <#dataset-authorities> .
>>> <#bib> a tdb2:GraphTDB ;
>>>     tdb2:dataset <#dataset-bib> .
>>> <#dnb-all> a tdb2:GraphTDB ;
>>>     tdb2:dataset <#dataset-dnb-all> .
>>> <#zdb> a tdb2:GraphTDB ;
>>>     tdb2:dataset <#dataset-zdb> .
>>>
>>> <#dataset-authorites> a tdb2:DatasetTDB ;
>>>     tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
>>> <#dataset-bib> a tdb2:DatasetTDB ;
>>>     tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
>>> <#dataset-dnb-all> a tdb2:DatasetTDB ;
>>>     tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
>>> <#dataset-zdb> a tdb2:DatasetTDB ;
>>>     tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
>>>
>>> When I start Fuseki, I get the following error message:
>>>
>>> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root
>> file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
>> subclass of ja:Object
>>> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context
>> o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki
>> Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
>>> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root
>> file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
>> subclass of ja:Object
>>>   doing:
>>>     root: file:///home/svensson/apache-jena-fuseki-
>> 3.10.0/run/configuration/service1.ttl#dnb with type:
>> http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
>> org.apache.jena.sparql.core.assembler.DatasetAssembler
>>>
>>> Have I missed something obvious?
>>>
>>> Thanks in advance,
>>>
>>> Lars
> 

RE: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by "Svensson, Lars" <L....@dnb.de>.
On Wednesday, January 16, 2019 4:17 PM, ajs6f [mailto:ajs6f@apache.org] wrote:

> I'm not quite sure what's going on here. It looks like you are trying to load entire
> datasets as named graphs in another dataset, but that doesn't make any sense.
> Datasets contain graphs. You can't shove an entire dataset into a graph.
> 
> Are you trying to extract a particular graph from each of these datasets to insert into
> another?
> 
> Perhaps you can tell us a bit more about what you are trying to accomplish here, and
> we can help you find out how to do that.

My use case is that I have some (fairly large) RDF files (in n-triples) that I want to expose through Fuseki.
The contents of each file must be in its own named graph.
I also want the default graph to be the union of all the named graphs.

So far I have loaded each RDF file into its own TDB2 store, but if I understand you correctly that is the wrong approach...

Thanks,

Lars

> > On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
> >
> > Greetings,
> >
> > I have several TDB2 datasets that I want to expose as named graphs and as a
> joint dataset. My basic idea is to have each TDB2 dataset as its own graph and then
> a joint dataset combining all graphs with the default graph being the union of all
> named graphs. My configuration is:
> >
> > @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
> > @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
> > @prefix :        <#> .
> >
> > <#service1> rdf:type fuseki:Service ;
> >    fuseki:name                     "/dnb" ;   # http://host:port/dnb
> >    fuseki:serviceQuery             "query" ;    # SPARQL query service
> >    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol
> (read only)
> >    fuseki:dataset           <#dnb> ;
> >    .
> >
> > <#dnb> a ja:RDFDataset ;
> >    tdb2:unionDefaultGraph true ;
> >    ja:namedGraph [
> >        ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
> >        ja:graph <#authorities>
> >    ];
> >    ja:namedGraph [
> >        ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
> >        ja:graph <#bib>
> >    ];
> >    ja:namedGraph [
> >        ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
> >        ja:graph <#dnb-all>
> >    ];
> >    ja:namedGraph [
> >        ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
> >        ja:graph <#zdb>
> >    ];
> >    .
> > <#authorities> a tdb2:GraphTDB ;
> >    tdb2:dataset <#dataset-authorities> .
> > <#bib> a tdb2:GraphTDB ;
> >    tdb2:dataset <#dataset-bib> .
> > <#dnb-all> a tdb2:GraphTDB ;
> >    tdb2:dataset <#dataset-dnb-all> .
> > <#zdb> a tdb2:GraphTDB ;
> >    tdb2:dataset <#dataset-zdb> .
> >
> > <#dataset-authorites> a tdb2:DatasetTDB ;
> >    tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
> > <#dataset-bib> a tdb2:DatasetTDB ;
> >    tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
> > <#dataset-dnb-all> a tdb2:DatasetTDB ;
> >    tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
> > <#dataset-zdb> a tdb2:DatasetTDB ;
> >    tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
> >
> > When I start Fuseki, I get the following error message:
> >
> > [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root
> file:///home/svensson/apache-jena-fuseki-
> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
> subclass of ja:Object
> > [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context
> o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki
> Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
> > org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root
> file:///home/svensson/apache-jena-fuseki-
> 3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a
> subclass of ja:Object
> >  doing:
> >    root: file:///home/svensson/apache-jena-fuseki-
> 3.10.0/run/configuration/service1.ttl#dnb with type:
> http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class
> org.apache.jena.sparql.core.assembler.DatasetAssembler
> >
> > Have I missed something obvious?
> >
> > Thanks in advance,
> >
> > Lars


Re: How to configure Fuseki to work with several graphs as a joint dataset?

Posted by ajs6f <aj...@apache.org>.
I'm not quite sure what's going on here. It looks like you are trying to load entire datasets as named graphs in another dataset, but that doesn't make any sense. Datasets contain graphs. You can't shove an entire dataset into a graph.

Are you trying to extract a particular graph from each of these datasets to insert into another?

Perhaps you can tell us a bit more about what you are trying to accomplish here, and we can help you find out how to do that.

ajs6f

> On Jan 16, 2019, at 4:25 AM, Svensson, Lars <L....@dnb.de> wrote:
> 
> Greetings,
> 
> I have several TDB2 datasets that I want to expose as named graphs and as a joint dataset. My basic idea is to have each TDB2 dataset as its own graph and then a joint dataset combining all graphs with the default graph being the union of all named graphs. My configuration is:
> 
> @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 tdb2:     <http://jena.hpl.hp.com/2016/tdb#> .
> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
> @prefix :        <#> .
> 
> <#service1> rdf:type fuseki:Service ;
>    fuseki:name                     "/dnb" ;   # http://host:port/dnb
>    fuseki:serviceQuery             "query" ;    # SPARQL query service
>    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store protocol (read only)
>    fuseki:dataset           <#dnb> ;
>    .
> 
> <#dnb> a ja:RDFDataset ;
>    tdb2:unionDefaultGraph true ;
>    ja:namedGraph [
>        ja:graphName <https://d-nb.info/datasets/authorities#dataset> ;
>        ja:graph <#authorities>
>    ];
>    ja:namedGraph [
>        ja:graphName <https://d-nb.info/datasets/bib#dataset> ;
>        ja:graph <#bib>
>    ];
>    ja:namedGraph [
>        ja:graphName <https://d-nb.info/datasets/dnb-all#dataset> ;
>        ja:graph <#dnb-all>
>    ];
>    ja:namedGraph [
>        ja:graphName <https://d-nb.info/datasets/zdb#dataset> ;
>        ja:graph <#zdb>
>    ];
>    .
> <#authorities> a tdb2:GraphTDB ;
>    tdb2:dataset <#dataset-authorities> .
> <#bib> a tdb2:GraphTDB ;
>    tdb2:dataset <#dataset-bib> .
> <#dnb-all> a tdb2:GraphTDB ;
>    tdb2:dataset <#dataset-dnb-all> .
> <#zdb> a tdb2:GraphTDB ;
>    tdb2:dataset <#dataset-zdb> .
> 
> <#dataset-authorites> a tdb2:DatasetTDB ;
>    tdb2:location "/home/svensson/fuseki-data/dnb/authorities/" .
> <#dataset-bib> a tdb2:DatasetTDB ;
>    tdb2:location "/home/svensson/fuseki-data/dnb/bib/" .
> <#dataset-dnb-all> a tdb2:DatasetTDB ;
>    tdb2:location "/home/svensson/fuseki-data/dnb/dnb-all/" .
> <#dataset-zdb> a tdb2:DatasetTDB ;
>    tdb2:location "/home/svensson/fuseki-data/dnb/zdb/" .
> 
> When I start Fuseki, I get the following error message:
> 
> [2019-01-15 11:14:13] Server     ERROR Exception in initialization: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
> [2019-01-15 11:14:13] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@46044faa{Apache Jena Fuseki Server,/,file:///home/svensson/apache-jena-fuseki-3.10.0/webapp/,UNAVAILABLE}
> org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#authorities has no most specific type that is a subclass of ja:Object
>  doing:
>    root: file:///home/svensson/apache-jena-fuseki-3.10.0/run/configuration/service1.ttl#dnb with type: http://jena.hpl.hp.com/2005/11/Assembler#RDFDataset assembler class: class org.apache.jena.sparql.core.assembler.DatasetAssembler
> 
> Have I missed something obvious?
> 
> Thanks in advance,
> 
> Lars