Re: [Tracker] Help: Can I remove data by condition "some field is empty"?



On 11/11/10 01:30, Zhang, Jingke wrote:
Hi Martyn,
     Thank you for your kindly help. I try sparql language:
Tracker-sparql -u --query="DELETE { ?a a nco:PersonContact } WHERE { ?a nco:fullname ?name .FILTER ( NOT 
EXISTS { ?name } ) }"

It shows me: Could not run update, 1.94: syntax error, expected non-empty property list

I feel it is near to success, but is there any syntax error in my command? Thank you for more help! :)

You can query with this:

tracker-sparql -q "select ?urn where { ?urn a nco:Contact . FILTER ( NOT
EXISTS { ?urn nco:fullname ?name } ) }"

This works for me:

tracker-sparql -u -q "delete { ?urn a nco:PersonContact } where { ?urn a
nco:PersonContact . FILTER ( NOT EXISTS { ?urn nco:fullname ?name } ) }"

Note, the query shows that there are 2 contacts (which are added for
you) as presets for:


http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me

http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me-emergency

So you probably shouldn't be removing those if that's what you're doing.
In such cases, you can probably add to the filter by making sure those
two are not removed.

Hope this helps,

-- 
Regards,
Martyn



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