GNOME Bugzilla – Bug 761171
[sparql] AS followed by nonvar allowed
Last modified: 2017-07-19 15:19:06 UTC
Created attachment 319812 [details] [review] sparql disallow deprecated AS formatting Following the investigation in bug #761168 , it turns out tracker allows non-spec weirdness when it comes to the AS statement. Currently gnome-music (and possible others) are using 'AS varname' a lot, while it really should be 'AS ?varname'. In the case of music this lead to problems with dash '-' being allowed in 'varname' but not in '?varname'. Other sparql statements don't allow 'varname', so it's all very ambiguous. As far as I can tell the 'AS' statement got introduced in sparql 1.1 and was always of the form 'AS ?var', so I am not sure why the source mentions backwards compatibility as reason for allowing it. Attached a patch to bite the bullet and remove the ambiguity. Also there are some other 'deprecated' statements in the same source file, might need to have a look at those as well.
Created attachment 319816 [details] [review] correct as handling last patch was broken
Comment on attachment 319816 [details] [review] correct as handling Looks good, but not sure it can't go as is yet. The reason for "AS foo" is that it was added to Tracker before sparql 1.1 formalized on "AS ?foo", and at the time it was defined there were already backwards compatibility concerns, the same than there are now. I think we should warn but accept this syntax for at least a cycle before biting the bullet, and probably it should be made clear that this is something to be solved in the app, not tracker :).
I see this got fixed with https://git.gnome.org/browse/tracker/commit/?id=7b6d8509613275bbb8d3715c050e875de8513aaf in 1.99.1.