summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libtracker-sparql: Silence -Wformat-security warningwip/carlosg/sparql-parser-ngCarlos Garnacho2018-11-131-9/+9
| | | | | | Since we no longer pass the string directly, we must also avoid the escaping of the strftime format modifiers. Those aren't any longer at risk of being mistaken for printf ones.
* libtracker-sparql: Avoid implicitly relying on hashtable iteration orderCarlos Garnacho2018-11-131-12/+8
| | | | | | Recent GLib changed the hashtable hashing, thus changing the order in which the contents are iterated by a GHashTableIter. Avoid doing that in the one place we used to (also used to happen in previous vala code).
* tests: Add some tests for the supported property pathsCarlos Garnacho2018-11-1318-0/+99
| | | | Inverse and sequence paths are tested thus far.
* docs: Add references to TrackerSparqlStatementCarlos Garnacho2018-11-133-0/+27
|
* libtracker-data: Make unimplemented property path errors more specificCarlos Garnacho2018-11-131-4/+5
| | | | There's now partial support of property paths, so better be specific.
* libtracker-data: Support sequence property pathCarlos Garnacho2018-11-131-3/+24
| | | | | | "?a :foo/:bar ?b" is equivalent to "?a :foo ?gen . ?gen :bar ?b", make the parser make up those generated variables before processing the current predicate property.
* libtracker-data: Support inverse property pathCarlos Garnacho2018-11-131-1/+13
| | | | | "?a ^:foo ?b" is equivalent to "?b :foo ?a", invert the subject/predicate in order to handle this.
* libtracker-data: Prepare for property pathsCarlos Garnacho2018-11-131-17/+28
| | | | | | | Property paths may introduce intermediate anonymous resources, or shuffle subject/object. We still do the bulk of the job while parsing the predicate, so prepare for the predicate being pre-filled, and the Path grammar element to alter the next parsed token.
* tests: Add an FTS testCarlos Garnacho2018-11-133-1/+3
| | | | | This query form was broken in the previous parser, add a test for it now that it is supported.
* tests: Add more anonymous/blank nodes testsCarlos Garnacho2018-11-1319-0/+96
| | | | | Some of those combinations were broken in the previous parser, now that they are handled properly, add tests for them.
* libtracker-sparql-backend: Expose direct connection's query_statement()Carlos Garnacho2018-11-131-0/+10
| | | | | This should eventually be implemented in the bus backend as well, but not yet.
* libtracker-direct: Implement query_statement()Carlos Garnacho2018-11-135-0/+331
| | | | This uses an internal TrackerSparql to hold the query.
* libtracker-sparql: Add TrackerSparqlStatementCarlos Garnacho2018-11-134-0/+136
| | | | | This object can hold a long lived query, in which parameters may be changed prior to execution.
* libtracker-data: Support parameter bindingsCarlos Garnacho2018-11-136-20/+199
| | | | | Those relate to PARAMETERIZED_VAR, and allow binding values through it at query preparation time.
* libtracker-data: Add syntax support for parameterized variablesCarlos Garnacho2018-11-131-5/+33
| | | | | | These variables (with "~var" syntax) will be bound through API, providing a decent protection against injections. They can be used in every place a boolean/numeric/string literal is allowed.
* libtracker-data: Add tracker_db_interface_bind_valueCarlos Garnacho2018-11-132-0/+46
| | | | | This function takes a generic GValue, and uses the right sqlite3_bind* function underneath, or transforms to a string.
* libtracker-data: Drop old SPARQL parserCarlos Garnacho2018-11-134-4491/+0
|
* libtracker-data: Flip the TrackerSparql switchCarlos Garnacho2018-11-133-12/+15
| | | | From now on, TrackerSparql will be used for handling SPARQL queries.
* libtracker-data: Append literals directly past the variable limitCarlos Garnacho2018-11-131-3/+79
| | | | | | Once we are past the variable limit (Currently hardcoded to 999, matching SQLite limits) resort to appending literals in SQL directly. This used to happen in the older parser, and unbreaks 02-sparql-bugs which tests this.
* libtracker-data: Add back 'NULL' literal handling for INSERT OR REPLACECarlos Garnacho2018-11-132-1/+15
| | | | | This is a tracker extension that allows INSERT OR REPLACE to also delete values.
* libtracker-data: Fix handling of fn:string-joinCarlos Garnacho2018-11-132-1/+23
| | | | | | | In a quite unstandard way, this function takes the list of strings to join surrounded by parentheses, eg. fn:string-join(('a', 'b'), '|'). Handle this through allowing nesting of ArgList for this case, it will error out in every other case.
* libtracker-data: Preprocess \u and \U sequences in SPARQL queriesCarlos Garnacho2018-11-131-3/+5
|
* libtracker-common: Add helper function to escape \u and \U sequencesCarlos Garnacho2018-11-132-0/+91
|
* libtracker-data: Accept comma as GROUP_CONCAT separatorCarlos Garnacho2018-11-132-2/+33
| | | | This is a tracker extension present in previous SPARQL parser.
* libtracker-sparql: Use INSERT DATA on insertionsCarlos Garnacho2018-11-131-1/+1
|
* libtracker-data: Add "INSERT INTO iri" syntax backCarlos Garnacho2018-11-132-3/+17
| | | | This is a Tracker extension to SPARQL.
* libtracker-sparql: Allow non bracketted expressions in OrderClauseCarlos Garnacho2018-11-132-5/+12
| | | | This is a Tracker SPARQL extension present in the previous parser.
* libtracker-data: Add back support for DELETE{}/INSERT{} with no WHERE clauseCarlos Garnacho2018-11-132-6/+20
| | | | This is a Tracker extension to SPARQL.
* libtracker-data: Add INSERT/DELETE SILENT syntax backCarlos Garnacho2018-11-132-5/+22
| | | | This is a tracker extension to SPARQL.
* libtracker-data: Add 'INSERT OR REPLACE' SPARQL extension backCarlos Garnacho2018-11-132-1/+19
| | | | This is syntax traditionally allowed by Tracker.
* libtracker-data: Make ';' separator between updates optional againCarlos Garnacho2018-11-132-3/+11
| | | | This is a Tracker extension to the SPARQL1.1 syntax.
* libtracker-data: Add back support for SPARQL updatesCarlos Garnacho2018-11-131-45/+437
|
* libtracker-data: Add method to fetch unused URNsCarlos Garnacho2018-11-132-0/+36
|
* libtracker-data: Add internal UUID generator SQL functionCarlos Garnacho2018-11-135-0/+123
|
* libtracker-data: Expose TrackerSparql API for updatesCarlos Garnacho2018-11-132-0/+60
|
* libtracker-data: Invert processing of Verb and ObjectList clausesCarlos Garnacho2018-11-131-4/+19
| | | | | | For sequential property paths it will be more convenient to have the ObjectList node available before processing the property path, so we can explode those properly into intermediate blank nodes.
* libtracker-data: Implement MINUSCarlos Garnacho2018-11-131-1/+6
| | | | Use the equivalent EXCEPT sqlite syntax.
* libtracker-data: Implement SHA384Carlos Garnacho2018-11-132-1/+10
| | | | If glib >= 2.51.0 is available, we can implement this.
* libtracker-data: Accept Expression in BOUND()Carlos Garnacho2018-11-132-9/+6
| | | | This is a syntax extension we used to accept, so bring it back.
* libtracker-data: Bring back custom sparql syntaxCarlos Garnacho2018-11-132-2/+25
| | | | | Tracker used to accept SubSelect in BrackettedExpression, bring that back.
* libtracker-data: Bring back custom sparql syntaxCarlos Garnacho2018-11-132-17/+50
| | | | | Tracker used to accept plain Expression in SelectClause, i.e. no parentheses, and "AS ?var" being optional. Bring that back.
* libtracker-data: Make SparqlRegex() SQL function take 2/3 argumentsCarlos Garnacho2018-11-131-4/+6
| | | | So the sparql parser can defer optional arguments to it.
* libtracker-data: Add TrackerSparqlCarlos Garnacho2018-11-137-0/+7047
|
* libtracker-data: Add TrackerStringBuilderCarlos Garnacho2018-11-133-0/+352
| | | | | | | | This is somewhat similar to GString, except it allows for adding extension points at random places that allow for inserting stuff mid-string without relocating the whole thing. It is expected that SQL query construction will use this facility.
* libtracker-data: Add TrackerSparqlParser and helpersCarlos Garnacho2018-11-133-0/+927
| | | | | | | | | | | | | | | | This struct takes the query text and a root rule that will work as the starting point to generate the expression tree that represents the query. This expression tree has a virtually identical structure to the formed by the rules themselves, with the only difference that ?/+/* rules may have none or many nodes representing a single rule. The parser does not do anything beyond a syntactic interpretation of the query, the expression tree nodes contain a pointer to the rule that generated them, plus start/end points of the text in the query, so an upper layer can do the actual ontology validations, and generate the SQL. The two entry points are tracker_sparql_parse_query/update, that correspond to the QueryUnit/UpdateUnit entry points defined in the SPARQL grammar.
* libtracker-data: Add SPARQL grammar definitionCarlos Garnacho2018-11-131-0/+2267
| | | | | | The grammar rules are based on https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#sparqlGrammar and reflect all of the Sparql 1.1 syntax, supported by Tracker or not.
* Merge branch 'heftig/tracker-fix-soversion'Carlos Garnacho2018-11-134-1/+5
|\
| * build: Restore right soversion to librariesJan Alexander Steffens (heftig)2018-11-124-1/+5
| | | | | | | | | | | | | | The previous change did not leave the expected .0 symlinks. 'soversion' is the actual version linked against. To match the scheme used by libtool, we need to give the libraries a 'version' as well.
* | build: Export store/ontology/domain ontology locations in .pc fileCarlos Garnacho2018-11-132-0/+8
|/ | | | | | | Export those in tracker-sparql.pc, so users may find out the install details. Related: https://gitlab.gnome.org/GNOME/tracker-miners/issues/19
* Merge branch 'sam/test-runner-fix'Carlos Garnacho2018-11-121-1/+1
|\