How to execute SPARQL Select query using EasyRdf locally in PHP?

666 Views Asked by At

I have JSON-LD data on URL http://mystore.com/data1 . I want to execute SPARQL SELECT query in PHP.
Here is my code :

$sparql = new EasyRdf_Sparql_Client('http://mystore.com/data1');
$result = $sparql->query(
    'SELECT *
        WHERE {
          ?operation <http://www.w3.org/ns/hydra/core#template> ?templateValue.
        }'
);
print_r($result);

Above code showing all JSON-LD triples instead of filtered data based on query.

After reading docs , I have doubt . In above code params in EasyRdf_Sparql_Client should be Sparql Endpoint while I am sending data URL. Am I doing correct ? I think Sparql Endpoint is SPARQL query engine which I deduce after referring this standard example , it have dbpedia url which is Virtuoso SPARQL Query Editor. I want run SPARQL SELECT on my local/remote JSON-LD data. How to do that in php?

0

There are 0 best solutions below