Skip to content

Commit

Permalink
fix: loading from dedicated graph
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Dec 31, 2024
1 parent 6a0c38e commit 1ff8d90
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apis/shared-dimensions/test/lib/loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { INSERT } from '@tpluscode/sparql-builder'
import { mdClients } from '@cube-creator/testing/lib'
import namespace from '@rdfjs/namespace'
import { hydra, schema, sh } from '@tpluscode/rdf-ns-builders'
import { md } from '@cube-creator/core/namespace'
import Loader from '../../lib/loader'

const ex = namespace('http://example.com/')
const graph = ex('shared-dimensions')
const testResources = INSERT.DATA`
graph ${graph} {
${ex.foo}
a ${hydra.Resource} ;
a ${md.SharedDimension} ;
${schema.name} "Yes" ;
${ex.hidden} "foo" ;
.
Expand Down
43 changes: 43 additions & 0 deletions patches/sparql-http-client+2.4.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,46 @@ index 5aa6bfc..1538933 100644
}
}

diff --git a/node_modules/sparql-http-client/StreamQuery.js b/node_modules/sparql-http-client/StreamQuery.js
index 163b325..bbbe20d 100644
--- a/node_modules/sparql-http-client/StreamQuery.js
+++ b/node_modules/sparql-http-client/StreamQuery.js
@@ -27,8 +27,8 @@ class StreamQuery extends RawQuery {
* @param {'get'|'postUrlencoded'|'postDirect'} [init.operation='get']
* @return {Promise<boolean>}
*/
- async ask (query, { headers, operation } = {}) {
- const res = await super.ask(query, { headers, operation })
+ async ask (query, { headers, operation, ...options } = {}) {
+ const res = await super.ask(query, { headers, operation, ...options })

await checkResponse(res)

@@ -44,14 +44,14 @@ class StreamQuery extends RawQuery {
* @param {'get'|'postUrlencoded'|'postDirect'} [init.operation='get']
* @return {Promise<Stream>}
*/
- async construct (query, { headers, operation } = {}) {
+ async construct (query, { headers, operation, ...options } = {}) {
headers = new this.endpoint.fetch.Headers(headers)

if (!headers.has('accept')) {
headers.set('accept', 'application/n-triples, text/turtle')
}

- const res = await super.construct(query, { headers, operation })
+ const res = await super.construct(query, { headers, operation, ...options })

await checkResponse(res)

@@ -67,8 +67,8 @@ class StreamQuery extends RawQuery {
* @param {'get'|'postUrlencoded'|'postDirect'} [init.operation='get']
* @return {Promise<Stream>}
*/
- async select (query, { headers, operation } = {}) {
- const res = await super.select(query, { headers, operation })
+ async select (query, { headers, operation, ...options } = {}) {
+ const res = await super.select(query, { headers, operation, ...options })

await checkResponse(res)

0 comments on commit 1ff8d90

Please sign in to comment.