[Nepomuk] Review Request: DataMangaement: Optimize createUri

Commit Hook null at kde.org
Tue Sep 18 13:03:08 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106483/#review19102
-----------------------------------------------------------


This review has been submitted with commit b54cbaa5e00c1191cd2e66399aeb86a04ba85ef1 by Vishesh Handa to branch master.

- Commit Hook


On Sept. 17, 2012, 3:05 p.m., Vishesh Handa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106483/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2012, 3:05 p.m.)
> 
> 
> Review request for Nepomuk and Sebastian Trueg.
> 
> 
> Description
> -------
> 
>     Check if the uri exists by using virtuoso's internal iri_to_id, instead
>     of a complicated sparql query that takes a long time to execute.
>     
>     We can save save roughly 100-200 msecs by not running the huge query.
> 
> 
> Diffs
> -----
> 
>   services/storage/datamanagementmodel.cpp 4221a3c 
> 
> Diff: http://git.reviewboard.kde.org/r/106483/diff/
> 
> 
> Testing
> -------
> 
> Yup. This was the rough test -
> 
>     QString baseQuery = QString::fromLatin1("select iri_to_id( '%1', 0 )");
> 
>     QStringList list;
>     list << "nepomuk:/res/a228f2ef-82bf-4979-9fdf-71b60714e82e";
>     list << "nepomuk-random-uadfadsfsdafasdfdafadsfdsafasdfkj4324";
> 
>     foreach( QString uri, list ) {
>         QString query = baseQuery.arg( uri );
>         kDebug() << "Query: " << query;
> 
>         Soprano::Model* model = Nepomuk2::ResourceManager::instance()->mainModel();
>         Soprano::QueryResultIterator it = model->executeQuery( query, Soprano::Query::QueryLanguageUser, QLatin1String("sql") );
>         if( it.next() ) {
>             if( it[0].literal().toString().isEmpty() )
>                 kDebug() << "DOES NOT EXIST";
>         }
>         kDebug() << "------";
>     }
>     return;
> 
> 
> Thanks,
> 
> Vishesh Handa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20120918/71e7b58a/attachment.html>


More information about the Nepomuk mailing list