Skip to content

libtracker-data: Join SERVICE with triple patterns in arbitrary order

Carlos Garnacho requested to merge wip/carlosg/service-in-union-fix into master

There was one case left to fix in #248 (closed):

  SELECT ?urn {
      {
          SELECT ?urn {
              ?urn a nfo:DataContainer .
          }
      }
      UNION {
          SELECT ?urn {
              SERVICE <dbus:org.freedesktop.Tracker3.Miner.Files> {
                  SELECT ?urn  {
                      ?urn a nmm:Photo .
                  }
              }
              ?urn nie:isPartOf <urn:photo-album:test>
          }
      }
  }

Might result in the second SELECT matching ?urn as a string on the SERVICE side, and as a resource ID from the nie:isPartOf part.

We already handle joining with triple patterns the other way around (commit 14392fdb), so make sure we handle SERVICE graph patterns in that order within commutative operations.

Edited by Carlos Garnacho

Merge request reports