> On 14 Jan 2015, at 16:16, Alexey Zakhlestin <
inde...@gmail.com> wrote:
>
>
>> On 14 Jan 2015, at 15:12, vector vision <
ece0...@myport.ac.uk> wrote:
>>
>> That's a really kind offer, thank you :) please let me know when/what I have to do .
>
> 1. change composer.json to use “dev-master” version of easyrdf and run “composer update"
>
> 2. if you use any custom code — change it to use new namespace-based class-names
>
> all of the official examples are updated here:
https://github.com/njh/easyrdf/tree/master/examples
>
> 3. check
https://github.com/njh/easyrdf/issues/228 for updates.
>
> I’ll try to finish this in the next 24h. The task is not huge, but I have short time-slots today
so, it is done.
you have to do a simple thing:
<?php
use EasyRdf\Sparql\Client;
use EasyRdf\Sparql\Result;
class CustomClient extends Client
{
protected function parseResponseToQuery($response)
{
return new Result($response->getBody(), 'application/sparql-results+json');
}
}
now, just use this CustomClient instead of the base one.
But it will work only for SELECT queries (CONSTRUCT queries use different mime-types).
If you need to handle construct-queries too, you will need a bit more complex solution:
1. detect type of the query
2. depending on (1) chose either this parsing code or parsing via Graph class with mime-type corresponding to the data this endpoint gives.