Re: [Tracker] Some questions about tracker delete



Thanks, will try it later!
On what exact page did you see this example?
http://live.gnome.org/Tracker/Documentation/Writeback

-----Original Message-----
From: JÃrg Billeter [mailto:j bitron ch] 
Sent: Friday, June 11, 2010 6:08 PM
To: Zheng, Huan
Cc: tracker-list gnome org
Subject: Re: [Tracker] Some questions about tracker delete

Hi,

On Fri, 2010-06-11 at 14:53 +0800, Zheng, Huan wrote:
Hi, I have several questions regarding to DELETE capability inside
tracker. 

Seems tracker works well with INSERT, but not that well with DELETE.

 

1, I canât delete the nie:contentLastModified time which I manually
inserted before. The below function wonât work, but it is an example
in tracker wiki page

tracker-sparql -u -q " DELETE { ?f nie:contentLastModified ?unknown }
WHERE { ?f nie:url <file:///home/zbt/Videos/video/ball_444.jpg> } "

You need to use ?unknown in the graph pattern as well. The following
should work:

tracker-sparql -u -q "DELETE { ?f nie:contentLastModified ?unknown }
WHERE { ?f nie:url <file:///home/zbt/Videos/video/ball_444.jpg> ;
nie:contentLastModified ?unknown } "

On what exact page did you see this example?

2, I canât *completely* delete a tag that I inserted before, after
delete, only the nao:prefLabel is cleared.

INSERT works:

tracker-sparql -u -q "INSERT { _:tag a nao:Tag ; nao:prefLabel
'value' ; nao:identifier 'key' . ?object nao:hasTag _:tag } WHERE
{ ?object a nie:InformationElement . FILTER (str(?object) =
'urn:uuid:bc9feedf-89ce-b9ed-fdba-5300586651dd') }"

then DELETE:

tracker-sparql -u -q "DELETE {?tag a nao:Tag } WHERE {?object
nao:hasTag ?tag . ?tag nao:identifier 'key' . { SELECT ?object WHERE
{?object a nie:InformationElement . FILTER (str(?object) =
'urn:uuid:bc9feedf-89ce-b9ed-fdba-5300586651dd') } } }"

To completely delete the tag resource, use the following update:

tracker-sparql -u -q "DELETE {?tag a rdfs:Resource } WHERE {?object
nao:hasTag ?tag . ?tag nao:identifier 'key' . { SELECT ?object WHERE
{?object a nie:InformationElement . FILTER (str(?object) =
'urn:uuid:bc9feedf-89ce-b9ed-fdba-5300586651dd') } } }"


then QUERY:

tracker-sparql -q "SELECT nao:prefLabel(?tag)
nao:identifier(?tag) ?tag WHERE {?object a nie:InformationElement;
nao:hasTag ?tag . ?tag nao:identifier 'key' . FILTER (str(?object) =
'urn:uuid:bc9feedf-89ce-b9ed-fdba-5300586651dd')}"

For all of the above three queries, it should be possible to avoid the
FILTER and just directly <urn:uuid:bc9feedf-89ce-b9ed-fdba-5300586651dd>
instead of ?object, or am I missing something?

Regards,
JÃrg




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