[ 
https://issues.apache.org/jira/browse/JENA-1663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763153#comment-16763153
 ] 

Ashley Sommer commented on JENA-1663:
-------------------------------------

I guess the use case is a bit unusual, and maybe there is a better way to do it.

We have 4 RDF datasets, these datasets are created at different times, by 
different people, and converted to TDB2 using jena commandline tools. (One of 
them is actually an older dataset in TDB1 but I think that is irrelevant).

Each of those datasets is exposed as a different service, with its own SPARQL 
endpoint. Like:
 # Dataset ds1_tdb2 (on disk tdb2_1) exposed at /g1/sparql
 # Dataset ds2_tdb2 (on disk tdb2_2) exposed at /g2/sparql
 # Dataset ds3_tdb (on disk tdb_3) exposed at /g3/sparql
 # Dataset ds4_tdb2 (on disk tdb2_4) exposed at /g4/sparql

Additionally, we have another ja:RDFDataset with each of those graphs as named 
graphs:
{code}
 :all_dataset a ja:RDFDataset ;
     #ja:defaultGraph <urn:x-arq:UnionGraph> ;
     ja:namedGraph [
         ja:graphName <http://example.org/dataset/g1> ;
         ja:graph :g1
     ] ;
     ja:namedGraph [
         ja:graphName  <http://example.org/dataset/g2> ;
         ja:graph :g2
      ] ;
     ja:namedGraph [
         ja:graphName  <http://example.org/dataset/g3> ;
         ja:graph :g3
     ] ;
     ja:namedGraph [
         ja:graphName <http://example.org/dataset/g4> ;
         ja:graph :g4
    ] .
{code}
That works fine and as expected and we can query between the graphs using their 
named-graph representations in that dataset. However as you can see by the 
commented-out line there, we really want to have the ability to query that 
dataset as a union graph, when no named graph is given.
Unfortunately setting `ja:defaultGraph` to <urn:x-arq:UnionGraph> doesn't work, 
the config parser rejects it.

The only other way I can think of to achieve that functionality is to have a 
UnionModel with each of the graphs as subGraphs, then use that union model as 
the `ja:defaultGraph` of our `all_dataset`. That is how we arrive at the 
exception I've posted above. Simply being able to set  `ja:defaultGraph` to 
<urn:x-arq:UnionGraph> would probably be an easier fix and eliminate our need 
to use the UnionModel.

I understand the "more correct" or "intended" way of doing this is to use a 
single TDB2 dataset for everything and have them separated into NamedGraphs 
inside that dataset. That doesn't match our deployment procedure right now, but 
might have to be something we look into down the track if we can't get our 
current method working.

> ModelAssembler does not protect prefix manipulation with a transaction.
> -----------------------------------------------------------------------
>
>                 Key: JENA-1663
>                 URL: https://issues.apache.org/jira/browse/JENA-1663
>             Project: Apache Jena
>          Issue Type: Task
>          Components: Core
>    Affects Versions: Jena 3.10.0
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>            Priority: Minor
>             Fix For: Jena 3.11.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to