I've tried this option too using the following configuration

fuseki:dataset [
    a ja:RDFDataset;

    ja:defaultGraph [
        a ja:UnionModel ;

        ja:subModel [
            a tdb2:GraphTDB2 ;
            tdb2:dataset [
                a tdb2:DatasetTDB2 ;
                tdb2:location "location1"
            ]
        ] ;

        ja:subModel [
            a tdb2:GraphTDB2 ;
            tdb2:dataset [
                a tdb2:DatasetTDB2 ;
                tdb2:location "location2"
            ]
        ] ;
    ]
]


but it always gives me "transaction error" with any query. I've tried TDB 1 
instead, but it gives me a different error:

ERROR Server          :: Exception in initialization: the (group) Assembler 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup@b73433 
cannot construct the object [...] [ja:subModel of [...] [ja:defaultGraph of 
[...] ]] because it does not have an implementation for the objects's most 
specific type ja:Model

I've found a couple of old threads online with people reporting "MultiUnion" as 
working, but I don't know how to use this configuration. I couldn't find it on 
the Fuseki documentation and simply replacing ja:UnionModel for 
ja:MultiUnionModel doesn't make any difference for me.
Do you know anything about this MultiUnion and if it could work?




> Sent: Friday, November 17, 2023 at 8:47 PM
> From: "Andy Seaborne" <a...@apache.org>
> To: users@jena.apache.org
> Subject: Re: Implicit default-graph-uri
>
>
>
> On 16/11/2023 11:35, Laura Morales wrote:
> > I would like to configure Fuseki such that I can use 2 datasets from 2 
> > different locations, as if they were a single dataset.
> > This is my config.ttl:
> >
> >
> > <#> a fuseki:Service ;
> >
> >      fuseki:endpoint [
> >          fuseki:operation fuseki:query
> >      ] ;
> >
> >      fuseki:dataset [
> >          a ja:RDFDataset ;
> >
> >          ja:namedGraph [
> >              ja:graphName :graph1 ;
> >              ja:graph [
> >                  a tdb2:GraphTDB ;
> >                  tdb2:location "location-1" ;
> >              ]
> >          ] ;
> >
> >          ja:namedGraph [
> >              ja:graphName :graph2 ;
> >              ja:graph [
> >                  a tdb2:GraphTDB ;
> >                  tdb2:location "location-2" ;
> >              ]
> >          ] ;
> >      ] .
> >
> >
> > There is no particular reason why I used this configuration; I mostly 
> > copied it from the Fuseki documentation. If it can be simplified, please 
> > suggest how.
> >
> > I query Fuseki with 
> > "/service/query/?default-graph-uri=urn:x-arq:UnionGraph". I also know that 
> > I can use "SELECT FROM <urn:x-arq:UnionGraph>". But I would like to know if 
> > I can configure this behavior as the default in the main configuration 
> > file, such that I can avoid using "x-arq:UnionGraph" entirely.
> > Both datasets are TDB2 and contain triples only in the default unnamed 
> > graph (in other words do not contain any named graph inside).
>
> I can't find a way to do that.
>
> tdb2:unionDefaultGraph applies to a single datasets and you have two
> datasets.
>
> Using
>    ja:defaultGraph [
>          a ja:Model;
>          ja:subModel ...
>          ja:subModel ...
>      ] ;
>
> falls foul of transaction coordination across two different models (even
> if they are views of the same database).
>
> I though that would work - there is some attempt to extend transactions
> into graph but this seems to be pushing things too far.
>
>      Andy
>

Reply via email to