I am working on a semantic web project where I want to query an ontology to retrieve saved classes or instances in this ontology using php to display them in a web page. I find some examples but they did not work in my case
So I have tried two libs in php once called ARC2.php and the other sparqllib.php but I got no results
require_once( "sparqllib.php" );
$db = sparql_connect( "http://sparql.data.southampton.ac.uk/" );
if( !$db ) { print sparql_errno() . ": " . sparql_error(). "
"; exit; }
sparql_ns( "rooms","http://vocab.deri.ie/rooms#" );
$sparql = "SELECT DISTINCT * WHERE { ?room a rooms:Building . ?room rdfs:label ?label } LIMIT 5";
$result = sparql_query( $sparql );
/////////////////////////////////
include_once('semsol/ARC2.php');
$dbpconfig = array(
"remote_store_endpoint" => "http://dbpedia.org/sparql",
);
$store = ARC2::getRemoteStore($dbpconfig);
if ($errs = $store->getErrors()) {
echo "<h1>getRemoteSotre error<h1>" ;
}
$query = '';
$rows = $store->query($query, 'rows');
So with the first one i have got an error look like this : -1: Didn't even see a sparql element, is this really an endpoint? because i don't even know how to remplace $db = sparql_connect( "" ); with my local ontology or what ? And for the second code i don't know if i got an empety result or no result knowing that my query is coorect need help please