0

在硕士论文的过程中,我开发了一个本体,并将其导入 Ontotext GraphDB。此时我需要将一个网站(HTML / PHP)与我导入到 Ontotext GraphBD 中的本体连接起来。我的技术知识不高,所以我想知道是否可以连接这两个组件,如果可以,我该怎么做?

我一方面有一个网站,另一方面在 GraphDB 中有一个本体。现在我需要在这个网站上,例如可以进行 CRUD 操作,以便这些操作也可以在 Ontotext GraphDB 中的本体中完成。

示例:通过我的网站咨询存在于本体中的所有个人。

我在 Ontotext GraphDB 工作台中通过 Sparql 查询获得了这些操作,但我想通过我在 HTML、PHP 和 CSS 中做的网站来完成。

感谢您的关注。

此致

4

2 回答 2

1

我想我在这里解决了我的问题。

一般来说,您需要下载 Semsol 的 ARC2 库。

然后创建具有如下结构的 php 文件:

<?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 "..." 

  ?>

我感谢所有试图帮助我的人。

于 2017-05-26T18:19:01.023 回答
0

您需要使用远程 sparql 服务以某种方式从您的 PHP 应用程序查询您的 GraphDB。如果这是您想要的,在 java 中,这可以使用 JenaQueryExecutionFactory.sparqlService方法轻松完成。

但是,对 PHP 进行简单的谷歌搜索会导致A PHP forward proxy for remote access to SPARQL endpoints。您可以从 SPARQL 端点发送查询和接收结果,我想这就是您真正需要的。

此外,此链接为您提供了SPARQL 实现的多种选择,包括一些 php 实现。

于 2017-05-23T13:56:19.510 回答