This is the raw Spotlight query when searching for "text": kMDItemContentTypeTree=="public.text"&&(kMDItemContentType=="public.plain-text"||kMDItemFSName=="*txt"cdw||*=="text*"cdw||kMDItemTextContent=="text*"cdw) Our parser chokes because it doesn't know the attribute "kMDItemContentType". Patch to follow...
Eg $ ./bin/spotlight2sparql 'kMDItemContentTypeTree=="public.text"&&(kMDItemContentType=="public.plain-text"||kMDItemFSName=="*txt"cdw||*=="text*"cdw||kMDItemTextContent=="text*"cdw)' *mapping failed* $ But this works $ ./bin/spotlight2sparql 'kMDItemContentTypeTree=="public.plain-text"||kMDItemFSName=="*txt"cdw||*=="text*"cdw||kMDItemTextContent=="text*"cdw' SELECT ?url WHERE { { { ?obj nie:mimeType 'text/plain' } UNION { ?obj nfo:fileName ?a FILTER(regex(?a, '^.*txt$', 'i')) } } UNION { ?obj fts:match 'text*' } . ?obj nie:url ?url . FILTER(tracker:uri-is-descendant('file:///foo/bar/', ?url)) } $
Created attachment 12944 [details] Patch for 4.4, 4.5 and 4.6 cherry-picked from master
Re-assigning to Karolin for inclusion in 4.6.next, 4.5.next, 4.4.next.
(In reply to Jeremy Allison from comment #3) Pushed to autobuild-v4-{6,5,4}-test
(In reply to Karolin Seeger from comment #4) Pushed to all branches. Closing out bug report. Thanks!