-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
count(*) seems to break the SPARQLPLUSPARSER #63
Comments
Wow, how could that go unnoticed for so long... if ((list($sub_r, $sub_v) = $this->x('(*)', $v)) && $sub_r) { |
Hi @bnowack , no idea how that went on for so long ;) The fix sorta works in that it returns an array with "*" as a value in it, however it's not mapped to the key "value", which is called in the next line. It currently sits in the first value, making me think that it just gets there because of the preg_match function (index 1 = first match?) I'm not sure what I should change now, because the function x() is heavily used, so tinkering with it seems a big "nono". So probably something needs to be changed in the line where that "value" index is used? |
The $sub_r doesn't really make any sense there, to be honest. I've pushed a tweak, want to give it a try? |
That seems to do the trick yes ;). |
Unrelated to this issue, but not wanting to create another issue When retrieving triples from the arc2 store, it's basically an assoc. array. How does one serialize this into a turtle or other structures, or even better, put this back into a arc2 graph? I don't seem to find this in the documentation :). |
When you use a query that uses ?s ?p ?o (i.e. SELECT ?s ?p ?o WHERE ...) then you can use the result array ($queryResult['result']['rows']) as a typical ARC structure that can be serialized. |
Ah, that's what I initially thought but hadn't found the time yet to test it out. Thanks a bunch! |
Hi all,
Upon performing the following query:
select (count(*) AS ?count) WHERE { ?s ?p ?o }
The SPARQLPLUSPARSER break, and throws an error that it cannot find an column value with key 'value'. After further investigation, I've come to the line where this is thrown which is line 51 (ish) in the corresponding php file of SPARQLPLUSPARSER.
After some debugging, I couldn't find what went wrong, but the value key wasnt present. This made me try the following work around, inspired by the comment that stands above the if which was "* or var" :
Does anyone have an idea if this might break other things, I'm going to try some queries with this workaround, also non * selectors. In any case, I'll do a fork and do my queries through the fork. If this is a valid bug, and this (sorta) solves it. I'd be happy to provide a pull request.
The text was updated successfully, but these errors were encountered: