nkaralis commented on issue #2793:
URL: https://github.com/apache/jena/issues/2793#issuecomment-2536083968

   Hello. 
   
   I have been trying out some additional queries, including queries with 
nested GraphGraphPatterns, and have encountered some inconsistencies between 
fuseki and arq (both in version 5.2.0).
   
   The queries `q.rq` and `q2.rq` are executed against the dataset `data.trig`.
   ```
   # data.trig
   @prefix : <http://example.org/>
   
   :graph1 { :s1 :p1 :o1 . 
             :s1 :p2 :o2 . 
             :s1 :p3 :o3 . }
   :graph2 { :s1 :p1 :o1 .
             :s1 :p2 :o2 . }
   ```
   ```sparql
   # q.rq
   SELECT  * WHERE { 
       GRAPH ?g1
       { 
           { 
               SELECT  * WHERE { 
                   GRAPH ?g { ?s  ?p  ?o } 
               }
           }
       }
   }
   ```
   ```sparql
   # q2.rq
   SELECT * WHERE { 
       GRAPH ?g { VALUES ?s { <http://example.org/s1> } } 
   }
   ```
   Results for `q.rq`
   ```
   fuseki (note: `g1` is unbound)
   
   s,p,o,g,g1
   
http://example.org/s1,http://example.org/p1,http://example.org/o1,http://example.org/graph1,
   
http://example.org/s1,http://example.org/p1,http://example.org/o1,http://example.org/graph2,
   
http://example.org/s1,http://example.org/p2,http://example.org/o2,http://example.org/graph1,
   
http://example.org/s1,http://example.org/p2,http://example.org/o2,http://example.org/graph2,
   
http://example.org/s1,http://example.org/p3,http://example.org/o3,http://example.org/graph1,
   ```
   ```
   ./arq --explain --query=q.rq --data=data.trig 
   14:30:43 INFO  exec            :: QUERY
     SELECT  *
     WHERE
       { GRAPH ?g1
           { { SELECT  *
               WHERE
                 { GRAPH ?g
                     { ?s  ?p  ?o }
                 }
             }
           }
       }
   14:30:43 INFO  exec            :: ALGEBRA
     (graph ?g1
       (graph ?g
         (bgp (triple ?s ?p ?o))))
   14:30:43 INFO  exec            :: BGP ::   ?s ?p ?o
   14:30:43 INFO  exec            :: Reorder/generic ::   ?s ?p ?o
   14:30:43 INFO  exec            :: BGP ::   ?s ?p ?o
   14:30:43 INFO  exec            :: Reorder/generic ::   ?s ?p ?o
   14:30:43 INFO  exec            :: BGP ::   ?s ?p ?o
   14:30:43 INFO  exec            :: Reorder/generic ::   ?s ?p ?o
   14:30:43 INFO  exec            :: BGP ::   ?s ?p ?o
   14:30:43 INFO  exec            :: Reorder/generic ::   ?s ?p ?o
   
-------------------------------------------------------------------------------------------------------------------------------------------
   | s                       | p                       | o                      
 | g                           | g1                          |
   
===========================================================================================================================================
   | <http://example.org/s1> | <http://example.org/p1> | 
<http://example.org/o1> | <http://example.org/graph1> | 
<http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/p2> | 
<http://example.org/o2> | <http://example.org/graph1> | 
<http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/p3> | 
<http://example.org/o3> | <http://example.org/graph1> | 
<http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/p1> | 
<http://example.org/o1> | <http://example.org/graph2> | 
<http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/p2> | 
<http://example.org/o2> | <http://example.org/graph2> | 
<http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/p1> | 
<http://example.org/o1> | <http://example.org/graph1> | 
<http://example.org/graph2> |
   | <http://example.org/s1> | <http://example.org/p2> | 
<http://example.org/o2> | <http://example.org/graph1> | 
<http://example.org/graph2> |
   | <http://example.org/s1> | <http://example.org/p3> | 
<http://example.org/o3> | <http://example.org/graph1> | 
<http://example.org/graph2> |
   | <http://example.org/s1> | <http://example.org/p1> | 
<http://example.org/o1> | <http://example.org/graph2> | 
<http://example.org/graph2> |
   | <http://example.org/s1> | <http://example.org/p2> | 
<http://example.org/o2> | <http://example.org/graph2> | 
<http://example.org/graph2> |
   
-------------------------------------------------------------------------------------------------------------------------------------------
   ```
   Results for `q2.rq`
   ```
   fuseki
   
   s,g
   http://example.org/s1,
   ```
   ```
   ./arq --explain --query=q2.rq --data=data.trig
   14:53:59 INFO  exec            :: QUERY
     SELECT  *
     WHERE
       { GRAPH ?g
           { VALUES ?s { <http://example.org/s1> } }
       }
   14:53:59 INFO  exec            :: ALGEBRA
     (graph ?g
       (table (vars ?s)
         (row [?s <http://example.org/s1>])
       ))
   ---------------------------------------------------------
   | s                       | g                           |
   =========================================================
   | <http://example.org/s1> | <http://example.org/graph1> |
   | <http://example.org/s1> | <http://example.org/graph2> |
   ---------------------------------------------------------
   ```
   Based on the previous responses, the results returned from arq are correct 
for both queries, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to