Reply to topic

How to search Nepomuk for lastModified on a certain date?

jfrantzius
Registered Member
Posts
5
Karma
0
Hi,
I learned that it is possible use krunner to issue a nepomuk query like this:
Code: Select all
nepomuksearch:/+lastModified<2009-11-17

That particular query does seem to work. Unfortunately, what doesn't seem to work is looking for equality of a given day, i.e. the following has no results at all (although it should):
Code: Select all
nepomuksearch:/+lastModified=2013-02-21

When I try
Code: Select all
nepomuksearch:/lastModified<2013-02-21 and lastModified>2013-02-19

I do get some results for 2013-02-20 as expected, but also results from other years.

Does anybody know whether these are bugs, and whether I should file them against nepomuk or some other component?

BTW "lastModified", "created" and related examples aren't listed at all on http://userbase.kde.org/Nepomuk/kioslaves/search, and it would be nice to have examples there...
User avatar bcooksley
Administrator
Posts
18657
Karma
83
OS
Which version of KDE are you using?
Also, have you indexed all the folders you are expecting to find files in?


System Settings and Device Actions KCM maintainer
Image
jfrantzius
Registered Member
Posts
5
Karma
0
bcooksley wrote:Which version of KDE are you using?
Also, have you indexed all the folders you are expecting to find files in?

Sorry, that's with KDE 4.10 on Kubuntu 12.10. And yes, the files are indexed.
vHanda
KDE Developer
Posts
24
Karma
0
OS
I just checked the code and it seems about right. I think the reason cause results from other years might be sent is cause you might have tagged those file or they might have gotten recently indexed.

Nepomuk has 2 concepts of lastModified -

- nie:lastModified
- nao:lastModified

the "NIE" form corresponds to the mtime of the file in the file system, and "NAO" last modified corresponds to when the metadata was last modified in Nepomuk. So indexing the file, adding a tag, rating it, etc will update the nao:lastModified.

The currently query parser isn't that great, so it just queries all the properties which contain the text 'lastModified' which results it in actually querying 4 properties (2 deprecated properties as well). If you only want to query the nie:lastModified, you could do something like this -

nie#lastModified<2013-02-21 and nie#lastModified>2013-02-19
jfrantzius
Registered Member
Posts
5
Karma
0
Hi Vishesh,

thanks for the insight from the source code. Unfortunately, searching for nie#lastModified still gives too many results. E.g. the following:
Code: Select all
nepomuksearch:/nie#lastModified>2013-03-03

unfortunately results in lots of files modified before 2013-03-03.

Does the query work for you?

Regards,
Jörg
vHanda
KDE Developer
Posts
24
Karma
0
OS
jfrantzius wrote:Hi Vishesh,

thanks for the insight from the source code. Unfortunately, searching for nie#lastModified still gives too many results. E.g. the following:
Code: Select all
nepomuksearch:/nie#lastModified>2013-03-03

unfortunately results in lots of files modified before 2013-03-03.


Hey. I'm sorry - I'd only tested it through the query parser and not through kio. It seems that the kioslave eats up the part after # cause it considers it to be a fragment of the url. I've tried extracting it manually, but that causes a problem further along the code.

Would you mind filling a bug? I'm not sure how to fix it right now, but it should get fixed in time for 4.10.2
jfrantzius
Registered Member
Posts
5
Karma
0
vHanda wrote:Hey. I'm sorry - I'd only tested it through the query parser and not through kio. It seems that the kioslave eats up the part after # cause it considers it to be a fragment of the url. I've tried extracting it manually, but that causes a problem further along the code.

Would you mind filling a bug? I'm not sure how to fix it right now, but it should get fixed in time for 4.10.2


Sure no problem: https://bugs.kde.org/show_bug.cgi?id=316363

Maybe we should update the documentation or Wiki so people will know about "nie#lastModified" at all, and the "#" in queries entered through krunner in general?
User avatar Ignacio Serantes
Registered Member
Posts
448
Karma
1
OS
This kind of searches are available in Nepoogle, http://kde-apps.org/content/show.php?content=145505

nie:lastModified:>2013-03-01
nie:lastModified:>2013
nie:lastModified:>03m
nie:lastModified:>01d


Ignacio Serantes, proud to be a member of KDE forums since 2008-Nov.

 
Reply to topic

Bookmarks



Who is online

Registered users: ab4bd, Baidu [Spider], BeS, Bing [Bot], Exabot [Bot], GeekQuack, ggael, ghevan, Google [Bot], google01103, igorm, jensreuterberg, kainz.a, maarten, mmistretta, Nuc!eoN, orbmiser, plfiorini, scummos, searchfgold6789, SecretCode, Steve T, TheraHedwig, Uri_Herrera, vblazquez, Yahoo [Bot]