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



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