Aklakan commented on issue #2883:
URL: https://github.com/apache/jena/issues/2883#issuecomment-2527919893

   I added the query to the PR but it was not failing before.
   The issue seems to be related to NOT EXISTS.
   
   I found more strange things going on:
   
   ```java
       @Test
       public void testExists08a() {
           String queryStr = """
               SELECT * {
                 FILTER NOT EXISTS { SELECT * { ?s a ?t } LIMIT 2 }
               }
               """;
           Query inputQuery = QueryFactory.create(queryStr);
           Op op = Algebra.compile(inputQuery);
   
           System.out.println("Original Op: " + op);
           // Output looks OK to me:
           // (filter (notexists
           //            (slice _ 2
           //              (bgp (triple ?s 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?t))))
           //   (table unit))
   
           Query queryFromOriginalOp = OpAsQuery.asQuery(op);
   
           System.out.println("Query from original op: " + 
queryFromOriginalOp);        
           // Output looks OK to me:
           // SELECT  * WHERE { {  }
           //   FILTER NOT EXISTS { SELECT  * WHERE { ?s  a  ?t } LIMIT   2 } }
   
           Op parsedOp = SSE.parseOp(op.toString());
           Query queryFromParsedOp = OpAsQuery.asQuery(parsedOp);
           // Output looks OK to me:
           // (filter (notexists
           //            (slice _ 2
           //              (bgp (triple ?s 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?t))))
           //   (table unit))
   
           System.out.println("Query from parsed op: " + queryFromParsedOp);
           // Now there is a warning and the SLICE 2 got lost
           // WARN  ElementTransformer :: Attempt to transform a null element - 
ignored
           // Query from parsed op: SELECT  *
           // WHERE
           //   { {  }
           //     FILTER NOT EXISTS { ?s  a  ?t }
           //   }
       }
   ```
   :open_mouth: 
   
   So something seems to break with the Op/Element duality in `ExprFunctionOp`.


-- 
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