I'm trying to get information from my local ontology on GraphDB with a PHP script.
Online I've only found this this, so I've tried to adapt it to my necessities.
// ARC2 static class inclusion
include_once('semsol/ARC2.php');
$dbpconfig = array(
"remote_store_endpoint" => "http://localhost:7200/sparql",
);
$store = ARC2::getRemoteStore($dbpconfig);
if ($errs = $store->getErrors()) {
echo "<h1>getRemoteSotre error<h1>" ;
};
$query = 'PREFIX aplm: <http://www.andareperlomondo.it/rdf/ontologia.rdf#>
select * where {
?s aplm:nomeCognome ?o .
}';
// execute the query
$rows = $store->query($query, 'rows');
if ($errs = $store->getErrors()) {
echo "Query errors\n" ;
print_r($errs);
};
// display the results in an HTML table
foreach ($rows as $value) {
echo $value;
};
However, the connection doesn't work and in PHP prints the following error:
Array (
[0] => 404 "Not Found (HTTP status 404)..." in ARC2_Reader
[1] => missing stream in "getFormat" via ARC2_Reader
[2] => missing stream in "readStream" http://localhost:7200/sparql?query=%0APREFIX+aplm%3A+%3Chttp%3A%2F%2Fwww.andareperlomondo.it%2Frdf%2Fontologia.rdf%23%3E%0A%09%09%09%09%09%09%09%09select+%2A+where+%7B+%0A%09%09%09%09%09%09%09%09%09%3Fs+aplm%3AnomeCognome+%3Fo+.%0A%09%09%09%09%09%09%09%09%7D via ARC2_Reader
)
What shuld I do?