diff rdf/RDFFeatureWriter.cpp @ 500:83eae5239db6

* Permit viewing (though not editing) colour 3d plot layer data in the spreadsheet data viewer dialog * Add somewhat simplistic RDF export for layers * Fix display of peak frequencies in spectrum layer * Fix (I hope) sizing of plugin parameter dialog
author Chris Cannam
date Tue, 02 Dec 2008 17:17:25 +0000
parents fdf5930b7ccc
children 3376dc26dece
line wrap: on
line diff
--- a/rdf/RDFFeatureWriter.cpp	Fri Nov 28 15:45:20 2008 +0000
+++ b/rdf/RDFFeatureWriter.cpp	Tue Dec 02 17:17:25 2008 +0000
@@ -221,11 +221,18 @@
     }
     QString timelineURI = m_trackTimelineURIs[trackId];
 
-    stream << "\n<" << url.toEncoded().data() << "> a mo:AudioFile .\n\n"
-           << signalURI << " a mo:Signal ;\n"
-           << "    mo:available_as <" << url.toEncoded().data()
-           << "> ;\n"
-           << "    mo:time [\n"
+    if (trackId != "") {
+        stream << "\n<" << url.toEncoded().data() << "> a mo:AudioFile .\n\n";
+    }
+
+    stream << signalURI << " a mo:Signal ;\n";
+
+    if (trackId != "") {
+        stream << "    mo:available_as <" << url.toEncoded().data()
+               << "> ;\n";
+    }
+
+    stream << "    mo:time [\n"
            << "        a tl:Interval ;\n"
            << "        tl:onTimeLine "
            << timelineURI << "\n    ] .\n\n";
@@ -284,8 +291,10 @@
         m_transformURIs[transform] = transformUri;
     }
 
-    stream << RDFTransformFactory::writeTransformToRDF(transform, transformUri)
-           << endl;
+    if (transform.getIdentifier() != "") {
+        stream << RDFTransformFactory::writeTransformToRDF(transform, transformUri)
+               << endl;
+    }
 
     if (needEventType) {
 
@@ -388,8 +397,10 @@
                    << "S\"^^xsd:duration ;\n    ] ";
         }
 
-        stream << ";\n";
-        stream << "    vamp:computed_by " << m_transformURIs[transform] << " ";
+        if (transform.getIdentifier() != "") {
+            stream << ";\n";
+            stream << "    vamp:computed_by " << m_transformURIs[transform] << " ";
+        }
 
         if (feature.label.length() > 0) {
             stream << ";\n";