Mercurial > hg > svcore
comparison rdf/SimpleSPARQLQuery.cpp @ 511:7207e3eba44f sv-v1.4rc1
* Ensure SimpleSPARQLQuery stores an error string properly when query
fails -- so (apart from anything else) RDFImporter::identifyDocumentType
returns a sensible result for non-RDF
| author | Chris Cannam |
|---|---|
| date | Mon, 08 Dec 2008 15:08:39 +0000 |
| parents | 0944d13689b2 |
| children | 8878efd21dbc |
comparison
equal
deleted
inserted
replaced
| 510:af7b6e55895b | 511:7207e3eba44f |
|---|---|
| 447 Profiler p("SimpleSPARQLQuery: Execute LIBRDF query"); | 447 Profiler p("SimpleSPARQLQuery: Execute LIBRDF query"); |
| 448 results = librdf_query_execute(query, m_redland.getModel(modelUri)); | 448 results = librdf_query_execute(query, m_redland.getModel(modelUri)); |
| 449 } | 449 } |
| 450 | 450 |
| 451 if (!results) { | 451 if (!results) { |
| 452 cerr << "SimpleSPARQLQuery: LIBRDF query failed" << endl; | 452 m_errorString = "RDF query failed"; |
| 453 librdf_free_query(query); | 453 librdf_free_query(query); |
| 454 return list; | 454 return list; |
| 455 } | 455 } |
| 456 | 456 |
| 457 if (!librdf_query_results_is_bindings(results)) { | 457 if (!librdf_query_results_is_bindings(results)) { |
| 458 cerr << "SimpleSPARQLQuery: LIBRDF query has wrong result type (not bindings)" << endl; | 458 m_errorString = "RDF query returned non-bindings results"; |
| 459 librdf_free_query_results(results); | 459 librdf_free_query_results(results); |
| 460 librdf_free_query(query); | 460 librdf_free_query(query); |
| 461 return list; | 461 return list; |
| 462 } | 462 } |
| 463 | 463 |
