Mercurial > hg > svcore
comparison rdf/SimpleSPARQLQuery.cpp @ 461:2019d89ebcf9
* Some work on querying and cacheing plugin RDF from a central index
author | Chris Cannam |
---|---|
date | Fri, 17 Oct 2008 15:26:29 +0000 |
parents | ef14acd6d102 |
children | 3ffce691c9bf |
comparison
equal
deleted
inserted
replaced
460:93fb1ebff76b | 461:2019d89ebcf9 |
---|---|
20 #include <rasqal/rasqal.h> | 20 #include <rasqal/rasqal.h> |
21 #else | 21 #else |
22 #include <rasqal.h> | 22 #include <rasqal.h> |
23 #endif | 23 #endif |
24 | 24 |
25 //#define DEBUG_SIMPLE_SPARQL_QUERY 1 | |
26 | |
25 #include <iostream> | 27 #include <iostream> |
26 | 28 |
27 using std::cerr; | 29 using std::cerr; |
28 using std::endl; | 30 using std::endl; |
29 | 31 |
119 SimpleSPARQLQuery::Impl::Impl(QString query) : | 121 SimpleSPARQLQuery::Impl::Impl(QString query) : |
120 m_query(query), | 122 m_query(query), |
121 m_reporter(0), | 123 m_reporter(0), |
122 m_cancelled(false) | 124 m_cancelled(false) |
123 { | 125 { |
124 // std::cerr << "SimpleSPARQLQuery::Impl: Query is: \"" << query.toStdString() << "\"" << std::endl; | 126 #ifdef DEBUG_SIMPLE_SPARQL_QUERY |
127 std::cerr << "SimpleSPARQLQuery::Impl: Query is: \"" << query.toStdString() << "\"" << std::endl; | |
128 #endif | |
125 } | 129 } |
126 | 130 |
127 SimpleSPARQLQuery::Impl::~Impl() | 131 SimpleSPARQLQuery::Impl::~Impl() |
128 { | 132 { |
129 } | 133 } |
232 if (literal->type == RASQAL_LITERAL_URI) type = URIValue; | 236 if (literal->type == RASQAL_LITERAL_URI) type = URIValue; |
233 else if (literal->type == RASQAL_LITERAL_BLANK) type = BlankValue; | 237 else if (literal->type == RASQAL_LITERAL_BLANK) type = BlankValue; |
234 | 238 |
235 QString text = (const char *)rasqal_literal_as_string(literal); | 239 QString text = (const char *)rasqal_literal_as_string(literal); |
236 | 240 |
241 #ifdef DEBUG_SIMPLE_SPARQL_QUERY | |
237 std::cerr << i << ". " << key.toStdString() << " -> " << text.toStdString() << " (type " << type << ")" << std::endl; | 242 std::cerr << i << ". " << key.toStdString() << " -> " << text.toStdString() << " (type " << type << ")" << std::endl; |
243 #endif | |
238 | 244 |
239 resultmap[key] = Value(type, text); | 245 resultmap[key] = Value(type, text); |
240 } | 246 } |
241 | 247 |
242 list.push_back(resultmap); | 248 list.push_back(resultmap); |