trifid-core
Version:
Trifid Core
80 lines • 2.4 kB
TypeScript
/**
* Supported types for the serialization.
*/
export const supportedTypes: string[];
export function serializeFormattedStream(quadStream: import("@rdfjs/types").Stream<import("@rdfjs/types").Quad> | import("node:stream").EventEmitter | null): Promise<string>;
export function serializeQuadStream(quadStream: import("@rdfjs/types").Stream<import("@rdfjs/types").Quad> | null, mimeType: string, _options?: any | null): Promise<string>;
export function getRewriteConfiguration(value: any, datasetBaseUrl?: string): {
rewrite: boolean;
datasetBaseUrl: string | null;
replaceIri: (iri: string) => string;
iriOrigin: (iri: string) => string;
};
export function generateClient(sparqlEndpoint: string, options: QueryOptions): SPARQLClient;
export function initQuery(logger: import("pino").Logger, configuredEndpoints: Record<string, SPARQLEndpointConfig>, instanceHostname: string): {
endpoints: Record<string, SPARQLClient>;
query: (pluginLogger: import("pino").Logger) => import("../types/index.js").TrifidQuery;
};
export type QueryResult = {
/**
* The response body.
*/
response: any;
/**
* The response content type.
*/
contentType: string;
};
export type RewriteResponseOptions = {
/**
* The string to find.
*/
find: string;
/**
* The string to replace with.
*/
replace: string;
};
export type QueryOptions = {
/**
* Is it a ASK query?
*/
ask?: boolean;
/**
* Is it a SELECT query?
*/
select?: boolean;
/**
* Headers to use in the request.
*/
headers?: Record<string, string>;
/**
* Replace strings in the response.
*/
rewriteResponse?: Array<RewriteResponseOptions>;
};
export type SPARQLClient = {
/**
* Supported clients.
*/
clients: {
parsing: ParsingClient;
simple: SimpleClient;
};
/**
* Query function.
*/
query: (query: string, options?: QueryOptions) => Promise<QueryResult | Array<import("sparql-http-client/ResultParser.js").ResultRow> | boolean>;
};
/**
* SPARQL Endpoint configuration.
*/
export type SPARQLEndpointConfig = {
/**
* SPARQL endpoint URL.
*/
url: string;
};
import ParsingClient from 'sparql-http-client/ParsingClient.js';
import SimpleClient from 'sparql-http-client/SimpleClient.js';
//# sourceMappingURL=sparql.d.ts.map