@jahed/sparql-engine
Version:
SPARQL query engine for servers and web browsers.
64 lines (63 loc) • 4.75 kB
TypeScript
import type { BlankNode, Literal, NamedNode, Quad } from "@rdfjs/types";
import { DataFactory } from "rdf-data-factory";
import type { Triple, Wildcard } from "sparqljs";
import type { EngineExpression, EngineIRI, EngineLiteral, EngineTriple, EngineTripleValue, EngineVariable } from "../types.ts";
export declare const RDF: DataFactory<Quad>;
export declare function tripleEquals(a: EngineTriple, b: EngineTriple): boolean;
/**
* sparqljs predicates support PathProperty syntax which is currently ignored
* outside of PathStageBuilder for compatibility with standard Quads.
*/
export declare function tripleToQuad(triple: Triple): Quad;
export declare function termToValue<T = unknown>(term: EngineTripleValue): T;
export declare function asJS(value: string, type: string | null): any;
export declare function createTypedLiteral(value: any, type: string): Literal;
export declare function createLangLiteral(value: string, language: string): Literal;
export declare function createInteger(value: number): Literal;
export declare function createDecimal(value: number): Literal;
export declare function createFloat(value: number): Literal;
export declare function createBoolean(value: boolean): Literal;
export declare function createDate(date: Date): Literal;
export declare function shallowCloneTerm(term: EngineTripleValue, newValue: string): EngineTripleValue;
export declare function termIsLiteral(term: EngineTripleValue): term is Literal;
export declare function termIsIRI(term: EngineTripleValue): term is NamedNode;
export declare function termIsBNode(term: EngineTripleValue): term is BlankNode;
export declare function literalIsNumeric(literal: Literal): boolean;
export declare function literalIsDate(literal: Literal): boolean;
export declare function literalIsBoolean(literal: Literal): boolean;
export declare function isVariable(value: EngineTripleValue | EngineExpression | Wildcard): value is EngineVariable;
export declare function isLiteral(value: EngineTripleValue): value is EngineLiteral;
export declare function isIRI(value: EngineTripleValue): value is EngineIRI;
export declare function isBlank(value: EngineTripleValue): value is BlankNode;
export declare function isWildcard(value: object): value is Wildcard;
export declare const XSD_integer = "http://www.w3.org/2001/XMLSchema#integer";
export declare const XSD_byte = "http://www.w3.org/2001/XMLSchema#byte";
export declare const XSD_short = "http://www.w3.org/2001/XMLSchema#short";
export declare const XSD_int = "http://www.w3.org/2001/XMLSchema#int";
export declare const XSD_unsignedByte = "http://www.w3.org/2001/XMLSchema#unsignedByte";
export declare const XSD_unsignedShort = "http://www.w3.org/2001/XMLSchema#unsignedShort";
export declare const XSD_unsignedInt = "http://www.w3.org/2001/XMLSchema#unsignedInt";
export declare const XSD_number = "http://www.w3.org/2001/XMLSchema#number";
export declare const XSD_float = "http://www.w3.org/2001/XMLSchema#float";
export declare const XSD_decimal = "http://www.w3.org/2001/XMLSchema#decimal";
export declare const XSD_double = "http://www.w3.org/2001/XMLSchema#double";
export declare const XSD_long = "http://www.w3.org/2001/XMLSchema#long";
export declare const XSD_unsignedLong = "http://www.w3.org/2001/XMLSchema#unsignedLong";
export declare const XSD_positiveInteger = "http://www.w3.org/2001/XMLSchema#positiveInteger";
export declare const XSD_nonPositiveInteger = "http://www.w3.org/2001/XMLSchema#nonPositiveInteger";
export declare const XSD_negativeInteger = "http://www.w3.org/2001/XMLSchema#negativeInteger";
export declare const XSD_nonNegativeInteger = "http://www.w3.org/2001/XMLSchema#nonNegativeInteger";
export declare const XSD_boolean = "http://www.w3.org/2001/XMLSchema#boolean";
export declare const XSD_dateTime = "http://www.w3.org/2001/XMLSchema#dateTime";
export declare const XSD_dateTimeStamp = "http://www.w3.org/2001/XMLSchema#dateTimeStamp";
export declare const XSD_date = "http://www.w3.org/2001/XMLSchema#date";
export declare const XSD_time = "http://www.w3.org/2001/XMLSchema#time";
export declare const XSD_duration = "http://www.w3.org/2001/XMLSchema#duration";
export declare const XSD_hexBinary = "http://www.w3.org/2001/XMLSchema#hexBinary";
export declare const XSD_base64Binary = "http://www.w3.org/2001/XMLSchema#base64Binary";
export declare const UNBOUND: Readonly<import("rdf-data-factory").NamedNode<"UNBOUND">>;
export declare const VARIABLE_s: Readonly<import("rdf-data-factory").Variable>;
export declare const VARIABLE_p: Readonly<import("rdf-data-factory").Variable>;
export declare const VARIABLE_o: Readonly<import("rdf-data-factory").Variable>;
export declare const LITERAL_true: Readonly<Literal>;
export declare const LITERAL_false: Readonly<Literal>;