From: Stefan E. <ste...@ge...> - 2006-06-22 12:13:01
|
Hello, I have a question about the SparqlEngine in the case when DbModel is used for RDF storage. What do you think about replacing the following code in SparqlEngine->matchPattern $resultSet = $this->findTuplesMatchingOnePattern($qt[0], $newGraphList); for ($i=1; $i<count($qt); $i++) { $rs = $this->findTuplesMatchingOnePattern($qt[$i], $newGraphList); $resultSet = $this->joinTuples($resultSet, $rs); if(!$resultSet) break; } if($finalRes != null){ $finalRes = $this->joinTuples($finalRes,$resultSet); }else{ $finalRes = $resultSet; } by some code which generates a single SQL-Statement which would translate SPAQL-Queries like PREFIX vcard <http://www.w3.org/2001/vcard-rdf/3.0#> SELECT ?fullName ?age ?telval ?tel WHERE { ?x vcard:age ?age . ?x vcard:FN ?fullName. ?x vcard:TEL ?tel. ?tel rdf:value ?telval} into SQL-Queries like select t0.object as age, t0.object_is as age_type, t1.object as fullName, t1.object_is as fullName_type, t2.object as tel, t2.object_is as tel_type, t3.object as telval, t3.object_is as telval_type from statements as t0 join statements as t1 on t0.subject=t1.subject join statements as t2 on t0.subject=t2.subject join statements as t3 on t2.object=t3.subject where 1=1 and t0.predicate = 'http://www.w3.org/2001/vcard-rdf/3.0#age' and t1.predicate = 'http://www.w3.org/2001/vcard-rdf/3.0#FN' and t2.predicate = 'http://www.w3.org/2001/vcard-rdf/3.0#TEL' and t3.predicate = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#value' ? I have done some basic work into this direction but I want to know what you think about such a modification? With kind regards Stefan Erras |