Converting return into json

Skip to first unread message

Ian Piper

Nov 30, 2020, 10:03:26 AM11/30/20
to EasyRdf Discussion
I'm using EasyRDF to manage  SPARL query to a remote data service. It works fine when I use a simple search box; I get a $return object and I can retrieve the separate results from that. However, I'd like to make the search box autocomplete and get the results in a dropdown as I type. The various resources I've read suggest that I need to build a piece of json and use that to populate the autocomplete list. However, I can't see how to make a json object out of the return from my program.

I've tried json_encode but that doesn't seem to work. Can anyone advise please? Any help much appreciated.

For information, here is the raw dump data that I get back from a typical search. This is just the first section and then the first array member. Apologies for any mangled formatting.

object(EasyRdf\Sparql\Result)#20 (4) {
  string(8) "bindings"
  array(2) {
    string(7) "concept"
    string(11) "searchLabel"
  array(5) {
    object(stdClass)#33 (2) {
      object(EasyRdf\Resource)#38 (2) {
      object(EasyRdf\Literal)#40 (3) {
        string(25) "Stomata and gas diffusion"
        string(2) "en"

Nov 30, 2020, 11:07:47 AM11/30/20
to EasyRdf Discussion


one of the current EasyRdf maintainers here (k00ni).

Can you please open an issue at, because almost all communication is located on Github currently. Hope you understand.

Konrad Abicht
Reply all
Reply to author
0 new messages