1. 31 Mar, 2020 2 commits
  2. 15 Mar, 2020 9 commits
  3. 10 Mar, 2020 3 commits
    • Sam Thursfield's avatar
      Merge branch 'wip/carlosg/ttl-parser' into 'master' · 44ffa944
      Sam Thursfield authored
      Rewrite TTL parser
      
      See merge request !201
      44ffa944
    • Carlos Garnacho's avatar
      libtracker-data: Drop old parser code · b73a08a0
      Carlos Garnacho authored
      This is (at last!) no longer used anywhere.
      b73a08a0
    • Carlos Garnacho's avatar
      libtracker-data: Rewrite TrackerTurtleReader to reuse parser grammar · eec2b522
      Carlos Garnacho authored
      Instead of tapping on the old TrackerSparqlScanner, use the grammar
      definitions from the new parser. Also rewrite it in C.
      
      This allows us to drop a whole bunch of the older parser code, which
      only stood there to parse TTL files efficiently. The new SPARQL parser
      code is designed to generate an intermediate expression tree, which is
      great to increase liberty at the time of interpreting it, but not so great
      at the time of deserializing randomly sized blobs of TTL data.
      
      Even though this new TTL parser doesn't 100% use the infrastructure of
      the new SPARQL parser, it taps on it for the essentials (parsing the
      subject/predicate/object terminals), and also allows incremental TTL
      loading without memory peaks. The advantages of the old TTL parser
      (and the only reason why it stuck) are now moot.
      eec2b522
  4. 09 Mar, 2020 1 commit
  5. 08 Mar, 2020 6 commits
  6. 07 Mar, 2020 4 commits
    • Carlos Garnacho's avatar
      bd01f6c2
    • Carlos Garnacho's avatar
      libtracker-data: Fix MINUS support · e731282d
      Carlos Garnacho authored
      We used to implement MINUS through sqlite's EXCEPT, which requires
      SELECTS on both sides of the operation to have the same variables in
      the same order.
      
      This restriction is a bit inconvenient to us, since we need to cater
      for full/partial/empty variable set matching. It is not feasible to
      make all combinations go through the EXCEPT restrictions.
      
      Instead, make MINUS use SQLite row values syntax feature
      (https://sqlite.org/rowvalue.html), in order to match full and partial
      variable set matches the same way.
      
      The use of EXCEPT is now relegated to situations where variables on left
      and right side do not intersect (e.g. { ?a ?b ?c } MINUS { ?x ?y ?x }),
      and purely out of convenience.
      
      It is worth noting that variables only defined on the right hand side
      do not propagate outside of it (eg. cannot be queried in the upper SELECT).
      
      Closes: #190
      e731282d
    • Carlos Garnacho's avatar
      build: Bump SQLite dependency to 3.15.0 · b75c1374
      Carlos Garnacho authored
      This version (released on Oct 2016) added support for "row values"
      (https://sqlite.org/rowvalue.html), which will be used for our MINUS
      support, and possibly in other places of our SQL generation.
      b75c1374
    • Carlos Garnacho's avatar
      libtracker-data: Shuffle and rename function · 8229da03
      Carlos Garnacho authored
      We want this used on MINUS support, in addition to UNION. Rename
      the function, and move it a little bit upwards so we don't have to
      declare it.
      8229da03
  7. 06 Mar, 2020 2 commits
  8. 05 Mar, 2020 1 commit
  9. 04 Mar, 2020 11 commits
    • Carlos Garnacho's avatar
      libtracker-data: Drop always-true statement · bd07941f
      Carlos Garnacho authored
      In IRIREF we check for a specific set of unicode chars, between them
      there's the condition:
      
        !(ch >= 0x00 && ch <= 0x20)
      
      Where coverity complains that ch >= 0x00 is always true (as ch is
      unsigned). This is indeed true, so the condition can be expressed as:
      
        !(ch <= 0x20)
      
      or simplified as:
      
        ch > 0x20
      
      CID: #1491434
      bd07941f
    • Carlos Garnacho's avatar
      libtracker-data: Ensure variable is freed on error conditions · 57a863f7
      Carlos Garnacho authored
      It may be leaked on errors
      
      CID: #1491436
      57a863f7
    • Carlos Garnacho's avatar
      libtracker-fts: Remove dead check · 99eb08c7
      Carlos Garnacho authored
      With all FTS functions now checking for errors immediately after, this
      stray return code check is pointless.
      99eb08c7
    • Carlos Garnacho's avatar
      libtracker-data: Ensure an error is set · d6a65188
      Carlos Garnacho authored
      If we fail to parse the DBus URI for SERVICE{}, we would bail out
      without an error, even though it's used for warnings. Ensure we
      have an error for that case.
      
      CID: #1491444
      d6a65188
    • Carlos Garnacho's avatar
      libtracker-data: Apply silent treatment to the correct error · c6499034
      Carlos Garnacho authored
      In the case of our custom INSERT/DELETE SILENT, we want to ignore
      errors resulting from the insertion/removal of those quads (i.e.
      parser errors are still fatal). This failed because 1) we'd return
      early anyway if apply_quad() errored out and 2) inner_error was
      left unset.
      
      Pass the inner error and handle 'silent' right after apply_quad(),
      as it's expected of it.
      
      Spotted as "Logically dead code" by coverity.
      
      CID: #1491439
      c6499034
    • Carlos Garnacho's avatar
      libtracker-data: Drop dead call · ea3fbecf
      Carlos Garnacho authored
      This call returns something which is unchecked, we can just remove
      it.
      ea3fbecf
    • Carlos Garnacho's avatar
      libtracker-data: Propagate possible errors from resource_buffer_switch() · e39a475e
      Carlos Garnacho authored
      This function may implicitly create graphs, and its creation might fail.
      Propagate those errors upwards for the cases where it's called.
      
      CID: #1491435
      e39a475e
    • Carlos Garnacho's avatar
      libtracker-data: Add _optional() to complement _accept() · f44a37d7
      Carlos Garnacho authored
      We sometimes do _accept() on things without checking the return value as
      those are optional tokens, we want to advance to the next node if it was
      there, and stay where we are if it isn't.
      
      Using _accept() for that is just fine, but trips Coverity as the return
      value sometimes go unchecked as opposed to another myriad times.
      
      Add an _optional() function so that it's evident to the reader, and static
      analysis.
      
      CIDs: #1491433, #1491438, #1491440, #1491442, #1491443, #1491445
      f44a37d7
    • Carlos Garnacho's avatar
      Merge branch 'sam/cli-uninstalled-fixes' into 'master' · 925082b0
      Carlos Garnacho authored
      Add initial tests for the CLI
      
      See merge request !187
      925082b0
    • Carlos Garnacho's avatar
      libtracker-data: Make parser check more assertive · d478d391
      Carlos Garnacho authored
      Besides the standard:
        'SELECT' '(' Expression 'AS' Var ')'
      we support the non-standard:
        'SELECT' Expression 'AS' Var
      
      And tried to handle both in the same piece of code. The incongruence
      was that we would use _accept(')') on both, in order to catch the
      former, but still go through silently on the latter.
      
      Change this code so it's clearer that we do _expect() the closing
      parens in the first case. This is merely reassuring as the parser tree
      generation stage would catch the real syntax error, but makes code
      more in line with the actual intent.
      d478d391
    • Carlos Garnacho's avatar
      libtracker-data: Remove dead variable · e0e55feb
      Carlos Garnacho authored
      The uri_id_map variable was set up and propagated all through data
      manager initialization, to no avail lately since it was only set
      whenever the database was rebuild from the journal.
      
      What it did was caching the URI->ID for the rdfs:Classes in the ontology
      so those would be preserved as is when replaying the journal, those
      ended up in the internal TrackerClass structs used in various lookups.
      
      The journal no longer exists, we no longer rebuild the database using
      old data as a template, and the ontology loading code guarantees
      new IDs are generated for newly created classes and properties (eg.
      in ontology update situations). It seems this variable can just go.
      
      Fixes a coverity warning about this variable being dead.
      
      CID: #1491441
      e0e55feb
  10. 03 Mar, 2020 1 commit