comparison rdf/PluginRDFDescription.cpp @ 1885:1adbeb52d761

Make some debug output less obvious
author Chris Cannam
date Fri, 14 Aug 2020 10:42:37 +0100
parents 9762a7f084a0
children
comparison
equal deleted inserted replaced
1884:bdab3a921d5d 1885:1adbeb52d761
16 #include "PluginRDFDescription.h" 16 #include "PluginRDFDescription.h"
17 17
18 #include "PluginRDFIndexer.h" 18 #include "PluginRDFIndexer.h"
19 19
20 #include "base/Profiler.h" 20 #include "base/Profiler.h"
21 #include "base/Debug.h"
21 22
22 #include "plugin/PluginIdentifier.h" 23 #include "plugin/PluginIdentifier.h"
23 24
24 #include <dataquay/BasicStore.h> 25 #include <dataquay/BasicStore.h>
25 26
39 m_haveDescription(false) 40 m_haveDescription(false)
40 { 41 {
41 PluginRDFIndexer *indexer = PluginRDFIndexer::getInstance(); 42 PluginRDFIndexer *indexer = PluginRDFIndexer::getInstance();
42 m_pluginUri = indexer->getURIForPluginId(pluginId); 43 m_pluginUri = indexer->getURIForPluginId(pluginId);
43 if (m_pluginUri == "") { 44 if (m_pluginUri == "") {
44 cerr << "PluginRDFDescription: WARNING: No RDF description available for plugin ID \"" 45 SVDEBUG << "PluginRDFDescription: WARNING: No RDF description available for plugin ID \""
45 << pluginId << "\"" << endl; 46 << pluginId << "\"" << endl;
46 } else { 47 } else {
47 // All the data we need should be in our RDF model already: 48 // All the data we need should be in our RDF model already:
48 // if it's not there, we don't know where to find it anyway 49 // if it's not there, we don't know where to find it anyway
49 if (index()) { 50 if (index()) {
342 343
343 Nodes outputs = index->match 344 Nodes outputs = index->match
344 (Triple(plugin, index->expand("vamp:output"), Node())).objects(); 345 (Triple(plugin, index->expand("vamp:output"), Node())).objects();
345 346
346 if (outputs.empty()) { 347 if (outputs.empty()) {
347 cerr << "ERROR: PluginRDFDescription::indexURL: NOTE: No outputs defined for <" 348 SVDEBUG << "ERROR: PluginRDFDescription::indexURL: NOTE: No outputs defined for <"
348 << m_pluginUri << ">" << endl; 349 << m_pluginUri << ">" << endl;
349 return false; 350 return false;
350 } 351 }
351 352
352 foreach (Node output, outputs) { 353 foreach (Node output, outputs) {
353 354
354 if ((output.type != Node::URI && output.type != Node::Blank) || 355 if ((output.type != Node::URI && output.type != Node::Blank) ||
355 output.value == "") { 356 output.value == "") {
356 cerr << "ERROR: PluginRDFDescription::indexURL: No valid URI for output " << output << " of plugin <" << m_pluginUri << ">" << endl; 357 SVDEBUG << "ERROR: PluginRDFDescription::indexURL: No valid URI for output " << output << " of plugin <" << m_pluginUri << ">" << endl;
357 return false; 358 return false;
358 } 359 }
359 360
360 Node n = index->complete(Triple(output, index->expand("vamp:identifier"), Node())); 361 Node n = index->complete(Triple(output, index->expand("vamp:identifier"), Node()));
361 if (n.type != Node::Literal || n.value == "") { 362 if (n.type != Node::Literal || n.value == "") {
362 cerr << "ERROR: PluginRDFDescription::indexURL: No vamp:identifier for output <" << output << ">" << endl; 363 SVDEBUG << "ERROR: PluginRDFDescription::indexURL: No vamp:identifier for output <" << output << ">" << endl;
363 return false; 364 return false;
364 } 365 }
365 QString outputId = n.value; 366 QString outputId = n.value;
366 367
367 m_outputUriMap[outputId] = output.value; 368 m_outputUriMap[outputId] = output.value;
381 } else if (outputType.contains("TrackLevelOutput")) { 382 } else if (outputType.contains("TrackLevelOutput")) {
382 m_outputDispositions[outputId] = OutputTrackLevel; 383 m_outputDispositions[outputId] = OutputTrackLevel;
383 } else { 384 } else {
384 m_outputDispositions[outputId] = OutputDispositionUnknown; 385 m_outputDispositions[outputId] = OutputDispositionUnknown;
385 } 386 }
386 // cerr << "output " << output << " -> id " << outputId << ", type " << outputType << ", unit " 387 // SVDEBUG << "output " << output << " -> id " << outputId << ", type " << outputType << ", unit "
387 // << outputUnit << ", disposition " << m_outputDispositions[outputId] << endl; 388 // << outputUnit << ", disposition " << m_outputDispositions[outputId] << endl;
388 389
389 if (outputUnit != "") { 390 if (outputUnit != "") {
390 m_outputUnitMap[outputId] = outputUnit; 391 m_outputUnitMap[outputId] = outputUnit;
391 } 392 }
394 if (n.type == Node::Literal && n.value != "") { 395 if (n.type == Node::Literal && n.value != "") {
395 m_outputNames[outputId] = n.value; 396 m_outputNames[outputId] = n.value;
396 } 397 }
397 398
398 n = index->complete(Triple(output, index->expand("vamp:computes_event_type"), Node())); 399 n = index->complete(Triple(output, index->expand("vamp:computes_event_type"), Node()));
399 // cerr << output << " -> computes_event_type " << n << endl; 400 // SVDEBUG << output << " -> computes_event_type " << n << endl;
400 if (n.type == Node::URI && n.value != "") { 401 if (n.type == Node::URI && n.value != "") {
401 m_outputEventTypeURIMap[outputId] = n.value; 402 m_outputEventTypeURIMap[outputId] = n.value;
402 } 403 }
403 404
404 n = index->complete(Triple(output, index->expand("vamp:computes_feature"), Node())); 405 n = index->complete(Triple(output, index->expand("vamp:computes_feature"), Node()));