Re: [Tracker] Help: Can I remove data by condition "some field is empty"?
- From: Martyn Russell <martyn lanedo com>
- To: "Zhang, Jingke" <jingke zhang intel com>
- Cc: "Guo, Zhaojuan" <zhaojuan guo intel com>, "tracker-list gnome org" <tracker-list gnome org>
- Subject: Re: [Tracker] Help: Can I remove data by condition "some field is empty"?
- Date: Wed, 10 Nov 2010 10:52:09 +0000
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]