From: Alexandre P. <al...@pa...> - 2007-08-17 13:27:57
|
On 8/17/07, Richard Cyganiak <ri...@cy...> wrote: > SPARQL Queries that don't use the GRAPH keyword match only the > default graph. Are there any triples in the dataset's default graph? No, I didn't put any triples in it. So, if I understood well, as I want to make both graph and non-graph queries over the same set of statements, each time I add a quad, I also have to add the triple in the default graph, as: // Loop to parse RDF files, identified by $uri $name = $dataset1->getDefaultGraph()->graphName; $dataset1->addQuad(new Quad(new Resource($uri), $statement->subj, $statement->pred, $statement->obj)); $dataset1->addQuad(new Quad(new Resource($name), $statement->subj, $statement->pred, $statement->obj)); But the problem is that queries using GRAPH will return the "original" graph name, but also the defaut graph of the dataset. Is that the only way to do ? Thanks, Alex. > > Cheers, > Richard > > > On 17 Aug 2007, at 10:52, Alexandre Passant wrote: > > > Hi, > > > > I'm trying to use RAP dataset API (v 0.95) with DB persistence, but I > > can't see how to make 'non-graph' queries. > > > > I created my dataset using: > > > > $dbstore = ModelFactory::getDbStore(); > > $dbstore->createTables('MySQL'); > > $dataset1=& $dbstore->getDatasetDb('Dataset1'); > > > > And then parsed some RDF files to add quads in it - BTW, is there a > > way to add quads in the dataset by simply giving a graphURI and a > > fileURI ? > > > > Then I used > > $dataset1->sparqlQuery($query); > > > > to run queries, but while GRAPH queries return something, I have, for > > simple spo queries: > > > > <sparql xmlns="http://www.w3.org/2005/sparql-results#"><head/ > > ><boolean/></sparql> > > > > Did I missed something with datasets / queries ? > > > > Thanks > > > > Alex. > > > > ---------------------------------------------------------------------- > > --- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a > > browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Rdfapi-php-interest mailing list > > Rdf...@li... > > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > > > > |