@thi.ng/rstream-query
Version:
@thi.ng/rstream based triple store & reactive query engine
25 lines • 924 B
TypeScript
import type { PathPattern, Pattern } from "./api.js";
export declare const patternVarCount: (p: Pattern) => number;
export declare const patternVars: ([s, p, o]: Pattern) => string[];
/**
* Takes a path triple pattern and max depth. The pattern's predicate must be a
* seq of preds. Returns a 2-elem vector `[patterns,vars]`, where `patterns` is
* a list of generated sub-query patterns with injected temp qvars for in
* between patterns and `vars` are the temp qvars themselves.
*
* Example:
*
* ```text
* ["?s", [p1, p2, p3], "?o"] =>
* [
* [["?s", p1, "?__q0"], ["?__q0", p2, "?__q1"], ["?__q1", p3, "?o"] ],
* ["?__q0", "?__q1"]
* ]
* ```
*
* @param pattern -
* @param maxLen -
*/
export declare const resolvePathPattern: ([s, p, o]: PathPattern, maxLen?: number) => [Pattern[], string[]];
export declare const sortPatterns: (patterns: Pattern[]) => Pattern[];
//# sourceMappingURL=pattern.d.ts.map