[Tracker] tracker-sparql -q QUERY shows results while exact same query via SPARQL C API doesn't



Hi,

is there anything wrong with this SPARQL query

  "SELECT ?url WHERE { ?f nie:url ?url . ?f nfo:fileName ?name .
FILTER(fn:starts-with(?url, 'file:///Volumes/test/') && regex(?name,
'unti')) }"

which would explain why tracker-sparql -q QUERY shows results:

frank$ tracker-sparql -q "SELECT ?url WHERE { ?f nie:url ?url . ?f
nfo:fileName ?name . FILTER(fn:starts-with(?url,
'file:///Volumes/test/') && regex(?name, 'unti')) }"
Ergebnisse:
  file:///Volumes/test/untitled%20text

...but the exact same query from a program [1] that uses the SPARQL C
API would give no result ?

I'm 100% sure it is the exact same query as I have a debug log
statement logging the query string it just a few lines before calling
tracker_sparql_connection_query():

  Oct 17 22:03:41.777237 afpd[27868] {spotlight_module.c:153}
(D5:Spotlight): sl_mod_start_search: SPARQL query:
  "SELECT ?url WHERE { ?f nie:url ?url . ?f nfo:fileName ?name .
FILTER(fn:starts-with(?url, 'file:///Volumes/test/') && regex(?name,
'test')) }"

Other SPARQL queries like

  "SELECT ?url WHERE { ?f nie:url ?url FILTER regex(?url, 'test')}"

work just fine from the program (and tracker-sparql). It seems as as
soon as I have FILTER expressions with more then one sub-expressions
(or more then one FILTER expression) I get this behaviour.

Unfortunately I can't seem to find a way to get Tracker to log debug
messages for the queries from the C program, the tracker-control
--set-log-verbosity=debug doesn't show me any query info at all (in
/root/.local/share/tracker/tracker-store.log).

I'm puzzled and would appreciate any pointers. Thanks!

Cheers!
-f


[1] <https://github.com/franklahm/Netatalk/blob/spotlight/etc/afpd/spotlight_module.c#L141>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]