# HG changeset patch # User Chris Cannam # Date 1246283090 0 # Node ID 4fa2b135acbcdd43d024f32cb4e240f8363c1815 # Parent c557956274909c7da4dace53f819aa59cba574c2 * Add rdf-network option to retrieve RDF descriptions from network, since this is no longer done automatically for reasons of cost diff -r c55795627490 -r 4fa2b135acbc rdf/RDFFeatureWriter.cpp --- a/rdf/RDFFeatureWriter.cpp Mon Jun 22 17:06:27 2009 +0000 +++ b/rdf/RDFFeatureWriter.cpp Mon Jun 29 13:44:50 2009 +0000 @@ -20,6 +20,7 @@ #include "RDFFeatureWriter.h" #include "RDFTransformFactory.h" +#include "PluginRDFIndexer.h" #include #include @@ -36,6 +37,8 @@ SupportOneFileTotal, "n3"), m_plain(false), + m_network(false), + m_networkRetrieved(false), m_count(0) { } @@ -69,6 +72,11 @@ p.description = "Link the track in the output RDF to the given foaf:maker URI."; p.hasArg = true; pl.push_back(p); + + p.name = "network"; + p.description = "Attempt to retrieve RDF descriptions of plugins from network, if not available locally"; + p.hasArg = false; + pl.push_back(p); return pl; } @@ -92,6 +100,9 @@ if (i->first == "maker-uri") { m_userMakerUri = i->second.c_str(); } + if (i->first == "network") { + m_network = true; + } } } @@ -120,14 +131,23 @@ if (m_rdfDescriptions.find(pluginId) == m_rdfDescriptions.end()) { + if (m_network && !m_networkRetrieved) { + PluginRDFIndexer::getInstance()->indexConfiguredURLs(); + m_networkRetrieved = true; + } + m_rdfDescriptions[pluginId] = PluginRDFDescription(pluginId); if (m_rdfDescriptions[pluginId].haveDescription()) { cerr << "NOTE: Have RDF description for plugin ID \"" << pluginId.toStdString() << "\"" << endl; } else { - cerr << "NOTE: Do not have RDF description for plugin ID \"" + cerr << "NOTE: No RDF description for plugin ID \"" << pluginId.toStdString() << "\"" << endl; + if (!m_network) { + cerr << " Consider using the --rdf-network option to retrieve plugin descriptions" << endl; + cerr << " from the network where possible." << endl; + } } } diff -r c55795627490 -r 4fa2b135acbc rdf/RDFFeatureWriter.h --- a/rdf/RDFFeatureWriter.h Mon Jun 22 17:06:27 2009 +0000 +++ b/rdf/RDFFeatureWriter.h Mon Jun 29 13:44:50 2009 +0000 @@ -120,6 +120,9 @@ bool m_plain; + bool m_network; + bool m_networkRetrieved; + uint64_t m_count; };