After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761171 - [sparql] AS followed by nonvar allowed
[sparql] AS followed by nonvar allowed
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: tracker-general
tracker-general
Depends on:
Blocks:
 
 
Reported: 2016-01-27 11:50 UTC by Marinus Schraal
Modified: 2017-07-19 15:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sparql disallow deprecated AS formatting (737 bytes, patch)
2016-01-27 11:50 UTC, Marinus Schraal
none Details | Review
correct as handling (934 bytes, patch)
2016-01-27 12:27 UTC, Marinus Schraal
reviewed Details | Review

Description Marinus Schraal 2016-01-27 11:50:02 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.
Comment 1 Marinus Schraal 2016-01-27 12:27:51 UTC
Created attachment 319816 [details] [review]
correct as handling

last patch was broken
Comment 2 Carlos Garnacho 2016-03-27 18:01:42 UTC
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 :).
Comment 3 Marinus Schraal 2017-07-19 15:19:06 UTC
I see this got fixed with https://git.gnome.org/browse/tracker/commit/?id=7b6d8509613275bbb8d3715c050e875de8513aaf in 1.99.1.