[Nepomuk] Review Request: DataMangaement: Optimize createUri
Sebastian Trueg
sebastian at trueg.de
Mon Sep 17 15:31:59 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106483/#review19076
-----------------------------------------------------------
Ship it!
Nice!
- Sebastian Trueg
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/20120917/ebabfbd7/attachment.html>
More information about the Nepomuk
mailing list