Skip to content

libtracker-sparql/core: Use boolean getter for ASK query

During ontology updates, we ask our own database about changes in certain properties for our incompatible change checks. Specifically for nrl:InverseFunctionalProperty checks, we are using an ASK query to check for properties being such prior to the ontology updates.

However, we are using the internal get_int() cursor getter, whereas the result of an ASK query is either a boolean, or "true"/"false" strings, since it's internally provided as the latter, get_int() falls short and always returns 0.

Deal with this as a boolean using the high-level TrackerSparqlCursor API instead. This fixes the misdetection of changes about nrl:InverseFunctionalProperty properties during ontology updates, when possibly none was done.

While at it, shuffle a bit the code to propagate errors, and free the cursor on all situations.

Merge request reports