1. 21 Nov, 2021 1 commit
  2. 15 Nov, 2021 3 commits
  3. 14 Nov, 2021 4 commits
    • Carlos Garnacho's avatar
      libtracker-sparql: Deprecate tracker_namespace_manager_get_default() · 30775a19
      Carlos Garnacho authored
      Since we have tracker_sparql_connection_get_namespace_manager() and allow
      different ontologies in TrackerSparqlConnection, this is now the recommended
      way to deal with namespaces, even if Nepomuk ones.
      
      TrackerResource still needs to use this namespace to honor the default
      behavior when passing a NULL namespaces object in tracker_resource_print_*(),
      so reduce the required version there to avoid deprecation warnings when
      building Tracker itself.
      
      Fixes: #271
      30775a19
    • Carlos Garnacho's avatar
      portal: Move away from tracker_namespaces_manager_get_default() · 9e7a83fd
      Carlos Garnacho authored
      This kludge is no longer necessary with the bus TrackerSparqlConnection
      implementing get_namespace_manager(). We can ask the connection being
      forwarded about its own namespaces now.
      9e7a83fd
    • Carlos Garnacho's avatar
      libtracker-sparql: Seal TrackerNamespaceManagers belonging to a connection · c43c9e1d
      Carlos Garnacho authored
      This is a slight API break, but one that is a) unused to my knowledge, and
      b) prone to introduce further brokenness if misused. Since any namespace
      added this way is still not part of the ontology, it could only be used to
      produce RDF that cannot be consumed later on.
      
      Also, there's the implicit assumption that TrackerSparqlConnection is
      multithread-aware, but this object would potentially break if it ends up
      used and modified from different threads.
      
      So, make tracker_namespace_manager_add_prefix() reserved for namespaces
      created through tracker_namespace_manager_new(), and make those coming from
      tracker_sparql_connection_get_namespace_manager() immutable.
      c43c9e1d
    • Carlos Garnacho's avatar
      libtracker-sparql: Add public TrackerNamespaceManager method to compress URIs · 4f288f48
      Carlos Garnacho authored
      It's sometimes also useful (mostly, printing purposes) to compress full URIs
      into a $prefix:$suffix form. Add the missing TrackerNamespaceManager method
      to help do that.
      4f288f48
  4. 13 Nov, 2021 3 commits
  5. 11 Nov, 2021 5 commits
  6. 09 Nov, 2021 1 commit
  7. 08 Nov, 2021 1 commit
    • Carlos Garnacho's avatar
      libtracker-sparql: Handle query cancellation on TrackerEndpointDBus · 5883cebf
      Carlos Garnacho authored
      Since the cursor contents are handed via a pipe FD, detect the situation
      where the other end of the pipe gets closed (say, client died or cancelled
      the operation) and cancel the DBus service side operation as well.
      
      This avoids these operations from finishing to completion if they are
      going nowhere. Now that each pending query request gets its own cancellable,
      ensure these are also cancelled on TrackerEndpointDBus finalization.
      
      Fixes: #264
      5883cebf
  8. 07 Nov, 2021 6 commits
    • Sam Thursfield's avatar
      Merge branch 'wip/carlosg/zero-or-more-fix' into 'master' · 64cfa033
      Sam Thursfield authored
      libtracker-sparql: Fix actual 0-path matches in ? and * path operators
      
      Closes #337
      
      See merge request !472
      64cfa033
    • Carlos Garnacho's avatar
      libtracker-data: Hint access cost of "triples" virtual table usage · 4a08ea0f
      Carlos Garnacho authored
      We are not giving this information back to SQLite in the virtual table
      xBestIndex method, so it is left to choose the best strategy to access
      the "triples" table without further information, which might come out
      wrong.
      
      Hint SQLite about the estimated cost of accessing this table with the
      suggested index, so that it always makes the best choice (this happened
      to be the case at the time of doing
      tracker-miners!334, but
      seemed to regress substantially at some point).
      
      Accessing the "triples" table works best by providing multiple columns
      to match of graph/subject/predicate, so the combination of all values
      must get the lowest estimated cost. Likewise, having no columns to match
      represents the worst estimated cost. These columns are weighted though,
      as providing each of those represents a different reduction in the
      amount of disk accesses necessary to return the requested data. These
      weights are away by orders of magnitude, in order to ensure SQLite is
      strongly hinted of the preference order.
      
      Providing this estimated cost, we can trust that SQLite will use the
      best choice available. This should significantly improve (back again)
      performance when using the "triples" table in some situations.
      "tracker3 info <file>" is one of those, and a rather popular one.
      4a08ea0f
    • Carlos Garnacho's avatar
      tests: Add tests for +/? property path operator finding 0-length results · 10046872
      Carlos Garnacho authored
      These should also bring back the 0-length result even if there are no further
      results.
      10046872
    • Carlos Garnacho's avatar
      libtracker-sparql: Fix actual 0-path matches in ? and * path operators · ad0f8ab4
      Carlos Garnacho authored
      These operators ("zero or one" and "zero or more" respectively) so far have
      worked on the prerequisite that the contained property path has at least
      one match with the given constraints. E.g.:
      
        SELECT ?u { <URI> nie:interpretedAs? ?u }
      
      Would return no results if the given uri had no nie:interpretedAs, but here
      we still want to have the 0-length match, regardless of there being a match
      or not.
      
      This commit fixes this by making these common table expressions look for
      "self" in the rdfs:Resource table, this is ensured to always match as long
      as the resource exists.
      
      Fixes: #337
      ad0f8ab4
    • Sam Thursfield's avatar
      Merge branch 'wip/carlosg/new-error-codes' into 'master' · 7fac3729
      Sam Thursfield authored
      libtracker-sparql: Add specific error code for missing nrl:lastModified and incomplete properties
      
      See merge request !467
      7fac3729
    • Sam Thursfield's avatar
      Merge branch 'wip/carlosg/statement-from-resource' into 'master' · a84c5bbc
      Sam Thursfield authored
      [RFC] libtracker-sparql: Add method to create statement from a resource file
      
      See merge request !455
      a84c5bbc
  9. 06 Nov, 2021 2 commits
    • Carlos Garnacho's avatar
      tests: Add tests for loading statements from resources · 074c37c2
      Carlos Garnacho authored
      Include most tests in a GResource, and run those from there in addition
      to the tracker_sparql_connection_query_statement() API, so we additionally
      test loading from resources.
      074c37c2
    • Carlos Garnacho's avatar
      libtracker-sparql: Add method to create statement from a resource file · 3e9e17ad
      Carlos Garnacho authored
      This TrackerSparqlConnection method creates a TrackerSparqlStatement from
      a query located in a resource path. This could allow a better code/model
      separation where all Tracker resources are separately editable in the
      source tree (e.g. distinct per-query .rq files, with syntax highlighting,
      etc), and still directly available at runtime without further disk reads.
      
      There's other nice side effects of this, like having queries nicely
      indented in logging output (instead of the usual string concatenation in
      code that makes queries alright to see in the source code, but a mess when
      logged), or avoiding hard to follow code changes (e.g. mass reindenting)
      when only query changes are required. Also, queries would be easily
      readable with the "gresource list/extract" command line tool without
      looking across the source code.
      3e9e17ad
  10. 05 Nov, 2021 1 commit
  11. 30 Oct, 2021 1 commit
  12. 25 Oct, 2021 1 commit
  13. 24 Oct, 2021 1 commit
  14. 23 Oct, 2021 10 commits