arianpotter commented on issue #3223:
URL: https://github.com/apache/jena/issues/3223#issuecomment-2952873239

   Hi @afs 
   Sorry for the late response, and thank you for your reply!
   It is a bit hard since this is a complex and dynamic query builder software, 
but an example could be like this:
   Let's say we have a WhereBuilder called wb1 and it contains this where 
clause:
   WHERE{
      ?s ex:property ?o .
       BIND(?o AS ?var)
   }
   
   now, if I have another WhereBuilder called wb2 and it just contains 
something like:
   WHERE{
   ?subject ex:path ?anotherSubject
   }
   And I use the function that I mentioned, like: addFilterExists(wb2,wb1)
   And then if I again further in my program have another simple WhereBuilder, 
even without any bindings like :
   wb3 = 
   WHERE{
   ?person ex:knows ?anotherPerson
   }
   And then I want to call addFilterExists(wb3,wb2), I get the error that I 
mentioned in this line:  Expr notExistsExpr = new E_Exists(group);
   
   Based on what I understood so far, this is due to building the query (the 
line in the function that builds the innerBuilder)  and this gets added to 
another WhereBuilder (wb1 gets added to wb2) and then wb2 as the innerBuilder 
gets build again (when adding wb2 to wb3) and I get the error.
   
   For the time being, my workaround is not to have any bindings at all and 
save them all to get added at the very end after I build my WhereBuilder with 
all of the nested WhereBuilders in it.


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