diff rdf/SimpleSPARQLQuery.cpp @ 493:3931711b5671

* RDF importer: add model titles where possible * RDF transform factory: report whether something appears to be RDF or not (so we can avoid trying to load it as something else if the RDF query fails)
author Chris Cannam
date Tue, 25 Nov 2008 13:43:56 +0000
parents 23945cdd7161
children 81963c51b488
line wrap: on
line diff
--- a/rdf/SimpleSPARQLQuery.cpp	Mon Nov 24 16:26:11 2008 +0000
+++ b/rdf/SimpleSPARQLQuery.cpp	Tue Nov 25 13:43:56 2008 +0000
@@ -165,13 +165,19 @@
 void
 WredlandWorldWrapper::freeModel(QString forUri)
 {
+#ifdef DEBUG_SIMPLE_SPARQL_QUERY
+    std::cerr << "SimpleSPARQLQuery::freeModel: Model uri = \"" << forUri.toStdString() << "\"" << std::endl;
+#endif
+
     QMutexLocker locker(&m_mutex);
     if (forUri == "") {
         std::cerr << "SimpleSPARQLQuery::freeModel: ERROR: Can't free default model" << std::endl;
         return;
     }
     if (m_ownModelUris.find(forUri) == m_ownModelUris.end()) {
-        std::cerr << "SimpleSPARQLQuery::freeModel: ERROR: Never heard of this model (uri = \"" << forUri.toStdString() << "\")" << std::endl;
+#ifdef DEBUG_SIMPLE_SPARQL_QUERY
+        std::cerr << "SimpleSPARQLQuery::freeModel: NOTE: Unknown or already-freed model (uri = \"" << forUri.toStdString() << "\")" << std::endl;
+#endif
         return;
     }
 
@@ -408,11 +414,13 @@
     ResultList list;
     librdf_query *query;
 
+#ifdef DEBUG_SIMPLE_SPARQL_QUERY
     static std::map<QString, int> counter;
     if (counter.find(m_query) == counter.end()) counter[m_query] = 1;
     else ++counter[m_query];
     std::cerr << "Counter for this query: " << counter[m_query] << std::endl;
     std::cerr << "Base URI is: \"" << modelUri.toStdString() << "\"" << std::endl;
+#endif
 
     {
         Profiler p("SimpleSPARQLQuery: Prepare LIBRDF query");