comparison rdf/PluginRDFIndexer.cpp @ 482:f54381e01141

* Fix a deadlock * Make debug output more suited to datastore rdf implementation
author Chris Cannam
date Fri, 14 Nov 2008 12:29:48 +0000
parents a82645e788fc
children b13213785a6f
comparison
equal deleted inserted replaced
481:a82645e788fc 482:f54381e01141
340 //!!! QString soname = (*i)["library_id"].value; 340 //!!! QString soname = (*i)["library_id"].value;
341 QString soUri = (*i)["library"].value; 341 QString soUri = (*i)["library"].value;
342 QString identifier = (*i)["plugin_id"].value; 342 QString identifier = (*i)["plugin_id"].value;
343 343
344 if (identifier == "") { 344 if (identifier == "") {
345 cerr << "PluginRDFIndexer::indexURL: NOTE: Document at <" 345 cerr << "PluginRDFIndexer::indexURL: NOTE: No vamp:identifier for plugin <"
346 << urlString.toStdString()
347 << "> fails to define any vamp:identifier for plugin <"
348 << pluginUri.toStdString() << ">" 346 << pluginUri.toStdString() << ">"
349 << endl; 347 << endl;
350 continue; 348 continue;
351 } 349 }
352 if (soUri == "") { 350 if (soUri == "") {
353 cerr << "PluginRDFIndexer::indexURL: NOTE: Document at <" 351 cerr << "PluginRDFIndexer::indexURL: NOTE: No implementation library for plugin <"
354 << urlString.toStdString() << "> does not associate plugin <" 352 << pluginUri.toStdString() << ">"
355 << pluginUri.toStdString() << "> with any implementation library"
356 << endl; 353 << endl;
357 continue; 354 continue;
358 } 355 }
359 356
360 QString sonameQuery = 357 QString sonameQuery =
371 368
372 SimpleSPARQLQuery::Value sonameValue = 369 SimpleSPARQLQuery::Value sonameValue =
373 SimpleSPARQLQuery::singleResultQuery(localString, sonameQuery, "library_id"); 370 SimpleSPARQLQuery::singleResultQuery(localString, sonameQuery, "library_id");
374 QString soname = sonameValue.value; 371 QString soname = sonameValue.value;
375 if (soname == "") { 372 if (soname == "") {
376 cerr << "PluginRDFIndexer::indexURL: NOTE: Document at <" 373 cerr << "PluginRDFIndexer::indexURL: NOTE: No identifier for library <"
377 << urlString.toStdString() << "> omits identifier for library <"
378 << soUri.toStdString() << ">" 374 << soUri.toStdString() << ">"
379 << endl; 375 << endl;
380 continue; 376 continue;
381 } 377 }
382 378
391 ("vamp", soname, identifier); 387 ("vamp", soname, identifier);
392 388
393 foundSomething = true; 389 foundSomething = true;
394 390
395 if (m_idToDescriptionMap.find(pluginId) != m_idToDescriptionMap.end()) { 391 if (m_idToDescriptionMap.find(pluginId) != m_idToDescriptionMap.end()) {
392 /*!!!
393
394 This can happen quite legitimately when using an RDF datastore rather
395 than querying individual files, as of course the datastore contains
396 all plugin data found so far, and each time a file is added to it,
397 subsequent queries will return all older plugins as well.
398
399 It would be more efficient to add everything at once and then do all
400 queries, of course.
401
396 cerr << "PluginRDFIndexer::indexURL: NOTE: Plugin id \"" 402 cerr << "PluginRDFIndexer::indexURL: NOTE: Plugin id \""
397 << pluginId.toStdString() << "\", described in document at <" 403 << pluginId.toStdString() << "\", described in document at <"
398 << urlString.toStdString() 404 << urlString.toStdString()
399 << ">, has already been described in document <" 405 << ">, has already been described in document <"
400 << m_idToDescriptionMap[pluginId].toStdString() 406 << m_idToDescriptionMap[pluginId].toStdString()
401 << ">: ignoring this new description" << endl; 407 << ">: ignoring this new description" << endl;
408 */
402 continue; 409 continue;
403 } 410 }
404 411
405 m_idToDescriptionMap[pluginId] = urlString; 412 m_idToDescriptionMap[pluginId] = urlString;
406 m_idToUriMap[pluginId] = pluginUri; 413 m_idToUriMap[pluginId] = pluginUri;