Hi,
I've been trying to run simple SPARQL query without success against D2RQ
Sparql endpoint and SparqlClient (RAP-0.95/PHP5). The query is a simple
SELECT... doesn't give the result in array but errors our with the message
"unable to parse result". But the query output is dumped as a long string
following the error message. Here is the code snippet...
<?php
// Include all RAP classes
define("RDFAPI_INCLUDE_DIR", "./rdfapi-php/api/");
include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
// Create a SPARQL client
$client = ModelFactory::getSparqlClient("http://dkd2ctbpilot:8080/d2r/sparql
");
$querystring = '
PREFIX vocab: <http://dkd2ctbpilot:8080/d2r/resource/vocab/>
PREFIX db: <http://dkd2ctbpilot:8080/d2r/resource/>
SELECT DISTINCT ?org
WHERE { ?orgResource vocab:Orgs_Name ?org
}'
;
$query = new ClientQuery();
$query->query($querystring);
$result = $client->query($query);
echo count($result);
print_r($result);
?>
Am I missing something so obvious here? I'm a newbie to PHP and any
suggestion or comment on this issue is greatly appreciated.
Thanks.
Regards,
Raj Kathamuthu
|