|
From: <mai...@st...> - 2008-02-27 14:58:54
|
Hi all,
I've been trying to run simple SPARQL query with
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
/**
* @author thanh
* @copyright 2008
*/
// Include all RAP classes
define("RDFAPI_INCLUDE_DIR", "../rdfapi-php/api/");
include(RDFAPI_INCLUDE_DIR . "RdfAPI.php");
echo "<b><font color=blue> test 2!
(Anwendung des SPARQL client:demo.ontowiki.net/service/sparql) </font></b><br
/>";
echo " ";
####################################################
# searchPeople
# sucht nach der Person oder FALSE zurück
####################################################
$client =
ModelFactory::getSparqlClient("http://demo.ontowiki.net/service/sparql");
$querystring = '
select DISTINCT (?o)
where
{?s ?p ?o.}
LIMIT 20 ';
$query = new ClientQuery();
$query->query($querystring);
$query->addDefaultGraph("http://data.semanticweb.org/dumps/conferences/iswc-aswc-2007-complete.rdf");
$result = $client->query($query);
print_r($result);
?>
Am I missing something so obvious here? Can someone help me to fix that problem?
Thanks.
Regards,
Thanh.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
|