Getting statements from redland hash storage

131 Views Asked by At

Is librdf_model_add writing the statements into the hash-storage?

I am having problem to run a sparql query to retrieve them. The db files are probably populated as their file size keep increasing, but when I attempt to perform sparql query to them I don't seem to get any result. Do I need to load the statements from the storage into the model manually before issuing a query?

the statement that issue the query

$query = librdf_new_query(
    $world,
    'sparql',
    NULL,
<<<SPARQL
PREFIX sensei: <http://coolsilon.com/flickr_schema/>
SELECT  ?a ?c
WHERE   {?a ?b ?c}
SPARQL
    ,
    NULL
);
$result = librdf_query_execute($query, $model);
var_dump(librdf_query_results_get_count($result)); // returns 0

I am using PHP (5.3.5) language binding, and my redland version is 1.0.12 running under Ubuntu Natty.

p/s: I checked again with postgresql storage, and the above code works :/

1

There are 1 best solutions below

4
On

This is better asked on semantic overflow or the redland-dev list.

The most likely thing is the model has no data.

Use some of the librdf functions to print out the model or use a serializer.

Try the test.php for pointers in https://github.com/dajobe/redland-bindings/tree/master/php