The reason why I would like to be able to do this, instead of merging one 
dataset into another, is simply because the two datasets come from different 
origins.

With an overlap of named graphs?



On 12/06/2019 15:31, Laura Morales wrote:
 From the Java side, there is UnionDatasetGraph, which would be able to give 
you a view over two datasets, but I'm not sure we ever wrote an assembler for 
that. I don't see one in the codebase, although it shouldn't be too hard. There 
are DatasetDescriptionAssembler and UnionModelAssembler and you might be able 
to cobble something together from them.

Changing Jena/Fuseki Java source code is way above what I'm capable of doing. 
Reading the documentation, I might assemble an ja:RDFDataset but does it 
support any property like tdb:unionDefaultGraph?

     <#dataset> rdf:type ja:RDFDataset ;
         tdb:unionDefaultGraph true ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
No - tdb: applies to DatasetTDB.
         ja:namedGraph
             [ ja:graphName <http://example.org/name1> ;
               ja:graph     <#graph1> ] ;
         ja:namedGraph
             [ ja:graphName <http://example.org/name2> ;
               ja:graph     <#graph2> ] ;
         .

     <#graph1> rdf:type tdb:GraphTDB ;
         tdb:location "DB-1" ;
         .

     <#graph2> rdf:type tdb:GraphTDB ;
         tdb:location "DB-2" ;
         .

Union the models. This gets the cardinality right. (Not trivially cheap though)

More like (untried ATM):

# General dataset, default model.
<#dataset> rdf:type ja:RDFDataset;
   ja:graph <#all> ;
   .

# Union model.
<#all> a ja:UnionModel ;
   ja:subModel <#graph1> ;
   ja:subModel <#graph2> ;
   .


<#graph1> rdf:type tdb:GraphTDB ;
    tdb:dataset <#tdb1> ;
    ## NB graph name.
    tdb:graphName <urn:x-arq:UnionGraph> ;
    .

<#graph2>  rdf:type tdb:GraphTDB ;
    tdb:dataset <#tdb2> ;
    tdb:graphName <urn:x-arq:UnionGraph> ;
    .

<#tdb1> rdf:type      tdb:DatasetTDB ;
    tdb:location "DB1" ;
   .

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

Reply via email to