UNPKG

sparnatural

Version:

Visual client-side SPARQL query builder and knowledge graph exploration tool

42 lines (41 loc) 1.96 kB
import { Catalog } from "../../settings/Catalog"; import { UrlFetcher } from "./UrlFetcher"; export interface SparqlHandlerIfc { executeSparql(sparql: string, callback: (data: any) => void, errorCallback?: (error: any) => void): void; } export declare class SparqlHandlerFactory { protected lang: string; protected localCacheDataTtl: any; protected extraHeaders: Map<string, string>; protected customizedSparqlHandler: SparqlHandlerIfc; protected catalog?: Catalog; constructor(lang: string, localCacheDataTtl: any, extraHeaders: Map<string, string>, customizedSparqlHandler?: SparqlHandlerIfc, catalog?: Catalog); buildSparqlHandler(endpoints: string[]): SparqlHandlerIfc; } /** * Executes a SPARQL query against a remote endpoint at a known URL */ export declare class EndpointSparqlHandler implements SparqlHandlerIfc { urlFetcher: UrlFetcher; sparqlEndpointUrl: any; constructor(urlFetcher: UrlFetcher, sparqlEndpointUrl: any); buildUrl(sparql: string): string; buildParameters(sparql: string): string; executeSparqlPost(sparql: string, callback: (data: {}) => void, errorCallback?: (error: any) => void): void; executeSparqlGet(sparql: string, callback: (data: {}) => void, errorCallback?: (error: any) => void): void; executeSparql(sparql: string, callback: (data: {}) => void, errorCallback?: (error: any) => void): void; } /** * Executes a SPARQL query against multiple endpoints * and returns the results merged in a single result set * with an extra column to express the source */ export declare class MultipleEndpointSparqlHandler implements SparqlHandlerIfc { urlFetcher: UrlFetcher; catalog: Catalog; addExtraEndpointColumn: boolean; extraColumnName: string; lang: string; constructor(urlFetcher: UrlFetcher, catalog: Catalog, lang: string); executeSparql(sparql: string, callback: (data: any) => void, errorCallback?: (error: any) => void): void; }