html_tag_helpers.php not found. Queries into GraphDB


Good day,

I have downloaded Easyrdf, the release of the 2020-07-14 from here and installed it.

When I try to view example ListOfCountries.php for example, I have this error message:

Warning : require_once(C:\xampp\htdocs\websemantique\ex1/html_tag_helpers.php): failed to open stream: No such file or directory in C:\xampp\htdocs\websemantique\ex1\index5.php on line 20

Fatal error : require_once(): Failed opening required ‘C:\xampp\htdocs\websemantique\ex1/html_tag_helpers.php’ (include_path=‘C:\xampp\php\PEAR’) in C:\xampp\htdocs\websemantique\ex1\index5.php on line 20
This file html_tag_helpers.php is not present on the directory structure.
As attachment you’ll see pictures of my directory structure and also the PHP file containing ListOfCountries.php code.

Also I have installed GraphDB database and would like to know how from Easyrdf I could make some queries into the database.


    //require_once realpath(__DIR__.'/..')."/vendor/autoload.php";
    require_once __DIR__."/html_tag_helpers.php";

    // Setup some additional prefixes for DBpedia
    \EasyRdf\RdfNamespace::set('dbc', '');
    \EasyRdf\RdfNamespace::set('dbpedia', '');
    \EasyRdf\RdfNamespace::set('dbo', '');
    \EasyRdf\RdfNamespace::set('dbp', '');

    $sparql = new \EasyRdf\Sparql\Client('');
  <title>EasyRdf Basic Sparql Example</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<h1>EasyRdf Basic Sparql Example</h1>

<h2>List of countries</h2>
    $result = $sparql->query(
        'SELECT * WHERE {'.
        '  ?country rdf:type dbo:Country .'.
        '  ?country rdfs:label ?label .'.
        '  ?country dct:subject dbc:Member_states_of_the_United_Nations .'.
        '  FILTER ( lang(?label) = "en" )'.
        '} ORDER BY ?label'
    foreach ($result as $row) {
        echo "<li>".link_to($row->label, $row->country)."</li>\n";
<p>Total number of countries: <?= $result->numRows() ?></p>


Thank you


I have responded to this query on the EasyRdf mailing list:


Thanks! @cProg please do not cross-post at multiple places in the future and don’t bother users on their private email. You approached many channels at the same time, this is a waste of time for everyone.


The problem answer seems to be in this error line.

The path should be C:\xampp\htdocs\websemantique\ex1\html_tag_helpers.php with only backslashes.

Have you tried your code with require_once __DIR__."\html_tag_helpers.php"; instead of require_once __DIR__."/html_tag_helpers.php";?