0

i was developing a website using php (i used ARC2 library) that uses OWL as a backend like mysql, but i can not query and get any result... please please help :(

here is the full code that i was trying...

<html>

<body>

  <?php
  /* ARC2 static class inclusion */ 
  include_once('arc2-master/ARC2.php');  
 
  $dbpconfig = array(
  "remote_store_endpoint" => "http://localhost/xml/owl/ArsenalFC.owl#",
   );
 
  $store = ARC2::getRemoteStore($dbpconfig); 
 
  if ($errs = $store->getErrors()) {
     echo "<h1>getRemoteSotre error<h1>" ;
  }
 
  $query = '
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    PREFIX ars: <http://localhost/xml/owl/ArsenalFC.owl#>
    SELECT ?subject ?object

      WHERE{ ?subject ars:managedBy ?object}';
  
  /* execute the query */
  $rows = $store->query($query, 'rows'); 
 
    if ($errs = $store->getErrors()) {
       echo "Query errors" ;
       print_r($errs);
    }
  else{
 
    /* display the results in an HTML table */
    echo "<table border='1'>
    <thead>
        <th>Player</th>
        <th>Manager</th>
    </thead>";

    /* loop for each returned row */
    foreach( $rows as $row ) { 
    print "<tr><td>".$row['subject']."</td>
    <td>".$row['object']."</td></tr>";
    }
    echo "</table>";
  }
  ?>
</body>

</html>

0 Answers0