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

Andy Seaborne commented on JENA-1945:
-------------------------------------

Hi [~Aklakan] -- what's your use case for {{Algebra.unionDefaultGraph}}?

It's more than just {{OpPath}} that does not work properly.  BGPs that span 
graphs don;'t work either.

It looks like the code was an idea that didn't work out. 

All DatasetGraphs provide a {{DatasetGraph.getUnionGraph}} so a dataset that 
wrapper the base dataset with the union graph as the default graph will get the 
right answers.

> Algebra.unionDefaultGraph: OpPath not handled
> ---------------------------------------------
>
>                 Key: JENA-1945
>                 URL: https://issues.apache.org/jira/browse/JENA-1945
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ
>    Affects Versions: Jena 3.16.0
>            Reporter: Claus Stadler
>            Priority: Major
>
>  
> {code:java}
> System.out.println(
>   Algebra.unionDefaultGraph(
>     Algebra.compile(
>       QueryFactory.create("SELECT * { ?s <urn:p> ?o }"))));
> /* Yields correct result:
> (distinct
>   (graph ??_
>     (bgp (triple ?s <urn:p> ?o))))      
> */
> System.out.println(
>   Algebra.unionDefaultGraph(
>     Algebra.compile(
>       QueryFactory.create("SELECT * { ?s <urn:p1>/<urn:p2>/<urn:p3> ?o }"))));
> /* Yields incorrect result because wrapping with graph ??_ (and distinct) is 
> missing:
> (path ?s (seq (seq <urn:p1> <urn:p2>) <urn:p3>) ?o)
> */
> {code}
>  
> It seems 
> [TransformUnionQuery.java|https://github.com/apache/jena/blob/master/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformUnionQuery.java#L34]
>  lacks the handling of (at least) OpPath



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to