|
In the answer to this question here, using SPARQL 1.1, I wanted to bind a new variable based on the value of an existing one. Specifically, I had calculated an ID for the day of the week such that 0 = Sunday, 1 = Monday, 2 = Tuesday, etc. Based on the binding for Essentially, I want to code some traditional "cases" structure into SPARQL. Factoring out the day ID calculation for brevity (here hardcoded as Sunday), I tried:
Expecting to get So, concrete questions:
|
|
Here's what I know. That query wouldn't run at all against Virtuoso so I simplified the query slightly and set up a test case against a Jena in-memory model
This test case fails on the assertTrue() so that means no solutions are coming back. I do get results if I (1) remove the FILTER or (2) write the following for the FILTER
so I guess that FILTER and BINDINGS don't work together in Jena the way you and I would expect them to. Perhaps this is a bug in Jena or perhaps we're not reading the SPARQL 1.1 spec correctly. Note in a case like this, you can always write the old if-then-else ladder...
Thanks for the details. It seems from @neumarcx's answer that the query works as we would expect in newer versions of Joseki, which tends to suggest that it's a bug with the implementations. I really can't see any reason why it wouldn't work wrt. the spec (unless maybe there was an issue with the |
|
Looks like your runtime sets ?dayIDCheck but doesn't bind it. The query works just fine in my run-time environment and executes as expected. You mean a bug in the endpoint? Cool! What SPARQL engine is lotico running? 1
we run a couple of different engines but for production we have use ARQ on joseki 3.4.4 For the new stuff we play with fuseki, and virtuoso is pretty cool as well. we will also take look at stardog soon. |

