mirror of
https://github.com/Babibubebon/lodfe.git
synced 2024-09-23 01:34:21 +09:00
Support configuration for http client
This commit is contained in:
parent
340446e8a4
commit
0a4a31c94d
2 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,10 @@ class ResourceController extends Controller
|
||||||
*/
|
*/
|
||||||
protected function querySparql($request)
|
protected function querySparql($request)
|
||||||
{
|
{
|
||||||
|
if (!empty($request->datasetConfig['http'])) {
|
||||||
|
$httpClient = new \EasyRdf\Http\Client(null, $request->datasetConfig['http']);
|
||||||
|
\EasyRdf\Http::setDefaultHttpClient($httpClient);
|
||||||
|
}
|
||||||
$client = new \EasyRdf\Sparql\Client($request->datasetConfig['endpoint']);
|
$client = new \EasyRdf\Sparql\Client($request->datasetConfig['endpoint']);
|
||||||
$query = <<<EOT
|
$query = <<<EOT
|
||||||
CONSTRUCT {
|
CONSTRUCT {
|
||||||
|
|
|
@ -8,6 +8,9 @@ return [
|
||||||
'html_uri' => 'https://example.com/page/{id}',
|
'html_uri' => 'https://example.com/page/{id}',
|
||||||
'data_uri' => 'https://example.com/data/{id}',
|
'data_uri' => 'https://example.com/data/{id}',
|
||||||
'endpoint' => 'https://example.com/query', // SPARQL endpoint URI
|
'endpoint' => 'https://example.com/query', // SPARQL endpoint URI
|
||||||
|
'http' => [
|
||||||
|
'timeout' => 30,
|
||||||
|
]
|
||||||
],
|
],
|
||||||
*/
|
*/
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue