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! :)

-----Original Message-----
From: Martyn Russell [mailto:[email protected]] 
Sent: Wednesday, November 10, 2010 6:52 PM
To: Zhang, Jingke
Cc: [email protected]; Guo, Zhaojuan
Subject: Re: [Tracker] Help: Can I remove data by condition "some field is 
empty"?

On 10/11/10 03:11, Zhang, Jingke wrote:
> Hi all,

Hi,

>      I am new here in tracker-list. When I search contact data, I found some 
> data with blank "nco:fullname". Then I try to remove them, but failed.
>      My tracker is 0.9.16. Can tracker support "remove data by blank value 
> condition"? Thanks!
> 
>      Detail steps:
>      ==========
>      # tracker-sparql -q "SELECT nco:fullname(?a) nco:nickname(?a) WHERE { ?a 
> a nco:PersonContact }"
>      Results: 3
>       ,
>       ,
>       ,
>      # tracker-sparql -u --query="DELETE { ?a a nco:PersonContact } WHERE { 
> ?a nco:fullname '' } "

You should be able to use the "NOT EXISTS" key words there for that,
something like,

  DELETE { ?a a nco:PersonContact } WHERE { ?a nco:fullname ?name .
FILTER ( NOT EXISTS  {?name} ) }"

(untested)

I was going to link to our documentation on this, but we don't have any,
but here is the official specification:

  http://www.w3.org/TR/2010/WD-sparql11-query-20101014/#func-filter-exists

-- 
Regards,
Martyn
_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to