<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/106483/">http://git.reviewboard.kde.org/r/106483/</a>
     </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Nepomuk and Sebastian Trueg.</div>
<div>By Vishesh Handa.</div>







<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">    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.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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;</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>services/storage/datamanagementmodel.cpp <span style="color: grey">(4221a3c)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/106483/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>