UNPKG

sparnatural

Version:

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

58 lines (57 loc) 2.25 kB
import SparnaturalComponent from "./sparnatural/components/SparnaturalComponent"; import { SparnaturalQueryIfc } from "./sparnatural/SparnaturalQueryIfc"; import { SparnaturalAttributes } from "./SparnaturalAttributes"; export declare class SparnaturalElement extends HTMLElement { static HTML_ELEMENT_NAME: string; static EVENT_SUBMIT: string; static EVENT_QUERY_UPDATED: string; static EVENT_RESET: string; static EVENT_INIT: string; _attributes: SparnaturalAttributes; sparnatural: SparnaturalComponent; constructor(); /** * Call display only in the connectedCallback */ connectedCallback(): void; set customization(customization: any); get customization(): any; display(): void; /** * Expands the SPARQL query according to the configuration. * Can be called from the outside * @returns */ expandSparql(query: string): string; static get observedAttributes(): string[]; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; /** * Enable the play button when a query has finished executing * Can be called from the outside. Removes the loading spinner on the btn */ enablePlayBtn(): void; /** * Disable the play button when query is triggered * Can be called from the outside */ disablePlayBtn(): void; /** * Load a saved/predefined query in the visual query builder * Can be called from the outside * @param query */ loadQuery(query: SparnaturalQueryIfc): void; /** * Executes the provided SPARQL query, using the configured headers, and sending it to multiple * endpoints, if configured through the catalog attribute (results are then merged in a single result set) * @param query The SPARQL query to execute * @param callback The callback to execute with the final query string * @param errorCallback The callback to execute in case of an error during the query execution */ executeSparql(query: string, callback: (data: any) => void, errorCallback?: (error: any) => void): void; /** * Clears the current query. * Can be called from the outside */ clear(): void; }