[Nepomuk] Nepomuk Core - Questions & Patches

Sebastian Trüg trueg at kde.org
Sun May 23 16:50:05 CEST 2010


On 05/23/2010 04:23 PM, Vishesh Handa wrote:
>     > One way of solving both the problems is to derive ResourceData from
>     > QObject. And then call deleteLater() instead of "delete this". (Patch
>     > attached)
> 
>     oh, no, please don't. Totally useless overhead. It is much simpler to
>     make the mutex recursive.
> 
> 
> Well then we need a better way of solving the "delete this" problem.
> When you say moving "it" into Resource, do you mean determineUri() or
> replaceWith() ?

I mean all calls of determineUri().
Example:
ResourceData::removeProperty calls determineUri. Instead determineUri
should be called in Resource::removeProperty.
The only problem here is load. But I recently thought that it could be
merged into determineUri (or the other way around). After all most
resources do not have more than - say - 20 properties. That is quickly
loaded and would avoid performing yet another query. What I mean is that
in determineUri

select distinct ?r ?o where {
{ ?r nie:url <uri> . }
UNION { <uri> ?p ?o . } } LIMIT 1

could become something like

select distinct ?r ?pp ?oo where {
{ ?r nie:url <uri> .
?r ?pp ?oo . FILTER(?r!=<uri> . }
UNION { <uri> ?p ?o . <uri> ?pp ?oo . }

to determine the URI AND load all properties at the same time.
Just an idea I had when I thought about ways to spped it all up...

Cheers,
Sebastian


More information about the Nepomuk mailing list