# HG changeset patch
# User Chris Cannam
# Date 1242221408 0
# Node ID d04b8674b71022934ee62633fd219454f30d52c8
# Parent 94054c97c76ac5e07240b66c9ede60d7b5d5eec9
* Try to identify the properly conformant audio file structure written out
by Sonic Annotator (but we still don't actually import it yet)
diff -r 94054c97c76a -r d04b8674b710 rdf/RDFImporter.cpp
--- a/rdf/RDFImporter.cpp Wed May 13 12:59:07 2009 +0000
+++ b/rdf/RDFImporter.cpp Wed May 13 13:30:08 2009 +0000
@@ -947,18 +947,41 @@
return NotRDF;
}
+ // "MO-conformant" structure for audio files
+
SimpleSPARQLQuery::Value value =
SimpleSPARQLQuery::singleResultQuery
(SimpleSPARQLQuery::QueryFromSingleSource,
QString
(" PREFIX mo: "
" SELECT ?url FROM <%1> "
- " WHERE { ?signal a mo:Signal ; mo:available_as ?url } "
+ " WHERE { ?url a mo:AudioFile } "
).arg(url),
"url");
if (value.type == SimpleSPARQLQuery::URIValue) {
+
haveAudio = true;
+
+ } else {
+
+ // Sonic Annotator v0.2 and below used to write this structure
+ // (which is not properly in conformance with the Music
+ // Ontology)
+
+ value =
+ SimpleSPARQLQuery::singleResultQuery
+ (SimpleSPARQLQuery::QueryFromSingleSource,
+ QString
+ (" PREFIX mo: "
+ " SELECT ?url FROM <%1> "
+ " WHERE { ?signal a mo:Signal ; mo:available_as ?url } "
+ ).arg(url),
+ "url");
+
+ if (value.type == SimpleSPARQLQuery::URIValue) {
+ haveAudio = true;
+ }
}
value =