0

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 imported into Ontotext GraphBD. My technical knowledge is not high so I wondered if it is possible to connect these two components and if yes how can I do it?

I have on one side a website and on the other an ontology in GraphDB. Now I need that in this website it is possible for example to do CRUD operations so that these operations are also done in the ontology that is in Ontotext GraphDB.

Example: Consult through my website all the individuals present in the ontology.

I in the Ontotext GraphDB workbench through the Sparql queries I get these operations, but I want to do it through the website that I'm doing in HTML, PHP and CSS.

Thanks for your attention.

Best regards

Fred
  • 11
  • 6
  • I don't know a ton about that particular db, but if you go to [packagist](https://packagist.org/search/?q=graphdb%20sparql), there are a few SPARQL related packages you could try using with Composer. – D Lowther May 20 '17 at 15:54
  • What means connect a website with an ontology? An ontology models a domain of interest. You have to be more specific. If you want to query the ontology in the PHP logic of the website, then you can use SPARQL once you loaded the ontology into a SPARQL endpoint of your choice – UninformedUser May 20 '17 at 19:33
  • Let's see if I can explain better. I have on one side a website and on the other an ontology in GraphDB. Now I need that in this website it is possible for example to do CRUD operations so that these operations are also done in the ontology that is in GraphDB. Example: Consult through my website all the individuals present in the ontology. I in the GraphDB workbench through the Sparql queries I get these operations, but I want to do it through the website that I'm doing in HTML, PHP and CSS. – Fred May 20 '17 at 23:47
  • Something like https://packagist.org/packages/rdx/graphdb ? – Spechal May 20 '17 at 23:59
  • Thanks for the sugestion. It sounds interesting but this is for Neo4j and I'm using GraphDB from Ontotext. – Fred May 21 '17 at 13:01

2 Answers2

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.

Fred
  • 11
  • 6
  • While the link may answer your question, it would be helpful if you could add a summary of it into your answer - otherwise your answer becomes useless if that website goes offline. – Jeen Broekstra May 31 '17 at 04:48
0

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.

Median Hilal
  • 1,483
  • 9
  • 17