@traqula/rules-sparql-1-2 0.0.1-alpha.145 → 0.0.1-alpha.176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # TRAQULA Rules SPARQL 1.2 package
1
+ # Traqula Rules SPARQL 1.2 package
2
2
 
3
- TRAQULA rules SPARQL 1.2 contains additional rules required for creating a parser for SPARQL 1.2 from the SPARQL 1.1 rules.
3
+ **WARNING:** V2 will come shortly and will have lots of breaking changes.
4
+
5
+ Traqula rules SPARQL 1.2 contains additional rules required for creating a parser for SPARQL 1.2 from the SPARQL 1.1 rules.
4
6
 
5
7
  ## Installation
6
8
 
@@ -12,4 +14,4 @@ or
12
14
 
13
15
  ```bash
14
16
  yarn add @traqula/rules-sparql-1-2
15
- ```
17
+ ```
package/lib/grammar.d.ts CHANGED
@@ -4,137 +4,179 @@
4
4
  * Rules in this module redefine the return type of core grammar rules.
5
5
  * It is therefore essential that the parser retypes the rules from the core grammar.
6
6
  */
7
- import type { RuleDefReturn, RuleDef } from '@traqula/core';
7
+ import type { RuleDefReturn } from '@traqula/core';
8
8
  import { gram as S11 } from '@traqula/rules-sparql-1-1';
9
9
  import type * as T11 from '@traqula/rules-sparql-1-1';
10
10
  import type { BaseQuadTerm, Expression, IGraphNode, Term, Triple } from './sparql12Types';
11
11
  /**
12
12
  * [[56]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleBlock) Used by triplesSameSubject
13
13
  */
14
- export declare const reifiedTripleBlock: RuleDef<"reifiedTripleBlock", Triple[]>;
14
+ export declare const reifiedTripleBlock: T11.SparqlGrammarRule<"reifiedTripleBlock", import("@traqula/core").Patch<T11.Triple, {
15
+ subject: Term;
16
+ object: Term;
17
+ }>[], undefined>;
15
18
  /**
16
19
  * [[57]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleBlockPath) Used by TriplesSameSubjectPath
17
20
  */
18
- export declare const reifiedTripleBlockPath: RuleDef<"reifiedTripleBlockPath", Triple[]>;
21
+ export declare const reifiedTripleBlockPath: T11.SparqlGrammarRule<"reifiedTripleBlockPath", import("@traqula/core").Patch<T11.Triple, {
22
+ subject: Term;
23
+ object: Term;
24
+ }>[], undefined>;
19
25
  /**
20
26
  * OVERRIDING RULE: {@link S11.dataBlockValue}.
21
27
  * [[67]](https://www.w3.org/TR/sparql12-query/#rDataBlockValue)
22
28
  */
23
- export declare const dataBlockValue: RuleDef<'dataBlockValue', RuleDefReturn<typeof S11.dataBlockValue> | BaseQuadTerm>;
29
+ export declare const dataBlockValue: T11.SparqlRule<'dataBlockValue', RuleDefReturn<typeof S11.dataBlockValue> | BaseQuadTerm>;
24
30
  /**
25
31
  * [[68]](https://www.w3.org/TR/sparql12-query/#rReifier)
26
32
  */
27
- export declare const reifier: RuleDef<'reifier', T11.VariableTerm | T11.IriTerm | T11.BlankTerm>;
33
+ export declare const reifier: T11.SparqlGrammarRule<'reifier', T11.VariableTerm | T11.IriTerm | T11.BlankTerm>;
28
34
  /**
29
35
  * [[68]](https://www.w3.org/TR/sparql12-query/#rVarOrReifierId)
30
36
  */
31
- export declare const varOrReifierId: RuleDef<'varOrReifierId', T11.VariableTerm | T11.IriTerm | T11.BlankTerm>;
37
+ export declare const varOrReifierId: T11.SparqlGrammarRule<'varOrReifierId', T11.VariableTerm | T11.IriTerm | T11.BlankTerm>;
32
38
  /**
33
39
  * OVERRIDING RULE {@link S11.triplesSameSubject}
34
40
  * [[79]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubject)
35
41
  */
36
- export declare const triplesSameSubject: RuleDef<"triplesSameSubject", Triple[]>;
42
+ export declare const triplesSameSubject: T11.SparqlGrammarRule<"triplesSameSubject", import("@traqula/core").Patch<T11.Triple, {
43
+ subject: Term;
44
+ object: Term;
45
+ }>[], undefined>;
37
46
  /**
38
47
  * OVERRIDING RULE {@link S11.triplesSameSubjectPath}
39
48
  * [[85]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubjectPath)
40
49
  */
41
- export declare const triplesSameSubjectPath: RuleDef<"triplesSameSubjectPath", Triple[]>;
50
+ export declare const triplesSameSubjectPath: T11.SparqlGrammarRule<"triplesSameSubjectPath", import("@traqula/core").Patch<T11.Triple, {
51
+ subject: Term;
52
+ object: Term;
53
+ }>[], undefined>;
42
54
  /**
43
55
  * OVERRIDING RULE: {@link S11.object}.
44
56
  * [[84]](https://www.w3.org/TR/sparql12-query/#rObject) Used by ObjectList
45
57
  */
46
- export declare const object: RuleDef<"object", Triple[], [Term, import("@rdfjs/types").Variable | T11.IriTerm<string> | T11.PropertyPath]>;
58
+ export declare const object: T11.SparqlGrammarRule<"object", import("@traqula/core").Patch<T11.Triple, {
59
+ subject: Term;
60
+ object: Term;
61
+ }>[], Pick<import("@traqula/core").Patch<T11.Triple, {
62
+ subject: Term;
63
+ object: Term;
64
+ }>, "subject" | "predicate">>;
47
65
  /**
48
66
  * OVERRIDING RULE: {@link S11.objectPath}.
49
67
  * [[91]](https://www.w3.org/TR/sparql12-query/#rTriplesSameSubjectPath) Used by ObjectListPath
50
68
  */
51
- export declare const objectPath: RuleDef<"objectPath", Triple[], [Term, import("@rdfjs/types").Variable | T11.IriTerm<string> | T11.PropertyPath]>;
69
+ export declare const objectPath: T11.SparqlGrammarRule<"objectPath", import("@traqula/core").Patch<T11.Triple, {
70
+ subject: Term;
71
+ object: Term;
72
+ }>[], Pick<import("@traqula/core").Patch<T11.Triple, {
73
+ subject: Term;
74
+ object: Term;
75
+ }>, "subject" | "predicate">>;
52
76
  /**
53
77
  * [[107]](https://www.w3.org/TR/sparql12-query/#rAnnotationPath)
54
78
  */
55
- export declare const annotationPath: RuleDef<"annotationPath", IGraphNode[]>;
79
+ export declare const annotationPath: T11.SparqlGrammarRule<"annotationPath", import("@traqula/core").Patch<T11.IGraphNode, {
80
+ triples: Triple[];
81
+ node: import("./sparql12Types").ITriplesNode["node"] | Term;
82
+ }>[], undefined>;
56
83
  /**
57
84
  * [[109]](https://www.w3.org/TR/sparql12-query/#rAnnotation)
58
85
  */
59
- export declare const annotation: RuleDef<"annotation", IGraphNode[]>;
86
+ export declare const annotation: T11.SparqlGrammarRule<"annotation", import("@traqula/core").Patch<T11.IGraphNode, {
87
+ triples: Triple[];
88
+ node: import("./sparql12Types").ITriplesNode["node"] | Term;
89
+ }>[], undefined>;
60
90
  /**
61
91
  * [[108]](https://www.w3.org/TR/sparql12-query/#rAnnotationBlockPath)
62
92
  */
63
- export declare const annotationBlockPath: RuleDef<"annotationBlockPath", Triple[], [Term]>;
93
+ export declare const annotationBlockPath: T11.SparqlGrammarRule<"annotationBlockPath", import("@traqula/core").Patch<T11.Triple, {
94
+ subject: Term;
95
+ object: Term;
96
+ }>[], Pick<import("@traqula/core").Patch<T11.Triple, {
97
+ subject: Term;
98
+ object: Term;
99
+ }>, "subject">>;
64
100
  /**
65
101
  * [[110]](https://www.w3.org/TR/sparql12-query/#rAnnotationBlock)
66
102
  */
67
- export declare const annotationBlock: RuleDef<"annotationBlock", Triple[], [Term]>;
103
+ export declare const annotationBlock: T11.SparqlGrammarRule<"annotationBlock", import("@traqula/core").Patch<T11.Triple, {
104
+ subject: Term;
105
+ object: Term;
106
+ }>[], Pick<import("@traqula/core").Patch<T11.Triple, {
107
+ subject: Term;
108
+ object: Term;
109
+ }>, "subject">>;
68
110
  /**
69
111
  * OVERRIDING RULE: {@link S11.graphNode}.
70
112
  * [[111]](https://www.w3.org/TR/sparql12-query/#rGraphNode)
71
113
  */
72
- export declare const graphNode: RuleDef<'graphNode', IGraphNode>;
114
+ export declare const graphNode: T11.SparqlGrammarRule<'graphNode', IGraphNode>;
73
115
  /**
74
116
  * OVERRIDING RULE: {@link S11.graphNodePath}.
75
117
  * [[112]](https://www.w3.org/TR/sparql12-query/#rGraphNodePath)
76
118
  */
77
- export declare const graphNodePath: RuleDef<'graphNodePath', IGraphNode>;
119
+ export declare const graphNodePath: T11.SparqlGrammarRule<'graphNodePath', IGraphNode>;
78
120
  /**
79
121
  * OVERRIDING RULE: {@link S11.varOrTerm}.
80
122
  * [[113]](https://www.w3.org/TR/sparql12-query/#rVarOrTerm)
81
123
  */
82
- export declare const varOrTerm: RuleDef<'varOrTerm', Term>;
124
+ export declare const varOrTerm: T11.SparqlRule<'varOrTerm', Term>;
83
125
  /**
84
126
  * [[114]](https://www.w3.org/TR/sparql12-query/#rReifiedTriple)
85
127
  */
86
- export declare const reifiedTriple: RuleDef<'reifiedTriple', IGraphNode & {
128
+ export declare const reifiedTriple: T11.SparqlGrammarRule<'reifiedTriple', IGraphNode & {
87
129
  node: T11.BlankTerm | T11.VariableTerm | T11.IriTerm;
88
130
  }>;
89
131
  /**
90
132
  * [[115]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleSubject)
91
133
  */
92
- export declare const reifiedTripleSubject: RuleDef<'reifiedTripleSubject', IGraphNode>;
134
+ export declare const reifiedTripleSubject: T11.SparqlGrammarRule<'reifiedTripleSubject', IGraphNode>;
93
135
  /**
94
136
  * [[116]](https://www.w3.org/TR/sparql12-query/#rReifiedTripleObject)
95
137
  */
96
- export declare const reifiedTripleObject: RuleDef<'reifiedTripleObject', RuleDefReturn<typeof reifiedTripleSubject>>;
138
+ export declare const reifiedTripleObject: T11.SparqlGrammarRule<'reifiedTripleObject', RuleDefReturn<typeof reifiedTripleSubject>>;
97
139
  /**
98
140
  * [[117]](https://www.w3.org/TR/sparql12-query/#rTripleTerm)
99
141
  */
100
- export declare const tripleTerm: RuleDef<'tripleTerm', BaseQuadTerm>;
142
+ export declare const tripleTerm: T11.SparqlRule<'tripleTerm', BaseQuadTerm>;
101
143
  /**
102
144
  * [[118]](https://www.w3.org/TR/sparql12-query/#rTripleTermSubject)
103
145
  */
104
- export declare const tripleTermSubject: RuleDef<'tripleTermSubject', T11.VariableTerm | T11.IriTerm | T11.LiteralTerm | T11.BlankTerm>;
146
+ export declare const tripleTermSubject: T11.SparqlGrammarRule<'tripleTermSubject', T11.VariableTerm | T11.IriTerm | T11.LiteralTerm | T11.BlankTerm>;
105
147
  /**
106
148
  * [[119]](https://www.w3.org/TR/sparql12-query/#rTripleTermObject)
107
149
  */
108
- export declare const tripleTermObject: RuleDef<'tripleTermObject', RuleDefReturn<typeof tripleTermSubject> | BaseQuadTerm>;
150
+ export declare const tripleTermObject: T11.SparqlGrammarRule<'tripleTermObject', RuleDefReturn<typeof tripleTermSubject> | BaseQuadTerm>;
109
151
  /**
110
152
  * [[120]](https://www.w3.org/TR/sparql12-query/#rTripleTermData)
111
153
  */
112
- export declare const tripleTermData: RuleDef<'tripleTermData', BaseQuadTerm>;
154
+ export declare const tripleTermData: T11.SparqlGrammarRule<'tripleTermData', BaseQuadTerm>;
113
155
  /**
114
156
  * [[121]](https://www.w3.org/TR/sparql12-query/#rTripleTermDataSubject)
115
157
  */
116
- export declare const tripleTermDataSubject: RuleDef<'tripleTermDataSubject', T11.IriTerm | T11.LiteralTerm>;
158
+ export declare const tripleTermDataSubject: T11.SparqlGrammarRule<'tripleTermDataSubject', T11.IriTerm | T11.LiteralTerm>;
117
159
  /**
118
160
  * [[122]](https://www.w3.org/TR/sparql12-query/#rTripleTermDataObject)
119
161
  */
120
- export declare const tripleTermDataObject: RuleDef<'tripleTermDataObject', RuleDefReturn<typeof tripleTermDataSubject> | BaseQuadTerm>;
162
+ export declare const tripleTermDataObject: T11.SparqlGrammarRule<'tripleTermDataObject', RuleDefReturn<typeof tripleTermDataSubject> | BaseQuadTerm>;
121
163
  /**
122
164
  * OVERRIDING RULE: {@link S11.primaryExpression}.
123
165
  * [[134]](https://www.w3.org/TR/sparql12-query/#rPrimaryExpression)
124
166
  */
125
- export declare const primaryExpression: RuleDef<'primaryExpression', Expression>;
167
+ export declare const primaryExpression: T11.SparqlGrammarRule<'primaryExpression', Expression>;
126
168
  /**
127
169
  * [[135]](https://www.w3.org/TR/sparql12-query/#rExprTripleTerm)
128
170
  */
129
- export declare const exprTripleTerm: RuleDef<'exprTripleTerm', BaseQuadTerm>;
171
+ export declare const exprTripleTerm: T11.SparqlGrammarRule<'exprTripleTerm', BaseQuadTerm>;
130
172
  /**
131
173
  * [[136]](https://www.w3.org/TR/sparql12-query/#rExprTripleTermSubject)
132
174
  */
133
- export declare const exprTripleTermSubject: RuleDef<'exprTripleTermSubject', T11.IriTerm | T11.VariableTerm | T11.LiteralTerm>;
175
+ export declare const exprTripleTermSubject: T11.SparqlGrammarRule<'exprTripleTermSubject', T11.IriTerm | T11.VariableTerm | T11.LiteralTerm>;
134
176
  /**
135
177
  * [[137]](https://www.w3.org/TR/sparql12-query/#rExprTripleTermObject)
136
178
  */
137
- export declare const exprTripleTermObject: RuleDef<'exprTripleTermObject', RuleDefReturn<typeof exprTripleTermSubject> | BaseQuadTerm>;
179
+ export declare const exprTripleTermObject: T11.SparqlGrammarRule<'exprTripleTermObject', RuleDefReturn<typeof exprTripleTermSubject> | BaseQuadTerm>;
138
180
  export declare const builtinLangDir: S11.RuleDefExpressionFunctionX<"builtInLangdir", [T11.Expression]>;
139
181
  export declare const builtinLangStrDir: S11.RuleDefExpressionFunctionX<"builtInStrLangdir", [T11.Expression, T11.Expression, T11.Expression]>;
140
182
  export declare const builtinHasLang: S11.RuleDefExpressionFunctionX<"builtInHasLang", [T11.Expression]>;
@@ -154,4 +196,4 @@ export declare const builtInCall: typeof S11.builtInCall;
154
196
  * No retyping is needed since the return type is the same
155
197
  * [[147]](https://www.w3.org/TR/sparql12-query/#rRDFLiteral)
156
198
  */
157
- export declare const rdfLiteral: typeof S11.rdfLiteral;
199
+ export declare const rdfLiteral: T11.SparqlGrammarRule<'rdfLiteral', T11.LiteralTerm>;