comparison rdf/RDFImporter.cpp @ 492:23945cdd7161

* Update RDF query stuff again so as to set up a temporary datastore each time we want to query over an rdf file, instead of using rasqal against the file. Seems the only way to avoid threading and storage management issues when trying to load from a single-source file and perform queries against our main datastore at the same time. Maybe.
author Chris Cannam
date Mon, 24 Nov 2008 16:26:11 +0000
parents c3fb8258e34d
children 3931711b5671
comparison
equal deleted inserted replaced
491:6f8ee19984ad 492:23945cdd7161
123 (SimpleSPARQLQuery::QueryFromSingleSource, 123 (SimpleSPARQLQuery::QueryFromSingleSource,
124 QString 124 QString
125 (" PREFIX mo: <http://purl.org/ontology/mo/> " 125 (" PREFIX mo: <http://purl.org/ontology/mo/> "
126 " SELECT ?url FROM <%1> " 126 " SELECT ?url FROM <%1> "
127 " WHERE { ?signal a mo:Signal ; mo:available_as ?url } " 127 " WHERE { ?signal a mo:Signal ; mo:available_as ?url } "
128 ).arg(uri), 128 ).arg(m_uristring),
129 "url"); 129 "url");
130 130
131 if (value.type == SimpleSPARQLQuery::URIValue) { 131 if (value.type == SimpleSPARQLQuery::URIValue) {
132 m_audioAvailableAt = value.value; 132 m_audioAvailableAt = value.value;
133 } 133 }
134 } 134 }
135 135
136 RDFImporterImpl::~RDFImporterImpl() 136 RDFImporterImpl::~RDFImporterImpl()
137 { 137 {
138 SimpleSPARQLQuery::closeSingleSource(m_uristring);
138 } 139 }
139 140
140 bool 141 bool
141 RDFImporterImpl::isOK() 142 RDFImporterImpl::isOK()
142 { 143 {
662 long fduration, 663 long fduration,
663 bool haveDuration, 664 bool haveDuration,
664 std::vector<float> &values, 665 std::vector<float> &values,
665 QString label) 666 QString label)
666 { 667 {
668 std::cerr << "RDFImporterImpl::fillModel: adding point at frame " << ftime << std::endl;
669
667 SparseOneDimensionalModel *sodm = 670 SparseOneDimensionalModel *sodm =
668 dynamic_cast<SparseOneDimensionalModel *>(model); 671 dynamic_cast<SparseOneDimensionalModel *>(model);
669 if (sodm) { 672 if (sodm) {
670 SparseOneDimensionalModel::Point point(ftime, label); 673 SparseOneDimensionalModel::Point point(ftime, label);
671 sodm->addPoint(point); 674 sodm->addPoint(point);
800 return Annotations; 803 return Annotations;
801 } else { 804 } else {
802 return OtherDocument; 805 return OtherDocument;
803 } 806 }
804 } 807 }
805 } 808
806 809 SimpleSPARQLQuery::closeSingleSource(url);
807 810 }
811
812