Bug 424165 - Negated terms in queries
Summary: Negated terms in queries
Status: CONFIRMED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Brüns
URL:
Keywords:
: 474994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-13 17:40 UTC by vini.ipsmaker
Modified: 2023-11-13 10:19 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vini.ipsmaker 2020-07-13 17:40:26 UTC
Nepomuk's Query class allowed construction from a manually created Term object. This setup allowed one to use the negation basic logic operator. Baloo's Query dropped the possibility to feed a manually created Term object and moved Term to implementation details. However, in doing so, it also dropped support for such operator (only AND and OR are supported). Negation is a basic logic operator and should be supported.

My use case is very simple. Every time I read a document, I tag it with "already-read". I want to search for every document in the tag "project1" that isn't tagged as "already-read".

Baloo's Term class still retains the "negated" property. I believe one only needs to update the function Term::fromVariantMap() and it'll automatically propagate to a few upper classes and functions such as Query::fromJSON().
Comment 1 Nate Graham 2020-07-13 18:14:46 UTC
Sounds like you're pretty close to writing a patch for this. :) Wanna go all the way and submit one?

https://invent.kde.org/frameworks/baloo/-/merge_requests
Comment 2 Stefan Brüns 2020-07-13 19:02:47 UTC
Its not only the query which has to be updated, it also has to be executed. Thats the non-trivial part.
Comment 3 vini.ipsmaker 2020-08-14 21:55:01 UTC
> Sounds like you're pretty close to writing a patch for this. :) Wanna go all the way and submit one?

I thought more about the problem and -- as Stefan Brüns pointed out -- the query processor will have to be upgraded too. Old Nepomuk would rely on OpenLink Virtuoso for query execution, so no code from old code base could be used as a reference in the new Baloo framework.

I'll just find a workaround for my use-case.
Comment 4 Stefan Brüns 2023-11-13 08:48:51 UTC
*** Bug 474994 has been marked as a duplicate of this bug. ***