/** * This module will define patch rules that should be used in combination with the sparql11 grammar to create * a sparql12 grammar. * Rules in this module redefine the return type of core grammar rules. * It is therefore essential that the parser retypes the rules from the core grammar. */ import type { RuleDefReturn, Wrap } from '@traqula/core'; import { gram as S11 } from '@traqula/rules-sparql-1-1'; import type * as T11 from '@traqula/rules-sparql-1-1'; import type { SparqlGeneratorRule, SparqlGrammarRule, SparqlRule } from './sparql12HelperTypes.js'; import type { Annotation, ContextDefinition, ContextDefinitionVersion, Expression, GraphNode, GraphTerm, PatternBgp, QuerySelect, Term, TermBlank, TermIri, TermLiteral, TermTriple, TermVariable, TripleCollectionReifiedTriple, TripleNesting } from './sparql12Types.js'; /** *[[7]](https://www.w3.org/TR/sparql12-query/#rVersionDecl) */ export declare const versionDecl: SparqlRule<'versionDecl', ContextDefinitionVersion>; /** * [[9]](https://www.w3.org/TR/sparql12-query/#rSelectQuery) * (Validator has changed: https://github.com/w3c/sparql-query/pull/380) */ export declare const selectQuery: SparqlGrammarRule<'selectQuery', Omit>; /** * [[8]](https://www.w3.org/TR/sparql12-query/#rVersionSpecifier) */ export declare const versionSpecifier: SparqlGrammarRule<'versionSpecifier', Wrap>; /** * OVERRIDING RULE {@link S11.prologue} * [[4]](https://www.w3.org/TR/sparql12-query/#rPrologue) */ export declare const prologue: SparqlRule<'prologue', ContextDefinition[]>; /** * [[58]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleBlock) Used by triplesSameSubject */ export declare const reifiedTripleBlock: SparqlGrammarRule<"reifiedTripleBlock", T11.BasicGraphPattern>; /** * [[59]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleBlockPath) Used by TriplesSameSubjectPath */ export declare const reifiedTripleBlockPath: SparqlGrammarRule<"reifiedTripleBlockPath", T11.BasicGraphPattern>; /** * OVERRIDING RULE: {@link S11.dataBlockValue}. * [[69]](https://www.w3.org/TR/sparql12-query/#rDataBlockValue) */ export declare const dataBlockValue: SparqlGrammarRule<'dataBlockValue', RuleDefReturn | TermTriple>; /** * [[70]](https://www.w3.org/TR/sparql12-query/#rReifier) */ export declare const reifier: SparqlGrammarRule<'reifier', Wrap>>; /** * [[71]](https://www.w3.org/TR/sparql12-query/#rVarOrReifierId) */ export declare const varOrReifierId: SparqlGrammarRule<'varOrReifierId', TermVariable | TermIri | TermBlank>; /** * OVERRIDING RULE {@link S11.triplesSameSubject} * [[81]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubject) */ export declare const triplesSameSubject: SparqlGrammarRule<"triplesSameSubject", T11.BasicGraphPattern>; /** * OVERRIDING RULE {@link S11.triplesSameSubjectPath} * [[87]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubjectPath) */ export declare const triplesSameSubjectPath: SparqlGrammarRule<"triplesSameSubjectPath", T11.BasicGraphPattern>; /** * OVERRIDING RULE: {@link S11.object}. * [[86]](https://www.w3.org/TR/sparql12-query/#rObject) Used by ObjectList */ export declare const object: SparqlGrammarRule<"object", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PropertyPathChain | T11.PathModified | T11.PathNegated]>; /** * OVERRIDING RULE: {@link S11.objectPath}. * [[87]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubjectPath) Used by ObjectListPath */ export declare const objectPath: SparqlGrammarRule<"objectPath", TripleNesting, [GraphNode, T11.TermIriFull | T11.TermIriPrefixed | T11.TermVariable | T11.PropertyPathChain | T11.PathModified | T11.PathNegated]>; /** * [[109]](https://www.w3.org/TR/sparql12-query/#rAnnotationPath) */ export declare const annotationPath: SparqlRule<"annotationPath", Annotation[]>; /** * [[111]](https://www.w3.org/TR/sparql12-query/#rAnnotation) */ export declare const annotation: SparqlRule<"annotation", Annotation[]>; /** * [[110]](https://www.w3.org/TR/sparql12-query/#rAnnotationBlockPath) */ export declare const annotationBlockPath: SparqlGrammarRule<"annotationBlockPath", import("@traqula/core").Patch, [T11.TermIri | T11.TermVariable | T11.TermBlank]> & SparqlGeneratorRule<"annotationBlockPath", import("@traqula/core").Patch>; /** * [[112]](https://www.w3.org/TR/sparql12-query/#rAnnotationBlock) */ export declare const annotationBlock: SparqlGrammarRule<"annotationBlock", import("@traqula/core").Patch, [T11.TermIri | T11.TermVariable | T11.TermBlank]> & SparqlGeneratorRule<"annotationBlock", import("@traqula/core").Patch>; /** * OVERRIDING RULE: {@link S11.graphNode}. * [[113]](https://www.w3.org/TR/sparql12-query/#rGraphNode) */ export declare const graphNode: SparqlGrammarRule<'graphNode', GraphNode>; /** * OVERRIDING RULE: {@link S11.graphNodePath}. * [[114]](https://www.w3.org/TR/sparql12-query/#rGraphNodePath) */ export declare const graphNodePath: SparqlRule<'graphNodePath', GraphNode>; /** * OVERRIDING RULE: {@link S11.varOrTerm}. * [[115]](https://www.w3.org/TR/sparql12-query/#rVarOrTerm) */ export declare const varOrTerm: SparqlGrammarRule<'varOrTerm', Term>; /** * [[116]](https://www.w3.org/TR/sparql12-query/#rReifiedTriple) */ export declare const reifiedTriple: SparqlRule<'reifiedTriple', TripleCollectionReifiedTriple>; /** * [[117]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleSubject) */ export declare const reifiedTripleSubject: SparqlGrammarRule<'reifiedTripleSubject', Term | TripleCollectionReifiedTriple>; /** * [[118]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleObject) */ export declare const reifiedTripleObject: SparqlGrammarRule<'reifiedTripleObject', RuleDefReturn>; /** * [[119]](https://www.w3.org/TR/sparql12-query/#rTripleTerm) */ export declare const tripleTerm: SparqlRule<'tripleTerm', TermTriple>; /** * [[120]](https://www.w3.org/TR/sparql12-query/#rTripleTermSubject) */ export declare const tripleTermSubject: SparqlGrammarRule<'tripleTermSubject', TermVariable | TermIri | TermLiteral | TermBlank | TermTriple>; /** * [[121]](https://www.w3.org/TR/sparql12-query/#rTripleTermObject) */ export declare const tripleTermObject: SparqlGrammarRule<'tripleTermObject', RuleDefReturn>; /** * [[122]](https://www.w3.org/TR/sparql12-query/#rTripleTermData) */ export declare const tripleTermData: SparqlGrammarRule<'tripleTermData', TermTriple>; /** * [[123]](https://www.w3.org/TR/sparql12-query/#rTripleTermDataSubject) */ export declare const tripleTermDataSubject: SparqlGrammarRule<'tripleTermDataSubject', TermIri | TermLiteral | TermTriple>; /** * [[124]](https://www.w3.org/TR/sparql12-query/#rTripleTermDataObject) */ export declare const tripleTermDataObject: SparqlGrammarRule<'tripleTermDataObject', RuleDefReturn>; /** * OVERRIDING RULE: {@link S11.primaryExpression}. * [[136]](https://www.w3.org/TR/sparql12-query/#rPrimaryExpression) */ export declare const primaryExpression: SparqlGrammarRule<'primaryExpression', Expression>; /** * [[137]](https://www.w3.org/TR/sparql12-query/#rExprTripleTerm) */ export declare const exprTripleTerm: SparqlGrammarRule<'exprTripleTerm', TermTriple>; /** * [[138]](https://www.w3.org/TR/sparql12-query/#rExprTripleTermSubject) */ export declare const exprTripleTermSubject: SparqlGrammarRule<'exprTripleTermSubject', TermIri | TermVariable | TermLiteral | TermTriple>; /** * [[139]](https://www.w3.org/TR/sparql12-query/#rExprTripleTermObject) */ export declare const exprTripleTermObject: SparqlGrammarRule<'exprTripleTermObject', RuleDefReturn | TermTriple>; export declare const buildInLangDir: S11.RuleDefExpressionFunctionX<"builtInLangdir", [T11.Expression]>; export declare const buildInLangStrDir: S11.RuleDefExpressionFunctionX<"builtInStrLangdir", [T11.Expression, T11.Expression, T11.Expression]>; export declare const buildInHasLang: S11.RuleDefExpressionFunctionX<"builtInHasLang", [T11.Expression]>; export declare const buildInHasLangDir: S11.RuleDefExpressionFunctionX<"builtInHasLangdir", [T11.Expression]>; export declare const buildInIsTriple: S11.RuleDefExpressionFunctionX<"builtInIsTriple", [T11.Expression]>; export declare const buildInTriple: S11.RuleDefExpressionFunctionX<"builtInTriple", [T11.Expression, T11.Expression, T11.Expression]>; export declare const buildInSubject: S11.RuleDefExpressionFunctionX<"builtInSubject", [T11.Expression]>; export declare const buildInPredicate: S11.RuleDefExpressionFunctionX<"builtInPredicate", [T11.Expression]>; export declare const buildInObject: S11.RuleDefExpressionFunctionX<"builtInObject", [T11.Expression]>; /** * OVERRIDING RULE: {@link S11.builtInCall}. * [[141]](https://www.w3.org/TR/sparql12-query/#rBuiltInCall) */ export declare const builtInCall: typeof S11.builtInCall; /** * OVERRIDING RULE: {@link S11.rdfLiteral}. * No retyping is needed since the return type is the same * [[149]](https://www.w3.org/TR/sparql12-query/#rRDFLiteral) */ export declare const rdfLiteral: SparqlGrammarRule<'rdfLiteral', RuleDefReturn>; /** * OVERRIDING RULE: {@link S11.string}. * [[155]](https://www.w3.org/TR/sparql12-query/#rString) * * Uses the SPARQL 1.2 string tokens (which include UCHAR in their patterns). * Applies single-pass decoding of UCHAR and ECHAR sequences so that a backslash * produced by a UCHAR (e.g. \u005C → \) is never re-interpreted as an ECHAR prefix. * Per the SPARQL 1.2 spec exapmles: \u005Cn -> \n */ export declare const string: SparqlGrammarRule<'string', T11.TermLiteralStr>; /** * OVERRIDING RULE: {@link S11.iriFull}. * [[160]](https://www.w3.org/TR/sparql12-query/#rIRIREF) * * Uses the SPARQL 1.2 IRI token (which includes UCHAR in its pattern) and applies * codepoint escape decoding via {@link SparqlContext.codepointEscape}. */ export declare const iriFull: SparqlGrammarRule<'iriFull', T11.TermIriFull>; export declare const unaryExpression: SparqlGrammarRule<(typeof S11.unaryExpression)['name'], Expression>; /** * OVERRIDING RULE: {@link S11.triplesBlock}. */ export declare const generateTriplesBlock: SparqlGeneratorRule<'triplesBlock', PatternBgp>; /** * OVERRIDING RULE: {@link S11.graphTerm}. * No retyping is needed since the return type is the same * [[149]](https://www.w3.org/TR/sparql12-query/#rRDFLiteral) */ export declare const generateGraphTerm: SparqlGeneratorRule<'graphTerm', GraphTerm>;