UNPKG

@comake/skl-js-engine

Version:

Standard Knowledge Language Javascript Engine

26 lines 1.33 kB
import type { NodeObject } from 'jsonld'; import { Store } from 'n3'; import type { EntityFieldValue, JSONObject, RdfList } from './Types'; export declare function convertJsonLdToQuads(jsonldDoc: any): Promise<Store>; export declare function toJSON(jsonLd: NodeObject, convertBeyondFirstLevel?: boolean): JSONObject; export declare function ensureArray<T>(arrayable: T | T[]): T[]; export declare function getValueIfDefined<T>(fieldValue?: EntityFieldValue): T | undefined; export declare function isUrl(value: any): boolean; export declare function rdfListToArray<T extends NodeObject>(list: { '@list': T[]; } | RdfList<T>): T[]; export declare function parseJSONOrDefault<T>(json: string, defaultValue: T): T; export declare const dataTypeMapping: { string: "http://www.w3.org/2001/XMLSchema#string"; boolean: "http://www.w3.org/2001/XMLSchema#boolean"; integer: "http://www.w3.org/2001/XMLSchema#integer"; float: "http://www.w3.org/2001/XMLSchema#float"; double: "http://www.w3.org/2001/XMLSchema#double"; dateTime: "http://www.w3.org/2001/XMLSchema#dateTime"; json: "http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON"; }; export declare function getEntityValue<T>(value: T, dataType?: keyof typeof dataTypeMapping): { '@type': string; '@value': T; }; //# sourceMappingURL=Util.d.ts.map