comparison rdf/RDFTransformFactory.cpp @ 689:573d45e9487b

Merge from debug-output branch
author Chris Cannam
date Tue, 14 Jun 2011 14:47:59 +0100
parents be43b2fe68e8 06f13a3b9e9e
children 1424aa29ae95
comparison
equal deleted inserted replaced
688:be43b2fe68e8 689:573d45e9487b
166 } 166 }
167 167
168 m_isRDF = true; 168 m_isRDF = true;
169 169
170 if (transformResults.empty()) { 170 if (transformResults.empty()) {
171 cerr << "RDFTransformFactory: NOTE: No RDF/TTL transform descriptions found in document at <" << m_urlString.toStdString() << ">" << endl; 171 DEBUG << "RDFTransformFactory: NOTE: No RDF/TTL transform descriptions found in document at <" << m_urlString << ">" << endl;
172 return transforms; 172 return transforms;
173 } 173 }
174 174
175 // There are various queries we need to make that might include 175 // There are various queries we need to make that might include
176 // data from either the transform RDF or the model accumulated 176 // data from either the transform RDF or the model accumulated
193 QString pluginUri = result["plugin"].value; 193 QString pluginUri = result["plugin"].value;
194 194
195 QString pluginId = indexer->getIdForPluginURI(pluginUri); 195 QString pluginId = indexer->getIdForPluginURI(pluginUri);
196 if (pluginId == "") { 196 if (pluginId == "") {
197 cerr << "RDFTransformFactory: WARNING: Unknown plugin <" 197 cerr << "RDFTransformFactory: WARNING: Unknown plugin <"
198 << pluginUri.toStdString() << "> for transform <" 198 << pluginUri << "> for transform <"
199 << transformUri.toStdString() << ">, skipping this transform" 199 << transformUri << ">, skipping this transform"
200 << endl; 200 << endl;
201 continue; 201 continue;
202 } 202 }
203 203
204 Transform transform; 204 Transform transform;
282 (RealTime::fromXsdDuration(v.value.toStdString())); 282 (RealTime::fromXsdDuration(v.value.toStdString()));
283 } else if (optional == "duration") { 283 } else if (optional == "duration") {
284 transform.setDuration 284 transform.setDuration
285 (RealTime::fromXsdDuration(v.value.toStdString())); 285 (RealTime::fromXsdDuration(v.value.toStdString()));
286 } else { 286 } else {
287 cerr << "RDFTransformFactory: ERROR: Inconsistent optionals lists (unexpected optional \"" << optional.toStdString() << "\"" << endl; 287 cerr << "RDFTransformFactory: ERROR: Inconsistent optionals lists (unexpected optional \"" << optional << "\"" << endl;
288 } 288 }
289 } 289 }
290 } 290 }
291 } 291 }
292 292
293 cerr << "RDFTransformFactory: NOTE: Transform is: " << endl; 293 DEBUG << "RDFTransformFactory: NOTE: Transform is: " << endl;
294 cerr << transform.toXmlString().toStdString() << endl; 294 cerr << transform.toXmlString() << endl;
295 295
296 transforms.push_back(transform); 296 transforms.push_back(transform);
297 } 297 }
298 298
299 return transforms; 299 return transforms;
397 397
398 if (pluginUri != "") { 398 if (pluginUri != "") {
399 s << uri << " a vamp:Transform ;" << endl; 399 s << uri << " a vamp:Transform ;" << endl;
400 s << " vamp:plugin <" << QUrl(pluginUri).toEncoded().data() << "> ;" << endl; 400 s << " vamp:plugin <" << QUrl(pluginUri).toEncoded().data() << "> ;" << endl;
401 } else { 401 } else {
402 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No plugin URI available for plugin id \"" << pluginId.toStdString() << "\", writing synthetic plugin and library resources" << std::endl; 402 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No plugin URI available for plugin id \"" << pluginId << "\", writing synthetic plugin and library resources" << std::endl;
403 QString type, soname, label; 403 QString type, soname, label;
404 PluginIdentifier::parseIdentifier(pluginId, type, soname, label); 404 PluginIdentifier::parseIdentifier(pluginId, type, soname, label);
405 s << uri << "_plugin a vamp:Plugin ;" << endl; 405 s << uri << "_plugin a vamp:Plugin ;" << endl;
406 s << " vamp:identifier \"" << label << "\" .\n" << endl; 406 s << " vamp:identifier \"" << label << "\" .\n" << endl;
407 s << uri << "_library a vamp:PluginLibrary ;" << endl; 407 s << uri << "_library a vamp:PluginLibrary ;" << endl;
414 PluginRDFDescription description(pluginId); 414 PluginRDFDescription description(pluginId);
415 QString outputId = transform.getOutput(); 415 QString outputId = transform.getOutput();
416 QString outputUri = description.getOutputUri(outputId); 416 QString outputUri = description.getOutputUri(outputId);
417 417
418 if (transform.getOutput() != "" && outputUri == "") { 418 if (transform.getOutput() != "" && outputUri == "") {
419 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No output URI available for transform output id \"" << transform.getOutput().toStdString() << "\", writing a synthetic output resource" << std::endl; 419 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No output URI available for transform output id \"" << transform.getOutput() << "\", writing a synthetic output resource" << std::endl;
420 } 420 }
421 421
422 if (transform.getStepSize() != 0) { 422 if (transform.getStepSize() != 0) {
423 s << " vamp:step_size \"" << transform.getStepSize() << "\"^^xsd:int ; " << endl; 423 s << " vamp:step_size \"" << transform.getStepSize() << "\"^^xsd:int ; " << endl;
424 } 424 }