afs commented on issue #1381:
URL: https://github.com/apache/jena/issues/1381#issuecomment-1159075302

   I have just found that property functions have to be explicitly enabled 
whereas custom functions do not which is why functions work and property 
functions don't in the test case.
   
   Custom functions are part of SPARQL.
   Property functions are an ARQ feature.
   
   
https://github.com/apache/jena/blob/ebb8b1202177c0dd74f88f808359497a38e8daf6/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/TransformPropertyFunction.java#L54
   
   The DatasetGraphWrapper case merges in ARQ.getContext which has this set.
   `new Context()` does not.
   
   Try this with and without the `cxt.put`:
   ```
       private static Context testContext(int id) {
           Context cxt = new Context() {
               @Override
               public String toString() {
                   return "TestContext#" + id;
               }
           };
           cxt.put(ARQ.enablePropertyFunctions, true); 
           return cxt;
       }
   ```
   That said, the defaults are confusing and silly.
   
   It can be `isTrueOrUndef` in `TransformPropertyFunction`.
   `strictMode` turns property functions off explicitly so the system default 
behaviour does not need to be "off".
   
   It took me a long time to see why even my minimal case based on your test 
case (thank you!) wasn't working.
   
   Sorry for all the trouble.
   


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