@traqula/generator-sparql-1-2 0.0.5 → 0.0.7
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/lib/index.d.ts +61 -174
- package/lib/index.js.map +1 -1
- package/package.json +8 -8
package/lib/index.d.ts
CHANGED
|
@@ -1,195 +1,82 @@
|
|
|
1
1
|
import { GeneratorBuilder } from '@traqula/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Patch } from '@traqula/core';
|
|
3
3
|
import type * as T11 from '@traqula/rules-sparql-1-1';
|
|
4
4
|
import { Factory } from '@traqula/rules-sparql-1-2';
|
|
5
5
|
import type * as T12 from '@traqula/rules-sparql-1-2';
|
|
6
6
|
declare const sparql12GeneratorBuilder: GeneratorBuilder<{
|
|
7
7
|
factory: Factory;
|
|
8
|
-
}, "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, "load", T12.UpdateOperationLoad, []>;
|
|
34
|
-
update: import("@traqula/core").GeneratorRule<{
|
|
35
|
-
factory: Factory;
|
|
36
|
-
}, "update", T12.Update, []>;
|
|
37
|
-
query: import("@traqula/core").GeneratorRule<{
|
|
38
|
-
factory: Factory;
|
|
39
|
-
}, "query", T12.Query, []>;
|
|
40
|
-
quads: import("@traqula/core").GeneratorRule<{
|
|
41
|
-
factory: Factory;
|
|
42
|
-
}, "quads", Wrap<T12.Quads[]>, []>;
|
|
43
|
-
graphRef: import("@traqula/core").GeneratorRule<{
|
|
44
|
-
factory: Factory;
|
|
45
|
-
}, "graphRef", T11.TermIri, []>;
|
|
46
|
-
create: import("@traqula/core").GeneratorRule<{
|
|
47
|
-
factory: Factory;
|
|
48
|
-
}, "create", T12.UpdateOperationCreate, []>;
|
|
49
|
-
modify: import("@traqula/core").GeneratorRule<{
|
|
50
|
-
factory: Factory;
|
|
51
|
-
}, "modify", T12.UpdateOperationModify, []>;
|
|
52
|
-
datasetClauses: import("@traqula/core").GeneratorRule<{
|
|
53
|
-
factory: Factory;
|
|
54
|
-
}, "datasetClauses", T12.DatasetClauses, []>;
|
|
55
|
-
bind: import("@traqula/core").GeneratorRule<{
|
|
56
|
-
factory: Factory;
|
|
57
|
-
}, "bind", T12.PatternBind, []>;
|
|
58
|
-
solutionModifier: import("@traqula/core").GeneratorRule<{
|
|
59
|
-
factory: Factory;
|
|
60
|
-
}, "solutionModifier", T12.SolutionModifiers, []>;
|
|
61
|
-
expression: import("@traqula/core").GeneratorRule<{
|
|
62
|
-
factory: Factory;
|
|
63
|
-
}, "expression", T12.Expression, []>;
|
|
64
|
-
aggregate: import("@traqula/core").GeneratorRule<{
|
|
65
|
-
factory: Factory;
|
|
66
|
-
}, "aggregate", T12.ExpressionAggregate, []>;
|
|
67
|
-
blankNode: import("@traqula/core").GeneratorRule<any, "blankNode"> & T11.SparqlGrammarRule<"blankNode", T11.TermBlank, []> & T11.SparqlGeneratorRule<"blankNode", T11.TermBlank, []>;
|
|
68
|
-
rdfLiteral: import("@traqula/core").GeneratorRule<{
|
|
69
|
-
factory: Factory;
|
|
70
|
-
}, "rdfLiteral", T11.TermLiteral, []>;
|
|
71
|
-
iri: import("@traqula/core").GeneratorRule<any, "iri"> & T11.SparqlGrammarRule<"iri", T11.TermIri, []> & T11.SparqlGeneratorRule<"iri", T11.TermIri, []>;
|
|
72
|
-
iriFull: import("@traqula/core").GeneratorRule<any, "iriFull"> & T11.SparqlGrammarRule<"iriFull", T11.TermIriFull, []> & T11.SparqlGeneratorRule<"iriFull", T11.TermIriFull, []>;
|
|
73
|
-
prefixedName: import("@traqula/core").GeneratorRule<any, "prefixedName"> & T11.SparqlGrammarRule<"prefixedName", T11.TermIriPrefixed, []> & T11.SparqlGeneratorRule<"prefixedName", T11.TermIriPrefixed, []>;
|
|
8
|
+
}, "copy" | "filter" | "path" | "query" | "clear" | "drop" | "quads" | "graphRef" | "load" | "create" | "add" | "move" | "modify" | "update" | "datasetClauses" | "bind" | "solutionModifier" | "expression" | "aggregate" | "blankNode" | "rdfLiteral" | "iri" | "iriFull" | "prefixedName" | "prologue" | "baseDecl" | "prefixDecl" | "varOrTerm" | "var" | "graphTerm" | "usingClauses" | "groupGraphPattern" | "triplesBlock" | "triplesNodePath" | "graphNodePath" | "collectionPath" | "blankNodePropertyListPath" | "whereClause" | "generatePattern" | "graphPatternNotTriples" | "groupOrUnionGraphPattern" | "optionalGraphPattern" | "minusGraphPattern" | "graphGraphPattern" | "serviceGraphPattern" | "inlineData" | "argList" | "iriOrFunction" | "limitOffsetClauses" | "groupClause" | "havingClause" | "orderClause" | "selectQuery" | "constructQuery" | "describeQuery" | "askQuery" | "selectClause" | "update1" | "insertData" | "deleteData" | "deleteWhere" | "graphRefAll" | "quadsNotTriples" | "queryOrUpdate" | "reifiedTriple" | "versionDecl" | "annotationPath" | "annotationBlockPath" | "tripleTerm", {
|
|
9
|
+
copy: never;
|
|
10
|
+
filter: never;
|
|
11
|
+
path: never;
|
|
12
|
+
query: never;
|
|
13
|
+
clear: never;
|
|
14
|
+
drop: never;
|
|
15
|
+
quads: never;
|
|
16
|
+
graphRef: never;
|
|
17
|
+
load: never;
|
|
18
|
+
create: never;
|
|
19
|
+
add: never;
|
|
20
|
+
move: never;
|
|
21
|
+
modify: never;
|
|
22
|
+
update: never;
|
|
23
|
+
datasetClauses: never;
|
|
24
|
+
bind: never;
|
|
25
|
+
solutionModifier: never;
|
|
26
|
+
expression: never;
|
|
27
|
+
aggregate: never;
|
|
28
|
+
blankNode: never;
|
|
29
|
+
rdfLiteral: never;
|
|
30
|
+
iri: never;
|
|
31
|
+
iriFull: never;
|
|
32
|
+
prefixedName: never;
|
|
74
33
|
prologue: import("@traqula/core").GeneratorRule<{
|
|
75
34
|
factory: Factory;
|
|
76
35
|
}, "prologue", T12.ContextDefinition[], []>;
|
|
77
|
-
baseDecl:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
factory: Factory;
|
|
82
|
-
}, "prefixDecl", T11.ContextDefinitionPrefix, []>;
|
|
83
|
-
varOrTerm: import("@traqula/core").GeneratorRule<{
|
|
84
|
-
factory: Factory;
|
|
85
|
-
}, "varOrTerm", T12.Term, []>;
|
|
36
|
+
baseDecl: never;
|
|
37
|
+
prefixDecl: never;
|
|
38
|
+
varOrTerm: never;
|
|
39
|
+
var: never;
|
|
86
40
|
graphTerm: import("@traqula/core").GeneratorRule<{
|
|
87
41
|
factory: Factory;
|
|
88
42
|
}, "graphTerm", T12.GraphTerm, []>;
|
|
89
|
-
usingClauses:
|
|
90
|
-
|
|
91
|
-
}, "usingClauses", T12.DatasetClauses, []>;
|
|
92
|
-
groupGraphPattern: import("@traqula/core").GeneratorRule<{
|
|
93
|
-
factory: Factory;
|
|
94
|
-
}, "groupGraphPattern", T12.PatternGroup, []>;
|
|
43
|
+
usingClauses: never;
|
|
44
|
+
groupGraphPattern: never;
|
|
95
45
|
triplesBlock: import("@traqula/core").GeneratorRule<{
|
|
96
46
|
factory: Factory;
|
|
97
47
|
}, "triplesBlock", T12.PatternBgp, []>;
|
|
98
|
-
triplesNodePath:
|
|
99
|
-
factory: Factory;
|
|
100
|
-
}, "triplesNodePath", T12.TripleCollection, []>;
|
|
48
|
+
triplesNodePath: never;
|
|
101
49
|
graphNodePath: import("@traqula/core").GeneratorRule<{
|
|
102
50
|
factory: Factory;
|
|
103
51
|
}, "graphNodePath", T12.GraphNode, []>;
|
|
104
|
-
collectionPath:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
factory: Factory;
|
|
133
|
-
}, "graphGraphPattern", T12.PatternGroup, []>;
|
|
134
|
-
serviceGraphPattern: import("@traqula/core").GeneratorRule<{
|
|
135
|
-
factory: Factory;
|
|
136
|
-
}, "serviceGraphPattern", T12.PatternService, []>;
|
|
137
|
-
inlineData: import("@traqula/core").GeneratorRule<{
|
|
138
|
-
factory: Factory;
|
|
139
|
-
}, "inlineData", T12.PatternValues, []>;
|
|
140
|
-
argList: import("@traqula/core").GeneratorRule<{
|
|
141
|
-
factory: Factory;
|
|
142
|
-
}, "argList", Patch<T11.gram.IArgList, {
|
|
143
|
-
args: T12.Expression[];
|
|
144
|
-
}>, []>;
|
|
145
|
-
iriOrFunction: import("@traqula/core").GeneratorRule<{
|
|
146
|
-
factory: Factory;
|
|
147
|
-
}, "iriOrFunction", T11.TermIri | T12.ExpressionFunctionCall, []>;
|
|
148
|
-
limitOffsetClauses: import("@traqula/core").GeneratorRule<{
|
|
149
|
-
factory: Factory;
|
|
150
|
-
}, "limitOffsetClauses", T11.SolutionModifierLimitOffset, []>;
|
|
151
|
-
groupClause: import("@traqula/core").GeneratorRule<{
|
|
152
|
-
factory: Factory;
|
|
153
|
-
}, "groupClause", T12.SolutionModifierGroup, []>;
|
|
154
|
-
havingClause: import("@traqula/core").GeneratorRule<{
|
|
155
|
-
factory: Factory;
|
|
156
|
-
}, "havingClause", T12.SolutionModifierHaving, []>;
|
|
157
|
-
orderClause: import("@traqula/core").GeneratorRule<{
|
|
158
|
-
factory: Factory;
|
|
159
|
-
}, "orderClause", T12.SolutionModifierOrder, []>;
|
|
160
|
-
selectQuery: import("@traqula/core").GeneratorRule<{
|
|
161
|
-
factory: Factory;
|
|
162
|
-
}, "selectQuery", Omit<T12.QuerySelect, T11.gram.HandledByBase>, []>;
|
|
163
|
-
constructQuery: import("@traqula/core").GeneratorRule<{
|
|
164
|
-
factory: Factory;
|
|
165
|
-
}, "constructQuery", Omit<T12.QueryConstruct, T11.gram.HandledByBase>, []>;
|
|
166
|
-
describeQuery: import("@traqula/core").GeneratorRule<{
|
|
167
|
-
factory: Factory;
|
|
168
|
-
}, "describeQuery", Omit<T12.QueryDescribe, T11.gram.HandledByBase>, []>;
|
|
169
|
-
askQuery: import("@traqula/core").GeneratorRule<{
|
|
170
|
-
factory: Factory;
|
|
171
|
-
}, "askQuery", Omit<T12.QueryAsk, T11.gram.HandledByBase>, []>;
|
|
172
|
-
selectClause: import("@traqula/core").GeneratorRule<{
|
|
173
|
-
factory: Factory;
|
|
174
|
-
}, "selectClause", Wrap<Pick<T12.QuerySelect, "distinct" | "variables" | "reduced">>, []>;
|
|
175
|
-
update1: import("@traqula/core").GeneratorRule<{
|
|
176
|
-
factory: Factory;
|
|
177
|
-
}, "update1", T12.UpdateOperation, []>;
|
|
178
|
-
insertData: import("@traqula/core").GeneratorRule<{
|
|
179
|
-
factory: Factory;
|
|
180
|
-
}, "insertData", T12.UpdateOperationInsertData, []>;
|
|
181
|
-
deleteData: import("@traqula/core").GeneratorRule<{
|
|
182
|
-
factory: Factory;
|
|
183
|
-
}, "deleteData", T12.UpdateOperationDeleteData, []>;
|
|
184
|
-
deleteWhere: import("@traqula/core").GeneratorRule<{
|
|
185
|
-
factory: Factory;
|
|
186
|
-
}, "deleteWhere", T12.UpdateOperationDeleteWhere, []>;
|
|
187
|
-
graphRefAll: import("@traqula/core").GeneratorRule<{
|
|
188
|
-
factory: Factory;
|
|
189
|
-
}, "graphRefAll", T11.GraphRef, []>;
|
|
190
|
-
quadsNotTriples: import("@traqula/core").GeneratorRule<{
|
|
191
|
-
factory: Factory;
|
|
192
|
-
}, "quadsNotTriples", T12.GraphQuads, []>;
|
|
52
|
+
collectionPath: never;
|
|
53
|
+
blankNodePropertyListPath: never;
|
|
54
|
+
whereClause: never;
|
|
55
|
+
generatePattern: never;
|
|
56
|
+
graphPatternNotTriples: never;
|
|
57
|
+
groupOrUnionGraphPattern: never;
|
|
58
|
+
optionalGraphPattern: never;
|
|
59
|
+
minusGraphPattern: never;
|
|
60
|
+
graphGraphPattern: never;
|
|
61
|
+
serviceGraphPattern: never;
|
|
62
|
+
inlineData: never;
|
|
63
|
+
argList: never;
|
|
64
|
+
iriOrFunction: never;
|
|
65
|
+
limitOffsetClauses: never;
|
|
66
|
+
groupClause: never;
|
|
67
|
+
havingClause: never;
|
|
68
|
+
orderClause: never;
|
|
69
|
+
selectQuery: never;
|
|
70
|
+
constructQuery: never;
|
|
71
|
+
describeQuery: never;
|
|
72
|
+
askQuery: never;
|
|
73
|
+
selectClause: never;
|
|
74
|
+
update1: never;
|
|
75
|
+
insertData: never;
|
|
76
|
+
deleteData: never;
|
|
77
|
+
deleteWhere: never;
|
|
78
|
+
graphRefAll: never;
|
|
79
|
+
quadsNotTriples: never;
|
|
193
80
|
queryOrUpdate: import("@traqula/core").GeneratorRule<{
|
|
194
81
|
factory: Factory;
|
|
195
82
|
}, "queryOrUpdate", T12.Update | T12.Query, []>;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,IAAI,IAAI,GAAG,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGvF,MAAM,aAAa,GAAqE;IACtF,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,CAAC,EAA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C,GAAG,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;CACF","sourcesContent":["import { GeneratorBuilder } from '@traqula/core';\nimport type { Wrap, Patch } from '@traqula/core';\nimport { sparql11GeneratorBuilder } from '@traqula/generator-sparql-1-1';\nimport type * as T11 from '@traqula/rules-sparql-1-1';\nimport {\n gram as g11,\n} from '@traqula/rules-sparql-1-1';\nimport { completeParseContext, Factory, gram as g12 } from '@traqula/rules-sparql-1-2';\nimport type * as T12 from '@traqula/rules-sparql-1-2';\n\nconst queryOrUpdate: T12.SparqlGeneratorRule<'queryOrUpdate', T12.Query | T12.Update> = {\n name: 'queryOrUpdate',\n gImpl: ({ SUBRULE }) => (ast, { factory: F }) => {\n if (F.isQuery(ast)) {\n SUBRULE(g11.query, <T11.Query> ast);\n } else {\n SUBRULE(g11.update, <T11.Update> ast);\n }\n },\n};\n\nconst sparql12GeneratorBuilder =\n GeneratorBuilder.create(sparql11GeneratorBuilder)\n .widenContext<{ factory: Factory }>()\n .typePatch<{\n [g11.query.name]: T12.Query;\n [g11.selectQuery.name]: Omit<T12.QuerySelect, g11.HandledByBase
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,IAAI,IAAI,GAAG,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGvF,MAAM,aAAa,GAAqE;IACtF,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;QAC9C,IAAI,CAA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@traqula/core';\nimport type { Wrap, Patch } from '@traqula/core';\nimport { sparql11GeneratorBuilder } from '@traqula/generator-sparql-1-1';\nimport type * as T11 from '@traqula/rules-sparql-1-1';\nimport {\n gram as g11,\n} from '@traqula/rules-sparql-1-1';\nimport { completeParseContext, Factory, gram as g12 } from '@traqula/rules-sparql-1-2';\nimport type * as T12 from '@traqula/rules-sparql-1-2';\n\nconst queryOrUpdate: T12.SparqlGeneratorRule<'queryOrUpdate', T12.Query | T12.Update> = {\n name: 'queryOrUpdate',\n gImpl: ({ SUBRULE }) => (ast, { factory: F }) => {\n if (F.isQuery(ast)) {\n SUBRULE(g11.query, <T11.Query> ast);\n } else {\n SUBRULE(g11.update, <T11.Update> ast);\n }\n },\n};\n\nconst sparql12GeneratorBuilder =\n GeneratorBuilder.create(sparql11GeneratorBuilder)\n .widenContext<{ factory: Factory }>()\n .typePatch<{\n [g11.query.name]: [T12.Query];\n [g11.selectQuery.name]: [Omit<T12.QuerySelect, g11.HandledByBase>];\n [g11.constructQuery.name]: [ Omit<T12.QueryConstruct, g11.HandledByBase>];\n [g11.describeQuery.name]: [Omit<T12.QueryDescribe, g11.HandledByBase>];\n [g11.askQuery.name]: [Omit<T12.QueryAsk, g11.HandledByBase>];\n [g11.selectClause.name]: [ Wrap<Pick<T12.QuerySelect, 'variables' | 'distinct' | 'reduced'>> ];\n\n [g11.update.name]: [T12.Update];\n [g11.update1.name]: [T12.UpdateOperation];\n [g11.load.name]: [T12.UpdateOperationLoad];\n [g11.clear.name]: [T12.UpdateOperationClear];\n [g11.drop.name]: [T12.UpdateOperationDrop];\n [g11.create.name]: [T12.UpdateOperationCreate];\n [g11.copy.name]: [T12.UpdateOperationCopy];\n [g11.move.name]: [T12.UpdateOperationMove];\n [g11.add.name]: [T12.UpdateOperationAdd];\n [g11.insertData.name]: [T12.UpdateOperationInsertData];\n [g11.deleteData.name]: [T12.UpdateOperationDeleteData];\n [g11.deleteWhere.name]: [T12.UpdateOperationDeleteWhere];\n [g11.modify.name]: [T12.UpdateOperationModify];\n [g11.graphRef.name]: [T12.TermIri];\n [g11.graphRefAll.name]: [T12.GraphRef];\n [g11.quads.name]: [Wrap<T12.Quads[]>];\n [g11.quadsNotTriples.name]: [T12.GraphQuads];\n\n [g11.aggregate.name]: [ T12.ExpressionAggregate ];\n\n [g11.datasetClauseStar.name]: [ T12.DatasetClauses ];\n [g11.usingClauseStar.name]: [ T12.DatasetClauses ];\n\n // [g11.datasetClause.name]: unchanged;\n [g11.argList.name]: [ Patch<g11.IArgList, { args: T12.Expression[] }> ];\n [g11.expression.name]: [ T12.Expression ];\n [g11.iriOrFunction.name]: [T12.TermIri | T12.ExpressionFunctionCall];\n\n [g11.prologue.name]: [ T12.ContextDefinition[] ];\n [g11.prefixDecl.name]: [ T12.ContextDefinitionPrefix ];\n [g11.baseDecl.name]: [ T12.ContextDefinitionBase ];\n // [g11.var_.name]: unchanged;\n [g11.varOrTerm.name]: [ T12.Term ];\n [g11.graphTerm.name]: [ T12.GraphTerm ];\n\n [g11.rdfLiteral.name]: [T12.TermLiteral];\n // [g11.string.name]: unchanged;\n // [g11.iri.name]: unchanged;\n // [g11.iriFull.name]: unchanged;\n // [g11.prefixedName.name]: unchanged;\n // [g11.blankNode.name]: unchanged;\n\n // [g11.path.name]: unchanged;\n //\n [g11.solutionModifier.name]: [ T12.SolutionModifiers ];\n [g11.groupClause.name]: [ T12.SolutionModifierGroup ];\n [g11.havingClause.name]: [ T12.SolutionModifierHaving ];\n [g11.orderClause.name]: [ T12.SolutionModifierOrder ];\n [g11.limitOffsetClauses.name]: [ T12.SolutionModifierLimitOffset ];\n\n [g11.triplesBlock.name]: [ T12.PatternBgp ];\n [g11.collectionPath.name]: [ T12.TripleCollectionList ];\n [g11.blankNodePropertyListPath.name]: [ T12.TripleCollectionBlankNodeProperties ];\n [g11.triplesNodePath.name]: [ T12.TripleCollection ];\n [g11.graphNodePath.name]: [ T12.Term | T12.TripleCollection ];\n\n [g11.whereClause.name]: [ Wrap<T12.PatternGroup> ];\n [g11.generatePattern.name]: [ T12.Pattern ];\n [g11.groupGraphPattern.name]: [ T12.PatternGroup ];\n [g11.graphPatternNotTriples.name]: [ Exclude<T12.Pattern, T12.SubSelect | T12.PatternBgp> ];\n [g11.optionalGraphPattern.name]: [ T12.PatternOptional ];\n [g11.graphGraphPattern.name]: [ T12.PatternGroup ];\n [g11.serviceGraphPattern.name]: [ T12.PatternService ];\n [g11.bind.name]: [ T12.PatternBind ];\n [g11.inlineData.name]: [ T12.PatternValues ];\n [g11.minusGraphPattern.name]: [ T12.PatternMinus ];\n [g11.groupOrUnionGraphPattern.name]: [ T12.PatternGroup | T12.PatternUnion ];\n [g11.filter.name]: [ T12.PatternFilter ];\n }>()\n .addRule(g12.tripleTerm)\n .addRule(g12.reifiedTriple)\n .patchRule(g12.graphNodePath)\n .addRule(g12.annotationBlockPath)\n .addRule(g12.annotationPath)\n .addRule(g12.versionDecl)\n .patchRule(g12.prologue)\n .patchRule(queryOrUpdate)\n .patchRule(g12.generateTriplesBlock)\n .patchRule(g12.generateGraphTerm);\n\nexport type SparqlGenerator = ReturnType<typeof sparql12GeneratorBuilder.build>;\n\nexport class Generator {\n private readonly generator: SparqlGenerator = sparql12GeneratorBuilder.build();\n private readonly F = new Factory();\n\n public generate(\n ast: T12.Query | T12.Update,\ncontext: Partial<T12.SparqlContext & { origSource: string }> = {},\n ): string {\n return this.generator.queryOrUpdate(ast, completeParseContext(context));\n }\n\n public generatePath(ast: T12.Path, context: Partial<T12.SparqlContext & { origSource: string }> = {}): string {\n return this.generator.path(ast, completeParseContext(context), undefined);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/generator-sparql-1-2",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"description": "SPARQL 1.2 generator",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@traqula/core": "^0.0.
|
|
45
|
-
"@traqula/generator-sparql-1-1": "^0.0.
|
|
46
|
-
"@traqula/rules-sparql-1-1": "^0.0.
|
|
47
|
-
"@traqula/rules-sparql-1-2": "^0.0.
|
|
44
|
+
"@traqula/core": "^0.0.7",
|
|
45
|
+
"@traqula/generator-sparql-1-1": "^0.0.7",
|
|
46
|
+
"@traqula/rules-sparql-1-1": "^0.0.7",
|
|
47
|
+
"@traqula/rules-sparql-1-2": "^0.0.7"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@traqula/parser-sparql-1-2": "^0.0.
|
|
50
|
+
"@traqula/parser-sparql-1-2": "^0.0.7",
|
|
51
51
|
"@traqula/rules-sparql-1-2": "^0.0.1",
|
|
52
|
-
"@traqula/test-utils": "^0.0.
|
|
52
|
+
"@traqula/test-utils": "^0.0.7"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c8d47c5a14075386821fe96e026cf61348a06258"
|
|
55
55
|
}
|