summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add a bunch of property path testswip/carlosg/property-pathsCarlos Garnacho2018-12-2625-0/+56
| | | | | Alternative, recursive, optional paths are tested, and combinations of those.
* libtracker-data: Implement alternative path sequencesCarlos Garnacho2018-12-261-5/+47
| | | | | | | | | The alternative path operator '|' allows multiplexing the ways to get a value. For example: { ?u nie:title|nfo:fileName 'foo' } will return elements whose title or filename matches the given string.
* libtracker-data: Implement PathModCarlos Garnacho2018-12-261-1/+59
| | | | | | | | | | All three modifiers in PathMod are implemented now: - ?(zero or one): { ?u nfo:belongsToContainer? ?c } returns direct children of ?c, plus ?c itself. - *(zero or more): { ?u nfo:belongsToContainer* ?c } returns all children of ?c recursively, including ?c itself. - +(one or more): { ?u nfo:belongsToContainer+ ?c } returns all children of ?c recursively.
* libtracker-data: Handle current path operators through WITH clauseCarlos Garnacho2018-12-263-67/+364
| | | | | | | | | | | | | | | | | | | | | | | | Using the WITH clause is already a pre-requisite for * and + operators (as those queries need to be recursive). It then struck me that using it for all path operators is simpler and easier to read both in code and SQL, for starters: - We were going long ways to invert the processing order of VerbPath and ObjectList, so the latter would be handled within the former. This was necessary so we could eg. invert subject and object in ^. - Each property path element results in a rather simple SELECT in the WITH clause, and nesting those comes off naturally. This is handy as a property path is actually an expression tree, which we weren't handling that well. As a first step, add this infrastructure for property paths using the WITH clause and use it for the currently supported operators. We still fall through the usual code paths (no subqueries in WITH clause) if the property path is formed of a single literal with no operators (i.e. the good old "?s foo:bar ?o" case). This is still necessary for fts:match (which is not really a property, thus can't be used in property paths) and rdfs:domain special casing (which just applies if the predicate is a variable, not the case with property paths).
* tests: Shutdown data manager in tracker-sparql-testCarlos Garnacho2018-12-261-0/+2
| | | | | The TrackerDataManagers were not properly shutdown, thus leaking memory and FDs. Adding more tests makes the latter noticeable.
* tests: Ensure ordering in property path testsCarlos Garnacho2018-12-263-3/+3
| | | | So we don't implicitly rely on the query/implementation underneath.
* libtracker-data: Gracefully exclude NULL subject/pred/object from resultsetCarlos Garnacho2018-12-261-3/+17
| | | | | | | | This is mentioned in the spec, and was correctly handled in the previous parser (although the comment mentioned text from a similar restriction with CONSTRUCT). Solutions with unbound variables should simply be ignored, this was kinda the case but just detected through g_return_if_fail() later on.
* Update Greek translationEfstathios Iosifidis2018-12-201-489/+502
|
* Merge branch 'azzaronea/tracker-fix-memory-leaks-tt2sgml' into HEADSam Thursfield2018-12-194-18/+26
|\ | | | | | | See: https://gitlab.gnome.org/GNOME/tracker/merge_requests/44/commits
| * tt2sgml: Fix memory leaks and memory corruptionsAndrea Azzarone2018-12-184-18/+26
| | | | | | | | Fixes: https://gitlab.gnome.org/GNOME/tracker/issues/66
* | Update POTFILES.inPiotr Drąg2018-12-181-3/+3
| |
* | libtracker-data: Update FTS if base tables were alteredCarlos Garnacho2018-12-181-2/+2
| | | | | | | | | | | | | | That will issue an update of all tables, so the FTS view might be affected. This is not caught by ontology change tests, as this is a situation that can only happen when migrating from 1.x databases ATM.
* | tests: Add tests for ontology changes involving FTSCarlos Garnacho2018-12-1813-0/+296
| | | | | | | | | | | | | | | | | | | | So we can catch things going wrong in FTS table updates. The added steps check: - Addition of new FTS properties - Unrelated modification of tables affected by the FTS view - Cardinality changes in existing FTS properties - Deleting FTS properties
* | libtracker-data: Reset property table name on cardinality changesCarlos Garnacho2018-12-181-0/+1
| | | | | | | | | | | | | | This value is cached, but may change during database initialization, making the TrackerProperty point to an incorrect table. The test update in the following commit reproduces this situation, and would fail without this in place.
* | tests: Use random location for tracker-ontology-change test dataCarlos Garnacho2018-12-181-13/+2
| | | | | | | | | | So we don't possibly fail when opening an stale database from previous runs.
* | tests: Drop code to "delete the database" in ontology-change testsCarlos Garnacho2018-12-181-27/+0
|/ | | | | | | | | | | This presumably was made to actually test ontology changes through rebuilding from the journal. The catch is that it was made to look into the wrong directory, so in essence we are testing live ontology updates. Such test might be added to tracker-db-journal-test, and only if journal is enabled. It is not a situation that will be triggered nowadays, and it is preferable to keep the current actual behavior of the test, so just delete this code to make it clearer.
* Merge branch 'jbicha/tracker-reproducible-basename' into HEADSam Thursfield2018-12-188-8/+8
|\ | | | | | | See: https://gitlab.gnome.org/GNOME/tracker/merge_requests/41
| * Use basename instead of filename for reproducibilityChris Lamb2018-12-058-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | We don't need to store the full path build filename in comments in the header files. This change was recommended by the Reproducible Builds project. https://reproducible-builds.org/ https://bugs.debian.org/915503
* | Merge branch 'azzaronea/tracker-use-dbus-run-session' into HEADSam Thursfield2018-12-182-10/+2
|\ \ | | | | | | | | | See: https://gitlab.gnome.org/GNOME/tracker/merge_requests/42
| * | tests: Use dbus-run-session instead of dbus-launchAndrea Azzarone2018-12-132-10/+2
| |/ | | | | | | Fixes: https://gitlab.gnome.org/GNOME/tracker/issues/62
* | Merge branch 'azzaronea/tracker-test-gschema' into HEADSam Thursfield2018-12-1814-28/+51
|\ \ | | | | | | | | | See: https://gitlab.gnome.org/GNOME/tracker/merge_requests/43
| * | tests: compile gschemas in the build dirAndrea Azzarone2018-12-1714-28/+51
| |/ | | | | | | | | | | | | | | | | Allow running tests without the need to install the gsettings schemas. This commit moves all the gschemas in the data directory and compiles them in the build directory. Tests that require gschemas need to be launched with the proper GSETTINGS_SCHEMA_DIR env variable. Fixes: https://gitlab.gnome.org/GNOME/tracker/issues/60
* | Replace Bugzilla by Gitlab URL in DOAP fileAndre Klapper2018-12-151-1/+1
|/
* Updated Spanish translationDaniel Mustieles2018-12-041-497/+503
|
* Added Slovenian translationMatej Urbančič2018-12-021-28/+30
|
* functional-tests: Require Bash for test runnerSam Thursfield2018-11-241-1/+1
| | | | | | | We need to clean up on errors. There isn't a 'standard' way to do this, so this script needs to explicitly depend on Bash. Fixes https://gitlab.gnome.org/GNOME/tracker-miners/issues/42
* libtracker-data: Tell TrackerPredicateVariable to return graph if neededCarlos Garnacho2018-11-171-0/+3
| | | | | | | | | This got lost in the new parser, fixes a tracker-writeback query involving variables in graph and predicate. Pointed out by Sam Thursfield on https://gitlab.gnome.org/GNOME/tracker-miners/merge_requests/27#note_367289 Enabling the return_graph variable, we create the appropriate column and the "no such column: predicate1.graph" error goes away.
* Merge branch 'wip/carlosg/fix-tracker-search'Carlos Garnacho2018-11-174-1/+67
|\
| * tests: Add test for coalesce behavior with URNswip/carlosg/fix-tracker-searchCarlos Garnacho2018-11-173-0/+3
| |
| * libtracker-data: Convert coalesced elements to stringCarlos Garnacho2018-11-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dropping that possibly fixes coalescing of URNs and datetimes with other types transparently handled by SQLite. Eg. this broke the "tracker search" CLI subcommand, where it uses: SELECT COALESCE(nie:url(?u), ?u) ... This resulted in "tracker search foo" returning "(null)" as the file uri/urn. We must translate each Expression to string so that correctly results in the URL string being coalesced with the URN string. This is the expected result, and a regression compared to the older parser.
| * libtracker-data: Convert arguments to string in string functionsCarlos Garnacho2018-11-171-1/+40
| | | | | | | | | | | | | | | | This results in eg. URN strings or ISO8601 dates being passed to those if used in one such function, instead of ROWIDs or timestamps. It's unclear how that should behave as per the spec, this is however what the old parser did, so better to stick to the same implementation defined behavior.
| * libtracker-data: Add builtin way to convert a Expression to a stringCarlos Garnacho2018-11-171-0/+20
|/ | | | | | | The Expression element may be used in several places (eg. ArgList or ExpressionList in functions) that may require them to be converted to string, add a builtin toggle in the state so this can ben done easily.
* tests: Add test for resource to string casts in select argumentsCarlos Garnacho2018-11-173-0/+3
|
* tests: Add test for ORDER BY an undefined variableCarlos Garnacho2018-11-173-0/+14
|
* libtracker-data: Do not force cursor column types to be stringsCarlos Garnacho2018-11-171-3/+1
| | | | | | | | We must propagate the original types, despite converting the resultset to string in the topmost select. Fixes warnings in the bus backend (seen with several flatpak apps), since it's not as lenient as the direct one wrt fetching values with the "wrong" vfunc.
* libtracker-bus: Make error clearerCarlos Garnacho2018-11-171-1/+7
| | | | | | | | The data != null check in get_string() really happens because of fetching values on a finished or not yet started cursor, so make it clearer to reason about. This is of course a programming error.
* libtracker-bus: Make cursor conform to API docsCarlos Garnacho2018-11-171-1/+6
| | | | | It says "NULL is returned if column is not between [0,n_columns]", says nothing about it being a programming error though.
* libtracker-data: Ensure conversion to string in topmost SELECTCarlos Garnacho2018-11-151-1/+3
| | | | | | We were missing it in the "SELECT ?a AS ?b ..." case, breaking those types that require a conversion to string when exposed through a cursor (resource, and presumably date/datetime).
* libtracker-data: Fix crash on unbound variables in ORDER BYCarlos Garnacho2018-11-151-1/+2
| | | | | | | Unbound variables are unexpected/meaningless here, the spec says nothing about raising errors though, and other SPARQL engines seem to agree about it being a no-op. So just go with it and avoid the crash.
* Merge branch 'wip/carlosg/issue-56'Carlos Garnacho2018-11-140-0/+0
|\
| * libtracker-data: Also set up blank node map on InsertDatawip/carlosg/issue-56Carlos Garnacho2018-11-131-0/+14
| | | | | | | | | | | | | | The blank node map must be set up there, both for the URN storage aspect and the GVariant generation one. Closes: https://gitlab.gnome.org/GNOME/tracker/issues/56
* | libtracker-data: Also set up blank node map on InsertDataCarlos Garnacho2018-11-131-0/+14
|/ | | | | The blank node map must be set up there, both for the URN storage aspect and the GVariant generation one.
* libtracker-data: Always set up blank node map on InsertClauseCarlos Garnacho2018-11-131-4/+5
| | | | | | | | Commit c58f7aa419 late in wip/carlosg/sparql-parser-ng wrongly made this dependent on the query being an update_blank() one (i.e. we need to generate a GVariant with blank node results to give back). This actually defeated the path where we generate unique URNs for blank nodes on inserts, resulting in simple urns like <1> being generated.
* libtracker-data: Perform caseless comparisonCarlos Garnacho2018-11-131-1/+1
| | | | | | The SPARQL protocol is supposedly case insensitive, and TrackerResource uses "TRUE"/"FALSE" for boolean strings. We must use caseless comparion or we get false negatives.
* fooCarlos Garnacho2018-11-131-1/+1
|
* tracker: Fix search subcommandCarlos Garnacho2018-11-131-2/+2
| | | | | The SPARQL was referring to a non-existent variable, which older parser used to ignore.
* Release 2.2.0-alpha12.2.0-alpha1Carlos Garnacho2018-11-131-0/+20
|
* Merge branch 'wip/carlosg/automatic-store-shutdown'Carlos Garnacho2018-11-137-92/+105
|\
| * tracker-store: Automatically shutdown on inactivitywip/carlosg/automatic-store-shutdownCarlos Garnacho2018-11-132-11/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the right conditions apply, tracker-store will shut down after 30s of inactivity (no clients doing updates/selects). Bringing it back again is relatively cheap, so let's see how this flies. For the cases it won't, tracker-store has a --disable-shutdown switch (also useful for testing from terminal), also running on other buses than the session one will disable it, since both shutting down and later restart pose questions and risks. In theory, this will make tracker-store disappear 99% of the time, since database updates are sparse. There's also the possibility of clients running with TRACKER_SPARQL_BACKEND=bus or resorting to bus connection (eg. flatpak apps), that will make selects go through tracker-store.
| * libtracker-miner: Drop pause/resume on tracker-store name availabilityCarlos Garnacho2018-11-131-68/+0
| | | | | | | | | | This no longer makes sense with tracker-store automatic shutdown, assume the activatable through DBus and keep the miner running in that situation.