Skip to content Skip to sidebar Skip to footer

Website (html/php) Possible Link To Graphdb?

In the course of a master's thesis I developed an ontology which I imported into Ontotext GraphDB. At this point I need to connect a website (HTML / PHP) with the ontology I import

Solution 1:

I think I solved my problem with this here.

In general, you need to download Semsol's ARC2 library.

Then you create the php file with a structure like this:

<?php/* ARC2 static class inclusion */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 = '...';

  /* execute the query */$rows = $store->query($query, 'rows'); 

    if ($errs = $store->getErrors()) {
       echo"Query errors" ;
       print_r($errs);
    }

    /* display the results in an HTML table */echo"..."?>

I thank everyone who tried to help me.

Solution 2:

You need to somehow query your GraphDB from your PHP application using a remote sparql service. If this is what you want, in java, this can be easily done using Jena QueryExecutionFactory.sparqlService method.

However, a simple googling for PHP results in A PHP forward proxy for remote access to SPARQL endpoints. Where you can send queries and receive results from a SPARQL endpoint, I guess this is what you actually need.

Furthermore, this link gives you multiple options for SPARQL implementations including some php ones.

Post a Comment for "Website (html/php) Possible Link To Graphdb?"