Re: [Tracker] About getting ImageList from tracker



Hi Huan,

On Tue, May 18, 2010 at 12:09 PM, Zheng, Huan <huan zheng intel com> wrote:
 

Insert:

tracker-sparql -u -q " INSERT { <urn:uuid:image-albumA> a nmm:ImageList ; nie:identifier 'AlbumA' ; nie:keyword 'AlbumATitle' ; nfo:entryCounter 2 ; nfo:hasMediaFileListEntry [ a nfo:MediaFileListEntry; nfo:entryContent <urn:uuid:5ea315ca-54c1-dbdf-45f5-0865a41425fa>] ; nfo:hasMediaFileListEntry [a nfo:MediaFileListEntry; nfo:entryContent <urn:uuid:a35e2d11-5451-c912-bd2f-3e8303dfd4ef>]}"

*here comes the question*, I want to get the whole list of urls from nmm:ImageList, I tried the following, but can’t work

tracker-sparql -q "SELECT ?entry  WHERE { <urn:uuid:image-albumA> nfo:hasMediaFileListEntry ?entry . ?entry nfo:listPosition 1}"  *failed*

tracker-sparql -q "SELECT ?entry ?image ?position WHERE { <urn:uuid:image-albumA> nfo:hasMediaFileListEntry ?entry . ?entry nfo:entryContent ?image; nfo:listPosition ?position}"  *failed*


 This queries are failing because in the INSERT, you didn't set values to nfo:listPosition! so ?position is NULL and the query doesn't match :)

Solution 1: When you insert the mediafilelistentry set listPosition
Solution 2: Use this query instead (you get all entries but no warrantie of order):

tracker-sparql -q "SELECT ?entry ?image WHERE { <urn:uuid:image-albumA> nfo:hasMediaFileListEntry ?entry . ?entry nfo:entryContent ?image. }"
 
Regards,

Ivan


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