You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by GitBox <gi...@apache.org> on 2022/06/17 17:06:31 UTC
[GitHub] [jena] afs commented on issue #1381: [Bug]: a property function is not invoked while processing QueryExecution created by QueryExecutionDatasetBuilder
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: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org