Comment 2 for bug 592599

Revision history for this message
Seif Lotfy (seif) wrote : Re: [Bug 592599] Re: Hard to use exclusive queries

We can solve Others by having a root interpretation
it will look like this
 su1 = Subject.new_for_values(interpretation=ROOT)
 su2 = Subject.new_for_values(interpretation="!"+DOCUMENT)
 su2 = Subject.new_for_values(interpretation="!"+AUDIO)
 ...
 ev = Event()
 ev.subjects.append(su1)
 ev.subjects.append(su2)
 ...
What do you think?

On Fri, Jun 11, 2010 at 2:13 PM, Markus Korn <email address hidden> wrote:

> I agree with you here, the combinator for subjects should be AND, but
> the one for events should stay OR - that makes the most sense.
>
> ** Changed in: zeitgeist
> Status: New => Confirmed
>
> --
> Hard to use exclusive queries
> https://bugs.launchpad.net/bugs/592599
> You received this bug notification because you are subscribed to The
> Zeitgeist Project.
>
> Status in Zeitgeist Framework: Confirmed
>
> Bug description:
> (Canonical hat on)
>
> For Unity we want to try and group recent files into some categories like
> Documents, Images, Video, Presentations, etc, and I've discovered an
> unfortunate decision in our template matching algorithm, making this quite
> hard to get 100% right.
>
> The deal is that the designers think that the Documents section should not
> contain Presentations (which makes quite good sense if there is a separate
> section for this). Also we'd like to have an "Other" section with
> unclassified stuff. But since nfo:Presentation is a subclass of nfo:Document
> a query for all documents would also include all presentations (which is
> "correct", but not what we want in this particular case).
>
> So roughly speaking the query for the Documents section should be
>
> all subtypes of nfo:Document but NOT nfo:Presentation
>
> Currently this is simply not possible in Zeitgeist, because we do logical
> OR between all subject templates. What I'd propose to do to make these kind
> of queries possible, is to switch to logical AND between subjects, but keep
> it at logical OR between events. So in code I'd like the following code to
> work:
>
> su1 = Subject.new_for_values(interpretation=DOCUMENT)
> su2 = Subject.new_for_values(interpretation="!"+PRESENTATION)
> ev = Event()
> ev.subjects.append(su1)
> ev.subjects.append(su2)
> # now query for [ev].
>
> As you probably realize we have the same problem (but even stronger) in the
> "Other" section where we want to exclude all the listed sections and match
> everything else.
>
>
>

--
This is me doing some advertisement for my blog http://seilo.geekyogre.com