comparison rdf/PluginRDFDescription.cpp @ 462:957e6a5c8495

* Add More Info URL to plugin finder
author Chris Cannam
date Thu, 23 Oct 2008 16:30:48 +0000
parents 2019d89ebcf9
children 93806ad9481e
comparison
equal deleted inserted replaced
461:2019d89ebcf9 462:957e6a5c8495
73 73
74 QString 74 QString
75 PluginRDFDescription::getPluginMaker() const 75 PluginRDFDescription::getPluginMaker() const
76 { 76 {
77 return m_pluginMaker; 77 return m_pluginMaker;
78 }
79
80 QString
81 PluginRDFDescription::getPluginInfoURL() const
82 {
83 return m_pluginInfoURL;
78 } 84 }
79 85
80 QStringList 86 QStringList
81 PluginRDFDescription::getOutputIds() const 87 PluginRDFDescription::getOutputIds() const
82 { 88 {
230 236
231 if (v.type == SimpleSPARQLQuery::LiteralValue && v.value != "") { 237 if (v.type == SimpleSPARQLQuery::LiteralValue && v.value != "") {
232 m_pluginMaker = v.value; 238 m_pluginMaker = v.value;
233 } 239 }
234 240
241 // If we have a more-information URL for this plugin, then we take
242 // that. Otherwise, a more-inforomation URL for the plugin
243 // library would do nicely. Failing that, we could perhaps use
244 // any foaf:page URL at all that appears in the file -- but
245 // perhaps that would be unwise
246
247 v = SimpleSPARQLQuery::singleResultQuery
248 (QString(
249 " PREFIX vamp: <http://purl.org/ontology/vamp/> "
250 " PREFIX foaf: <http://xmlns.com/foaf/0.1/> "
251 " SELECT ?page from <%1> "
252 " WHERE { "
253 " ?plugin a vamp:Plugin ; "
254 " vamp:identifier \"%2\" ; "
255 " foaf:page ?page . "
256 " }")
257 .arg(url)
258 .arg(label), "page");
259
260 if (v.type == SimpleSPARQLQuery::URIValue && v.value != "") {
261
262 m_pluginInfoURL = v.value;
263
264 } else {
265
266 v = SimpleSPARQLQuery::singleResultQuery
267 (QString(
268 " PREFIX vamp: <http://purl.org/ontology/vamp/> "
269 " PREFIX foaf: <http://xmlns.com/foaf/0.1/> "
270 " SELECT ?page from <%1> "
271 " WHERE { "
272 " ?library a vamp:PluginLibrary ; "
273 " vamp:available_plugin ?plugin ; "
274 " foaf:page ?page . "
275 " ?plugin a vamp:Plugin ; "
276 " vamp:identifier \"%2\" . "
277 " }")
278 .arg(url)
279 .arg(label), "page");
280
281 if (v.type == SimpleSPARQLQuery::URIValue && v.value != "") {
282
283 m_pluginInfoURL = v.value;
284 }
285 }
286
235 return true; 287 return true;
236 } 288 }
237 289
238 bool 290 bool
239 PluginRDFDescription::indexOutputs(QString url, QString label) 291 PluginRDFDescription::indexOutputs(QString url, QString label)