forked from rdf-ext/sparql-http-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreamClient.js
More file actions
35 lines (33 loc) · 1.17 KB
/
StreamClient.js
File metadata and controls
35 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const BaseClient = require('./BaseClient')
const Endpoint = require('./Endpoint')
const StreamQuery = require('./StreamQuery')
const StreamStore = require('./StreamStore')
/**
* The default client implementation which returns SPARQL response as RDF/JS streams
*
* @property {StreamQuery} query
* @property {StreamStore} store
*/
class StreamClient extends BaseClient {
/**
* @param {Object} options
* @param {string} options.endpointUrl SPARQL Query endpoint URL
* @param {fetch} [options.fetch=nodeify-fetch] fetch implementation
* @param {HeadersInit} [options.headers] HTTP headers to send with every endpoint request
* @param {string} [options.password] password used for basic authentication
* @param {string} [options.storeUrl] Graph Store URL
* @param {string} [options.updateUrl] SPARQL Update endpoint URL
* @param {string} [options.user] user used for basic authentication
* @param {factory} [options.factory] RDF/JS DataFactory
*/
constructor (options) {
super({
endpoint: new Endpoint(options),
factory: options.factory,
Query: StreamQuery,
Store: StreamStore,
...options
})
}
}
module.exports = StreamClient