comparison rdf/RDFTransformFactory.cpp @ 592:18488253a3f4

* percent-encode plugin and plugin-output uris
author Chris Cannam
date Mon, 18 May 2009 10:24:36 +0000
parents 1b8c748fd7ea
children b4a8d8221eaf be43b2fe68e8
comparison
equal deleted inserted replaced
591:7065e921f122 592:18488253a3f4
17 17
18 #include <map> 18 #include <map>
19 #include <vector> 19 #include <vector>
20 20
21 #include <QTextStream> 21 #include <QTextStream>
22 #include <QUrl>
22 23
23 #include <iostream> 24 #include <iostream>
24 #include <cmath> 25 #include <cmath>
25 26
26 #include "SimpleSPARQLQuery.h" 27 #include "SimpleSPARQLQuery.h"
393 QString pluginId = transform.getPluginIdentifier(); 394 QString pluginId = transform.getPluginIdentifier();
394 QString pluginUri = PluginRDFIndexer::getInstance()->getURIForPluginId(pluginId); 395 QString pluginUri = PluginRDFIndexer::getInstance()->getURIForPluginId(pluginId);
395 396
396 if (pluginUri != "") { 397 if (pluginUri != "") {
397 s << uri << " a vamp:Transform ;" << endl; 398 s << uri << " a vamp:Transform ;" << endl;
398 s << " vamp:plugin <" << pluginUri << "> ;" << endl; 399 s << " vamp:plugin <" << QUrl(pluginUri).toEncoded().data() << "> ;" << endl;
399 } else { 400 } else {
400 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No plugin URI available for plugin id \"" << pluginId.toStdString() << "\", writing synthetic plugin and library resources" << std::endl; 401 std::cerr << "WARNING: RDFTransformFactory::writeTransformToRDF: No plugin URI available for plugin id \"" << pluginId.toStdString() << "\", writing synthetic plugin and library resources" << std::endl;
401 QString type, soname, label; 402 QString type, soname, label;
402 PluginIdentifier::parseIdentifier(pluginId, type, soname, label); 403 PluginIdentifier::parseIdentifier(pluginId, type, soname, label);
403 s << uri << "_plugin a vamp:Plugin ;" << endl; 404 s << uri << "_plugin a vamp:Plugin ;" << endl;
453 s << " vamp:value \"" << value << "\"^^xsd:float ;" << endl; 454 s << " vamp:value \"" << value << "\"^^xsd:float ;" << endl;
454 s << " ] ;" << endl; 455 s << " ] ;" << endl;
455 } 456 }
456 457
457 if (outputUri != "") { 458 if (outputUri != "") {
458 s << " vamp:output <" << outputUri << "> ." << endl; 459 s << " vamp:output <" << QUrl(outputUri).toEncoded().data() << "> ." << endl;
459 } else if (outputId != "") { 460 } else if (outputId != "") {
460 s << " vamp:output [ vamp:identifier \"" << outputId << "\" ] ." << endl; 461 s << " vamp:output [ vamp:identifier \"" << outputId << "\" ] ." << endl;
461 } else { 462 } else {
462 s << " ." << endl; 463 s << " ." << endl;
463 } 464 }