changeset 736:31ab733841d0 dataquay

A few bugfixes in RDF import and export
author Chris Cannam
date Thu, 24 May 2012 13:25:21 +0100
parents 79c0955f559c
children 403a8064aceb
files rdf/RDFExporter.cpp rdf/RDFFeatureWriter.cpp rdf/RDFImporter.cpp
diffstat 3 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rdf/RDFExporter.cpp	Wed May 23 17:14:57 2012 +0100
+++ b/rdf/RDFExporter.cpp	Thu May 24 13:25:21 2012 +0100
@@ -172,6 +172,6 @@
 QString
 RDFExporter::getSupportedExtensions()
 {
-    return "*.n3 *.ttl";
+    return "*.ttl *.n3";
 }
 
--- a/rdf/RDFFeatureWriter.cpp	Wed May 23 17:14:57 2012 +0100
+++ b/rdf/RDFFeatureWriter.cpp	Thu May 24 13:25:21 2012 +0100
@@ -391,7 +391,7 @@
            << "        tl:onTimeLine "
            << timelineURI << "\n    ] .\n\n";
 
-    stream << timelineURI << " a tl:Timeline .\n";
+    stream << timelineURI << " a tl:Timeline .\n\n";
 } 
 
 void
--- a/rdf/RDFImporter.cpp	Wed May 23 17:14:57 2012 +0100
+++ b/rdf/RDFImporter.cpp	Thu May 24 13:25:21 2012 +0100
@@ -142,7 +142,13 @@
     m_store->addPrefix("rdfs", Uri("http://www.w3.org/2000/01/rdf-schema#"));
 
     //!!! may throw!
-    m_store->import(QUrl::fromLocalFile(uri), BasicStore::ImportIgnoreDuplicates);
+    QUrl url;
+    if (uri.startsWith("file:")) {
+        url = QUrl(uri);
+    } else {
+        url = QUrl::fromLocalFile(uri);
+    }
+    m_store->import(url, BasicStore::ImportIgnoreDuplicates);
 }
 
 RDFImporterImpl::~RDFImporterImpl()
@@ -847,13 +853,15 @@
     SVDEBUG << "NOTE: RDFImporter::identifyDocumentType: haveAudio = "
               << haveAudio << endl;
 
-    n = store->complete(Triple(Node(), store->expand("event:time"), Node()));
+    // can't call complete() with two Nothing nodes
+    n = store->matchOnce(Triple(Node(), store->expand("event:time"), Node())).c;
     if (n != Node()) {
         haveAnnotations = true;
     }
 
     if (!haveAnnotations) {
-        n = store->complete(Triple(Node(), store->expand("af:signal_feature"), Node()));
+        // can't call complete() with two Nothing nodes
+        n = store->matchOnce(Triple(Node(), store->expand("af:signal_feature"), Node())).c;
         if (n != Node()) {
             haveAnnotations = true;
         }