[Nepomuk] Nepomuk facets
Sebastian Trüg
trueg at kde.org
Fri Jun 18 15:07:46 CEST 2010
On 06/18/2010 12:09 PM, Alessandro Sivieri wrote:
> SemBrowser currently has Facet as a subclass of QWidget. I am not sure
> that is the most flexible approach. IMHO a decoupling of facets from
> representation is desirable.
>
>
> You're completely right here: I did it in this way, but I knew it was
> not the best way; I will decouple view and model, so creating a new
> facet means subclass Facet (the model part, adding its own queries)
> without having to bother about the view part (or just choose which kind
> of visualization you want for the new facet).
>
> I don't know about using a FacetModel: currently I'm using a model for
> those facets with a list of items (or, better, terms), but for example
> time and type do not need a model; I think in the end the best structure
> is having Facet (and Term) classes, which represent the model part, some
> UI representing the view part, and a controller for them (which, in
> Sembrowser, would be the side panel itself, communicating with the file
> browser part, but it can be anything else). You know, MVC... :)
My idea for the FacetModel was this:
- one parent item for each facet group, i.e. one for date, one for
document type, and one for tags (to match the current SemBrowser facets)
- as children have the actual facets and make them checkable.
- the if one if checked the model updates itself.
- the gui could be anything. It could be a simply treeview which would
be good for testing. But it could also be something custom like the
widgets you are using now.
The problem remaining is date ranges: it is simple to have fixed dates
for stuff like "this week" or "today" but a custom range is harder. One
possibility would be to have a generic facet which can handle literal
values like so:
You can add a set of fixed values to it and you can also tell it to show
the custom choice. The custom choice will show a daterange widget for
date values, an int range selection for integer values and so on. Well,
I am not sure what "so on" really means since the only other type could
be a float...
Cheers,
Sebastian
More information about the Nepomuk
mailing list