These ones were the SPARQL engine :)
Fixed in:
https://github.com/RDFLib/rdflib/commit/25cf484d017ef1c3b2277722cc2ea314a69b7dd3
and
https://github.com/RDFLib/rdflib/commit/5cd53fa35e105881ccd6f8a2f2ca615d4b9c3d38
> I'm using forks of rdflib and rdflib-sparql with minor changes (reflecting earlier reports):
I've added the fix for str keys to FrozenDict.
Note that for rdflib 4 we will roll the sparql engine back into core,
so I've fixed everything in the "reunification" branch of rdflib now:
https://github.com/RDFLib/rdflib/tree/reunification
details below.
>
> (1) ASK { :s1 :p1 ?value . FILTER ( str(xsd:integer(?value)) ) }
The problem was that the STR builtin did not propegate errors, instead
it just made a string out of the error message.
>
> and
>
> (2) SELECT * WHERE
> {
> ?s a :test .
> OPTIONAL { ?s rdfs:label ?label }
> OPTIONAL { filter(!bound(?label)) BIND(str(?s) as ?label) }
> }
This one was trickier. There was a bug in the algebra generation - the
BIND didn't see the value of ?s
It was a bug, in the process of fixing I also came of the perhaps
clearer query :
SELECT ?s (COALESCE(?reallabel, ?genlabel) AS ?label) WHERE
{
?s a :test .
BIND(str(?s) as ?label)
OPTIONAL { ?s rdfs:label ?reallabel }
}
Your query also works, although only with the second optional (the
?label from the first optional is not visible when the second is
executed, this may also be a bug :)
--
http://gromgull.net