comparison rdf/RDFImporter.cpp @ 736:31ab733841d0 dataquay

A few bugfixes in RDF import and export
author Chris Cannam
date Thu, 24 May 2012 13:25:21 +0100
parents 27c861cce97b
children 547b03533375
comparison
equal deleted inserted replaced
734:79c0955f559c 736:31ab733841d0
140 m_store->addPrefix("tl", Uri("http://purl.org/NET/c4dm/timeline.owl#")); 140 m_store->addPrefix("tl", Uri("http://purl.org/NET/c4dm/timeline.owl#"));
141 m_store->addPrefix("event", Uri("http://purl.org/NET/c4dm/event.owl#")); 141 m_store->addPrefix("event", Uri("http://purl.org/NET/c4dm/event.owl#"));
142 m_store->addPrefix("rdfs", Uri("http://www.w3.org/2000/01/rdf-schema#")); 142 m_store->addPrefix("rdfs", Uri("http://www.w3.org/2000/01/rdf-schema#"));
143 143
144 //!!! may throw! 144 //!!! may throw!
145 m_store->import(QUrl::fromLocalFile(uri), BasicStore::ImportIgnoreDuplicates); 145 QUrl url;
146 if (uri.startsWith("file:")) {
147 url = QUrl(uri);
148 } else {
149 url = QUrl::fromLocalFile(uri);
150 }
151 m_store->import(url, BasicStore::ImportIgnoreDuplicates);
146 } 152 }
147 153
148 RDFImporterImpl::~RDFImporterImpl() 154 RDFImporterImpl::~RDFImporterImpl()
149 { 155 {
150 delete m_store; 156 delete m_store;
845 } 851 }
846 852
847 SVDEBUG << "NOTE: RDFImporter::identifyDocumentType: haveAudio = " 853 SVDEBUG << "NOTE: RDFImporter::identifyDocumentType: haveAudio = "
848 << haveAudio << endl; 854 << haveAudio << endl;
849 855
850 n = store->complete(Triple(Node(), store->expand("event:time"), Node())); 856 // can't call complete() with two Nothing nodes
857 n = store->matchOnce(Triple(Node(), store->expand("event:time"), Node())).c;
851 if (n != Node()) { 858 if (n != Node()) {
852 haveAnnotations = true; 859 haveAnnotations = true;
853 } 860 }
854 861
855 if (!haveAnnotations) { 862 if (!haveAnnotations) {
856 n = store->complete(Triple(Node(), store->expand("af:signal_feature"), Node())); 863 // can't call complete() with two Nothing nodes
864 n = store->matchOnce(Triple(Node(), store->expand("af:signal_feature"), Node())).c;
857 if (n != Node()) { 865 if (n != Node()) {
858 haveAnnotations = true; 866 haveAnnotations = true;
859 } 867 }
860 } 868 }
861 869