Thank you Adrien, Martyn and Philip! Most of my questions are solved :)
2011/3/30 Philip Van Hoof <[email protected]>: > On Wed, 2011-03-30 at 18:02 +0900, simon hong wrote: >> 2011/3/28 Adrien Bustany <[email protected]> > >> > I guess you can use the tracker:modified or tracker:added properties here >> > (I'd recommend tracker:modified, but am not sure how it's defined for newly >> > saved resources). >> >> Now, I use "SELECT nie:url(?u) WHERE {?u a nfo:Audio}" to get audio files. >> I don't know how to use above properties (tracker:modified or >> tracker:added) for fetching newly added files. >> Can you give some advice how to make sparql query for my purpose? >> Or any documentation or guide for sparql will be appreciate. > > So for synchronization what you do is the following: > > SELECT MAX (tracker:modified (?r)) { ?r a rdfs:Resource } > > And you store the result > > Then next time you start your application, to get the newly added and > the changed resources you put that stored value in $stored and you do: > > SELECT ?r { ?r a nfo:Audio . > FILTER (tracker:modified (?r) > $stored) } > > Note that this is for nfo:Audio, but it works with any rdfs:Resource > >> > Note that instead of looping, you could also use the GraphUpdated signal to >> > get updates in real time. >> >> GraphUpdated signal is what I wanted ^^; It works well :) > > If GraphUpdated works for you, then indeed use that. > > Cheers, > > Philip > > > -- > > > Philip Van Hoof > freelance software developer > Codeminded BVBA - http://codeminded.be > > _______________________________________________ tracker-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/tracker-list
