# HG changeset patch # User Chris Cannam # Date 1223384395 0 # Node ID d8a2c28ba9f698fe808b185c905bf2ebd89e168d # Parent a75edaa08d28f44558a17f64318f2b1109623d0d * Query range before time (in case time component of range turns out to be synonymous with time component of time) diff -r a75edaa08d28 -r d8a2c28ba9f6 rdf/RDFImporter.cpp --- a/rdf/RDFImporter.cpp Tue Oct 07 12:42:17 2008 +0000 +++ b/rdf/RDFImporter.cpp Tue Oct 07 12:59:55 2008 +0000 @@ -519,27 +519,23 @@ QString label = SimpleSPARQLQuery::singleResultQuery (labelQueryString.arg(thinguri), "label").value; - QString timestring = SimpleSPARQLQuery::singleResultQuery - (timeQueryString.arg(thinguri), "time").value; - - if (timestring != "") { - - time = RealTime::fromXsdDuration(timestring.toStdString()); + SimpleSPARQLQuery rangeQuery(rangeQueryString.arg(thinguri)); + SimpleSPARQLQuery::ResultList rangeResults = rangeQuery.execute(); + if (!rangeResults.empty()) { +// std::cerr << rangeResults.size() << " range results" << std::endl; + time = RealTime::fromXsdDuration + (rangeResults[0]["time"].value.toStdString()); + duration = RealTime::fromXsdDuration + (rangeResults[0]["duration"].value.toStdString()); +// std::cerr << "duration string " << rangeResults[0]["duration"].value.toStdString() << std::endl; haveTime = true; - + haveDuration = true; } else { - - SimpleSPARQLQuery rangeQuery(rangeQueryString.arg(thinguri)); - SimpleSPARQLQuery::ResultList rangeResults = rangeQuery.execute(); - if (!rangeResults.empty()) { -// std::cerr << rangeResults.size() << " range results" << std::endl; - time = RealTime::fromXsdDuration - (rangeResults[0]["time"].value.toStdString()); - duration = RealTime::fromXsdDuration - (rangeResults[0]["duration"].value.toStdString()); -// std::cerr << "duration string " << rangeResults[0]["duration"].value.toStdString() << std::endl; + QString timestring = SimpleSPARQLQuery::singleResultQuery + (timeQueryString.arg(thinguri), "time").value; + if (timestring != "") { + time = RealTime::fromXsdDuration(timestring.toStdString()); haveTime = true; - haveDuration = true; } }