How to turn a EasyRdf_Sparql_Result into a EasyRdf_Graph

55 views
Skip to first unread message

Mike Lamoureux

unread,
Jan 27, 2013, 2:55:16 PM1/27/13
to eas...@googlegroups.com
Hi-

I was wondering how I could turn a EasyRdf_Sparql_Result into a EasyRdf_Graph.  I would like to utilize the serialization to output to JSON.

Thanks.

Nicholas J Humfrey

unread,
Jan 27, 2013, 4:55:21 PM1/27/13
to eas...@googlegroups.com
If you make a SELECT or an ASK query, the response will be turned into a
EasyRdf_Sparql_Result object.

If you make a CONSTRUCT or DESCRIBE query, the response will be turned
into a EasyRdf_Graph object.

A SPARQL SELECT query is just a table of results, like the result of an
SQL query or a spreadsheet. There isn't a direct way of turning it back
into RDF. It doesn't look like you can just json_encode() a
EasyRdf_Sparql_Result object, but it probably wouldn't take very much code
to convert it to some simple JSON.


nick.


Reply all
Reply to author
Forward
0 new messages