[Nepomuk] Nepomuk facets

Sebastian Trüg trueg at kde.org
Fri Jun 25 17:09:58 CEST 2010


On 06/25/2010 04:36 PM, Alessandro Sivieri wrote:
> 2010/6/25 Sebastian Trüg <trueg at kde.org <mailto:trueg at kde.org>>
> 
>     Have a look at it and share thoughts, please.
> 
> 
> I like this one; just a few things, to see if I understood it correctly:
> 
>     * in Facet, Terms are Query::Term, right? So you thought in saving
>       each term directly as a query piece? That's not a bad idea...

yes, that is exactly what I thought it could work.

>     * do you already have an idea in how to "mark" each facet subquery
>       so it can be extracted in the model?

Via Qt::CheckState in the model. That way a term in the facet can be
checked in the model.

>     * for showing facets in a tree, each facet should be at "column" 0,
>       while each choice for that facet should be at "column" 1, for
>       example, right?

I thought of only a single column where the facets are the parent top
level items and the possible terms are the children. But I suppose that
is what you mean, too.

>     * a range should restrict the number of items of a facet or be an
>       item of that facet?

It is a special item that is always at the end. I also thought of
another special item that is always at the beginning: the no-selection item:

            /**
             * Allows to set a custom title for the first entry in the
             * facet selection. Defaults to "None".
             *
             * \sa setNoSelectionTerm()
             */
            void setNoSelectionTitle( const QString& title );

            /**
             * Allows to customize the term of the first entry.
             *
             * \sa setNoSelectionTitle()
             */
            void setNoSelectionTerm( const Term& term );

That way a facet contains the no selection item, the manually added
terms, and the optional range term in case that is set.

Cheers,
Sebastian


More information about the Nepomuk mailing list