Jump to content
Sign in to follow this  
ioanamaria08

Preluare date din RDF4J cu PHP

Recommended Posts

Idea e următoarea: doresc să extrag de pe serverul RDF4J printr-o interogare SPARQL date din graf si sa le afisez intr-o pagina, dar primesc urmatoarea eroare:   Uncaught exception 'InvalidArgumentException' with message '$config should be an array and cannot be null.

Codul php:

<?php
require 'vendor/autoload.php';
print"<b>Lista participantilor:</b><br/>";
$adresa="http://localhost:8080/rdf4j-server/repositories/maraton?query=";
$interogare=urlencode("prefix gi: <http://vaduvescu.toma.ro#> select ?subiect ?nume where {?subiect gi:hasName ?nume}");
$clienthttp = new EasyRdf_Http_Client($adresa,$interogare);
$clienthttp->setHeaders("Accept","application/sparql-results+json");
$rezultatJSON = $clienthttp->request()->getBody();
print "<br/><br/><b>Raspunsul JSON sosit este : </b>".$rezultatJSON;
$rezultatRestructurat = new EasyRdf_Sparql_Result($rezultatJSON, "application/sparql-results+json");
print "<br/><br/><b>Raspunsul structurat este: </b>".$rezultatRestructurat;
?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×