[Nepomuk] Why store file urls?

Vishesh Handa me at vhanda.in
Fri Nov 23 09:08:43 UTC 2012


On Fri, Nov 23, 2012 at 2:25 PM, Anders Lund <anders at alweb.dk> wrote:

> On Fredag den 23. november 2012 14:16:22 Vishesh Handa wrote:
> > The problem with this approach is that every single url which is passed
> > through Nepomuk needs to be checked for the "filex" scheme and then
> > translated. Since we do not have a sparql parser this is done by
> employing
> > regular expressions to check for patterns with file:/mount/point and
> filex.
> >
> > Valgrind logs show that for small queries a sizable amount (upto 40%) of
> > time is spent in just this regular expression based parsing. Additionally
> > since queries can return any kind of data, all of the data passed from
> > virtuoso to Nepomuk has go through these checks.
>
> Why use regular expressions to search for a fixed string? Simple string
> comparison would be much more efficient for that!
>

My bad. We do not use regular expressions. We instead look through the
entire query and try to pick up patterns by simple string comparisons.

The relevant code can be found at
nepomuk-core/services/storage/removeablemediamodel.cpp - convertFilexUrl
and converFileUrls functions.


>
>
> --
> Anders
> _______________________________________________
> Nepomuk mailing list
> Nepomuk at kde.org
> https://mail.kde.org/mailman/listinfo/nepomuk
>



-- 
Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121123/f9ff0411/attachment.html>


More information about the Nepomuk mailing list