diff rdf/RDFFeatureWriter.cpp @ 586:4ab8e8f7d7ed

* Replace not very useful signal-uri option with more useful audiofile-uri
author Chris Cannam
date Wed, 13 May 2009 12:49:22 +0000
parents cbc884787a08
children 94054c97c76a
line wrap: on
line diff
--- a/rdf/RDFFeatureWriter.cpp	Fri May 08 10:09:47 2009 +0000
+++ b/rdf/RDFFeatureWriter.cpp	Wed May 13 12:49:22 2009 +0000
@@ -55,8 +55,8 @@
     p.hasArg = false;
     pl.push_back(p);
 
-    p.name = "signal-uri";
-    p.description = "Link the output RDF to the given signal URI.";
+    p.name = "audiofile-uri";
+    p.description = "Link the output RDF to the given audio file URI instead of its actual location.";
     p.hasArg = true;
     pl.push_back(p);
     
@@ -73,7 +73,7 @@
         if (i->first == "plain") {
             m_plain = true;
         }
-        if (i->first == "signal-uri") {
+        if (i->first == "audiofile-uri") {
             m_suri = i->second.c_str();
         }
     }
@@ -252,10 +252,6 @@
     if (m_trackSignalURIs.find(trackId) == m_trackSignalURIs.end()) {
         m_trackSignalURIs[trackId] = QString(":signal_%1").arg(signalCount);
     }
-
-    if (m_suri != NULL) {
-        m_trackSignalURIs[trackId] = "<" + m_suri + ">";
-    }
     QString signalURI = m_trackSignalURIs[trackId];
    
     if (m_trackTrackURIs.find(trackId) == m_trackTrackURIs.end()) {
@@ -268,6 +264,9 @@
     }
     QString timelineURI = m_trackTimelineURIs[trackId];
 
+    QString afURI = url.toEncoded().data();
+    if (m_suri != NULL) afURI = m_suri;
+
     if (m_metadata.find(trackId) != m_metadata.end()) {
         TrackMetadata tm = m_metadata[trackId];
         if (tm.title != "" || tm.maker != "") {
@@ -287,14 +286,14 @@
                 stream << ";\n    foaf:maker [ a mo:MusicArtist; foaf:name \"\"\"" << tm.maker << "\"\"\" ] ";
             }
             if (trackId != "") {
-                stream << ";\n    mo:available_as <" << url.toEncoded().data() << "> ";
+                stream << ";\n    mo:available_as <" << afURI << "> ";
             }
             stream << ".\n\n";
         }
     }
 
     if (trackId != "") {
-        stream << "<" << url.toEncoded().data() << "> a mo:AudioFile ;\n";
+        stream << "<" << afURI << "> a mo:AudioFile ;\n";
         stream << "    mo:encodes " << signalURI << ".\n\n";
     }