Faceted Browsing in KDE or The Blog Entry that Missed a Catchy Name


It is about time I blogged again. So I will just blabber out what I was doing for the last two days: Facets – again. Why again? Well, this is my third attempt at creating a generic facet framework for KDE and the fifth in total I think. Alessandro Sivieri started writing smart facets in his GSoC project 2009 (yes, I will write a summary of GSoC 2010 – I will get there eventually), then continued with a simplified version in his SemBrowser. Then I stepped in, trying to make his facets generic by separating GUI from core which looked nice in the beginning but eventually failed since certain things could not be solved when separating GUI and core. In the end I decided that Facets are a very GUI kind of thing and went back to Alessandro’s SemBrowser design of facets: each facet is a QWidget.

And that is what I did the last two days. Now I have a FacetWidget and convenient subclasses ListFacetWidget, SimpleListFacetWidget, RangedFacetWidget, and DynamicListFacetWidget. The basic idea is (following Alessandro’s approach) that each FacetWidget provides one Nepomuk::Query::Term. The combination of all terms (and some optional base query) make up the final query.

Before I continue let’s have a look at how this looks like at the moment:

Preliminary Facets in Dolphin

The GUI is not very impressive yet but I am rather fond of the underlying techniques. Each FacetWidget has a method selectFromTerm which tries to use the provided term to configure the facet. A simple example: the SimpleListFacetWidget compares the provided term to each of the term in its internal list of terms and if one matches it selects that one. So in other words if the following call succeeds:

if( facetWidget->selectFromTerm( myTerm ) ) {
    ....
}

Then a subsequent call to

facetWidget->term();

will return exactly myTerm. This allows for extracting facets from any query. This is what the FacetWidgetController does. It provides methods and signals to handle a set of facet widgets through one interface. And since we can extract facets from any query we can provide faceted browsing on any query listing without remembering some state. This is where KIO::UDSEntry::UDS_NEPOMUK_QUERY comes in which allows KIO slaves to communicate the query which can list the current folder contents. This is simple for nepomuksearch:/ but also used by timeline:/. For file:/ we have a default query listing all files in the one folder. This query is then picked apart by the FacetWidgetController, allowing users to use facets on any local folder listing.

Again let us look at a simple example – timeline:

Facets extracted from timeline:/ listing

As you can see the one facet used in timeline:/ (namely the restriction by date) has been extracted from the query. Selecting additional facets will keep the date restriction and continue from there.

I think this is already a pretty nice system. Next steps include polishing the API, adding some dynamic facets (such as: image size once Images is selected or a way to restrict Media files by author/interpret), and a nicer GUI. This is where I would love some feedback – the GUI takes way too much space and needs some beauty.

14 thoughts on “Faceted Browsing in KDE or The Blog Entry that Missed a Catchy Name

      • I have done that. timeline:/ shows days and months as folders. But if i click on them, there is nothing underneath, even if i am sure i have created/changed files on that date.

        I am running 4.5, btw,

        • Have you enabled nepomuk under Desktop search?
          I think for the timeline you might even need strigi, the file indexer but I’m not sure. I just enabled strigi the day before yesterday after cleaning out my home directory to make it manageable. Since then I noticed that there are entries in dolphin for the timeline.

  1. On the ‘other side of the river(MS W)’ this works very good.

    Will it be possible to use this “filters” without Strigi (for non-indexed locations, files)?

    Currently available filters are date, file type, tags. What about picture dimensions, title, album artists etc?

  2. Pingback: Someone requested Excerpts for Query Results « Trueg's Blog

  3. Pingback: GSoC – The End « Oszkar’s Developer Blog

  4. Pingback: Chimaera & Bellerophon » Blog Archive » Dolphin in KDE SC 4.6

  5. Pingback: Faceted browsing | Babyskulpturen

Leave a comment