Decide about syntax extensions
With 3.0 on the horizon, it would be a good moment to ponder about the syntax extensions Tracker gained in the past. Those may be found in https://gitlab.gnome.org/GNOME/tracker/blob/master/src/libtracker-data/tracker-sparql.c by searching for "TRACKER EXTENSION".
I think those can be classified in 4 groups:
- Slightly different syntax. Most usually gained as the previous sparql parser was developed sometime between sparql1.0 and 1.1, so those represent either old syntax, or some from unfinished working documents. IMHO the main benefit of dropping those is readability, examples:
- Tracker makes ';' separator between inserts/deletes/updates optional. Given delete/insert are sometimes part of a single statement, this makes the resulting parse expression tree less unequivocal too.
- Tracker makes parentheses in eg.
SELECT (?u as ?a) (?x as ?b) ...
andORDER BY (?a - ?b) (?c * ?d)
optional.
-
INSERT OR REPLACE
as a whole. This is the sole user oftracker_data_update_statement*
, accounting for roughly a third of the code in tracker-data-update.c. That on itself is not bad, but IMODELETE {} INSERT {} WHERE {}
is a more versatile replacement. - INSERT/DELETE allow
SILENT
keyword. The circumstances in which they can be rightfully ignored are pretty narrow, and it's always possible to pass a NULL error. - Expressions can be subqueries. This multiplies the places where we can step into a subquery, it has some implicit semantics that are probably easy to foresee (eg. the subselect must return a single column, for it to fit as a expression), but has other that are not as clear (eg. propagation of variables' values from the parent query).
I'm not saying they all should go, but we should see which do bring something of value, and ponder what to do with the others.