[Nepomuk] On limits of terms for a facet

Sebastian Trueg trueg at kde.org
Mon Mar 8 12:06:37 CET 2010


A few comments on the code:
1. In TagsFacet::queryNextResult

term.addSubTerm(Query::ComparisonTerm(Soprano::Vocabulary::NAO::hasTag(),
Query::LiteralTerm(label)))

should be

term.addSubTerm(Query::ComparisonTerm(Soprano::Vocabulary::NAO::hasTag(),
Query::ResourceTerm(query->binding(0).uri())))

This will prevent the query from using a string matching. This should
speed up the query significantly (BTW: I suppose this is why the UI is
blocking).

2. Restricting by folder (as you do by default using a FILTER) slows
down the query A LOT.

3. It probably is not necessary to re-query the tags each time the
factes change. Although I am also not sure if it would change much.

4. OpenLink is currently accessing the perfect indexing scheme for us.
This in combination with proper inferencing should give us another
performance boost.

Cheers,
Sebastian

Alessandro Sivieri wrote:
> Hi all,
> 
> while experimenting with Sembrowser, I found out that having many tagged
> files and/or many tags can bring to long query times, so I was wondering
> if we should consider a limit, in the faceted browsing, in the number of
> results shown; for now it may just be a problem of query optimization,
> in fact the current version asks Soprano for all the tagged files and
> for all the tags names, and then for each tag the file count (based on
> the other constraints), but I do not know how much this can be optimized.
> 
> As related to the question above: I think I missed something in the
> model handling, for getting a parallel execution of the query, separated
> from the UI thread; the Smartsave model works correctly, so I copied
> over the code handling the query execution, which is just a
> QMetaObject::invokeMethod, and in the invoked method I'm using the async
> query from Soprano; however, in Sembrowser the UI still freezes while
> loading tags: am I missing something?
> 
> (the file is src/tagsfacet.cpp, in Sembrowser on Gitorious)
> 
> -- 
> Sivieri Alessandro
> alessandro.sivieri at gmail.com <mailto:alessandro.sivieri at gmail.com>
> http://www.chimera-bellerofonte.eu/
> http://www.poul.org/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk


More information about the Nepomuk mailing list