[Nepomuk] Need feedback on new query api

Artem Serebriyskiy v.for.vandal at gmail.com
Sat Jul 24 22:30:15 CEST 2010


As for me, it is too confusing.

On Sun, Jul 25, 2010 at 12:15 AM, Sebastian Trüg <trueg at kde.org> wrote:

> Hi guys,
>
> at the Akademy a very good idea came up: using C++ operator overloads to
> construct queries. This is very straight-forward for AndTerm and OrTerm:
>
>   term1 && term2 && term3
>
>   term1 || term2 || term3
>
> But it gets nicer (thanks to Vishesh for the tip):
>
>   Vocabulary::NIE::contentCreated() > Query::LiteralTerm( dateTime1 );
>   Vocabulary::NAO::hasTag() == term;
>
> which results in the following ComparisonTerms:
>
>   ComparisonTerm(
>        Vocabulary::NIE::contentCreated(),
>        Query::LiteralTerm( dateTime1 ),
>        ComparisonTerm::Greater );
>
>   ComparisonTerm(
>        Vocabulary::NAO::hasTag(),
>        term,
>        ComparisonTerm::Equal );
>
> So far so good. But now let me give you the idea which I would like some
> feedback on. By interchanging the two parameters of the operator we
> create an inverted ComparisonTerm:
>
>   term == Vocabulary::NAO::hasTag();
>
> will create the following term:
>
>   ComparisonTerm(
>        Vocabulary::NAO::hasTag(),
>        term,
>        ComparisonTerm::Equal ).inverted();
>
> For me this is very convenient. But it might be rather confusing. But
> then again inverted terms are confusing to begin with.
>
> So any opinions?
>
> Cheers,
> Sebastian
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
>



-- 
Sincerely yours,
Artem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100725/293129de/attachment.htm 


More information about the Nepomuk mailing list