@lowgular/code-graph 0.0.1 → 0.1.1

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.
Files changed (179) hide show
  1. package/bin/cli.js +10 -0
  2. package/code-graph-v2/code.graph.js +37 -0
  3. package/code-graph-v2/config-from-query.js +131 -0
  4. package/code-graph-v2/extractors/extractor.js +27 -0
  5. package/code-graph-v2/extractors/index.js +1 -0
  6. package/code-graph-v2/graph-builder/code-graph.builder.js +49 -0
  7. package/code-graph-v2/graph-builder/index.js +1 -0
  8. package/code-graph-v2/graph-builder/node.processor.js +22 -0
  9. package/{libs/cli/code-graph/src/lib/v2 → code-graph-v2}/graph-builder/relationship.processor.js +11 -35
  10. package/code-graph-v2/graph-builder/type.processor.js +21 -0
  11. package/code-graph-v2/index.js +4 -0
  12. package/code-graph-v2/tools/build-code-graph.tool.js +19 -0
  13. package/code-graph-v2/utils.js +34 -0
  14. package/codegular/index.js +5 -0
  15. package/codegular/node.js +71 -0
  16. package/codegular/program.js +100 -0
  17. package/{libs/core/codegular/src/lib → codegular}/string.js +6 -53
  18. package/{libs/core/codegular/src/lib → codegular}/type-checker.js +3 -40
  19. package/codegular/type.js +356 -0
  20. package/{libs/core/codegular/src/lib → codegular}/utils.js +50 -62
  21. package/cypher/index.js +1 -0
  22. package/{libs/cli/cypher/src → cypher}/lib/executor/condition-evaluator.js +2 -25
  23. package/cypher/lib/executor/executor.js +60 -0
  24. package/cypher/lib/executor/graph.js +0 -0
  25. package/{libs/cli/cypher/src → cypher}/lib/executor/match-engine.js +4 -27
  26. package/{libs/cli/cypher/src → cypher}/lib/executor/pattern-matcher.js +2 -25
  27. package/{libs/cli/cypher/src → cypher}/lib/executor/relationship-navigator.js +2 -25
  28. package/{libs/cli/cypher/src → cypher}/lib/executor/result-formatter.js +37 -31
  29. package/{libs/cli/cypher/src → cypher}/lib/executor/traverse-engine.js +4 -27
  30. package/cypher/lib/executor/utils.js +14 -0
  31. package/cypher/lib/graph.stub.js +38 -0
  32. package/cypher/lib/index.js +32 -0
  33. package/{libs/cli/cypher/src → cypher}/lib/lexer.js +4 -26
  34. package/{libs/cli/cypher/src → cypher}/lib/parser.js +119 -135
  35. package/{libs/cli/cypher/src → cypher}/lib/validator/query-validator.js +12 -32
  36. package/{libs/cli/cypher/src → cypher}/lib/validator/supported-features.config.js +2 -30
  37. package/{libs/cli/cypher/src → cypher}/lib/validator/unsupported-features.config.js +8 -34
  38. package/cypher-cli.js +41 -0
  39. package/infra/code-graph.js +147 -0
  40. package/main.js +0 -43
  41. package/package.json +25 -7
  42. package/resources-cli.js +75 -0
  43. package/run-cli.js +43 -0
  44. package/apps/code-graph/src/main.js +0 -50
  45. package/libs/cli/code-graph/src/index.js +0 -39
  46. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
  47. package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
  48. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
  49. package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
  50. package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
  51. package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
  52. package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
  53. package/libs/cli/code-graph/src/lib/core/core.js +0 -58
  54. package/libs/cli/code-graph/src/lib/core.js +0 -85
  55. package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
  56. package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
  57. package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
  58. package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
  59. package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
  60. package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
  61. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
  62. package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
  63. package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
  64. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
  65. package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
  66. package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
  67. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
  68. package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
  69. package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
  70. package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
  71. package/libs/cli/code-graph/src/lib/types/index.js +0 -99
  72. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
  73. package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
  74. package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
  75. package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
  76. package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
  77. package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
  78. package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
  79. package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
  80. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
  81. package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
  82. package/libs/cli/cypher/src/index.js +0 -25
  83. package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
  84. package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
  85. package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
  86. package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
  87. package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
  88. package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
  89. package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
  90. package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
  91. package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
  92. package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
  93. package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
  94. package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
  95. package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
  96. package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
  97. package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
  98. package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
  99. package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
  100. package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
  101. package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
  102. package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
  103. package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
  104. package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
  105. package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
  106. package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
  107. package/libs/cli/cypher/src/lib/index.js +0 -74
  108. package/libs/cli/shared/src/index.js +0 -53
  109. package/libs/cli/shared/src/lib/admin-token.js +0 -121
  110. package/libs/cli/shared/src/lib/config.js +0 -49
  111. package/libs/cli/shared/src/lib/consts.js +0 -57
  112. package/libs/cli/shared/src/lib/core.js +0 -46
  113. package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
  114. package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
  115. package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
  116. package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
  117. package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
  118. package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
  119. package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
  120. package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
  121. package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
  122. package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
  123. package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
  124. package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
  125. package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
  126. package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
  127. package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
  128. package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
  129. package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
  130. package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
  131. package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
  132. package/libs/cli/shared/src/lib/token.js +0 -135
  133. package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
  134. package/libs/cli/shared/src/lib/utils/utils.js +0 -89
  135. package/libs/cli/typescript/src/index.js +0 -21
  136. package/libs/cli/typescript/src/lib/base/index.js +0 -23
  137. package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
  138. package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
  139. package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
  140. package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
  141. package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
  142. package/libs/cli/typescript/src/lib/core/index.js +0 -35
  143. package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
  144. package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
  145. package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
  146. package/libs/cli/typescript/src/lib/core/type.js +0 -374
  147. package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
  148. package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
  149. package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
  150. package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
  151. package/libs/cli/typescript/src/lib/index.js +0 -57
  152. package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
  153. package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
  154. package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
  155. package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
  156. package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
  157. package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
  158. package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
  159. package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
  160. package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
  161. package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
  162. package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
  163. package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
  164. package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
  165. package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
  166. package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
  167. package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
  168. package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
  169. package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
  170. package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
  171. package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
  172. package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
  173. package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
  174. package/libs/cli/typescript/src/lib/utils.js +0 -39
  175. package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
  176. package/libs/core/codegular/src/index.js +0 -21
  177. package/libs/core/codegular/src/lib/index.js +0 -29
  178. package/libs/core/codegular/src/lib/node.js +0 -112
  179. package/libs/core/codegular/src/lib/program.js +0 -92
@@ -1,277 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var advanced_optional_match_feature_exports = {};
19
- __export(advanced_optional_match_feature_exports, {
20
- ADVANCED_OPTIONAL_MATCH_FEATURES: () => ADVANCED_OPTIONAL_MATCH_FEATURES
21
- });
22
- module.exports = __toCommonJS(advanced_optional_match_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const ADVANCED_OPTIONAL_MATCH_FEATURES = [
25
- {
26
- name: "Filter optional matches with WHERE IS NOT NULL",
27
- description: "Use WHERE IS NOT NULL to filter out results where optional matches failed, keeping only results with successful optional matches.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
29
- queries: [
30
- [
31
- "MATCH (a:A)",
32
- "OPTIONAL MATCH (a)-[:R1]->(b:B)",
33
- "WHERE b IS NOT NULL",
34
- "RETURN a, b"
35
- ]
36
- ],
37
- results: [
38
- {
39
- a: {
40
- id: "1"
41
- },
42
- b: {
43
- id: "2"
44
- }
45
- }
46
- ]
47
- },
48
- {
49
- name: "Filter optional matches with WHERE IS NULL",
50
- description: "Use WHERE IS NULL to find results where optional matches failed, filtering out successful optional matches.",
51
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
52
- queries: [
53
- [
54
- "MATCH (a:A)",
55
- "OPTIONAL MATCH (a)-[:R1]->(b:B)",
56
- "WHERE b IS NULL",
57
- "RETURN a, b"
58
- ]
59
- ],
60
- results: [
61
- {
62
- a: {
63
- id: "3"
64
- },
65
- b: null
66
- }
67
- ]
68
- },
69
- {
70
- name: "Multiple optional matches sequentially",
71
- description: "Multiple OPTIONAL MATCH statements can be chained sequentially, each building on previous results.",
72
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "C")).addEdge((0, import_graph2.stubEdge)("1", "3", "R2")).addNode((0, import_graph2.stubNode)("4", "A")).build(),
73
- queries: [
74
- [
75
- "MATCH (a:A)",
76
- "OPTIONAL MATCH (a)-[:R1]->(b:B)",
77
- "OPTIONAL MATCH (a)-[:R2]->(c:C)",
78
- "RETURN a, b, c"
79
- ]
80
- ],
81
- results: [
82
- {
83
- a: {
84
- id: "1"
85
- },
86
- b: {
87
- id: "2"
88
- },
89
- c: {
90
- id: "3"
91
- }
92
- },
93
- {
94
- a: {
95
- id: "4"
96
- },
97
- b: null,
98
- c: null
99
- }
100
- ]
101
- },
102
- {
103
- name: "Optional match with comma-separated patterns",
104
- description: "OPTIONAL MATCH supports comma-separated patterns in a single statement, creating a Cartesian product of optional matches.",
105
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "C")).build(),
106
- queries: [
107
- [
108
- "MATCH (a:A)",
109
- "OPTIONAL MATCH (a)-[:R1]->(b:B), (c:C)",
110
- "RETURN a, b, c"
111
- ]
112
- ],
113
- results: [
114
- {
115
- a: {
116
- id: "1"
117
- },
118
- b: {
119
- id: "2"
120
- },
121
- c: {
122
- id: "3"
123
- }
124
- }
125
- ]
126
- },
127
- {
128
- name: "Bind optional relationship variable when match exists",
129
- description: "When an optional relationship is bound to a variable and the match succeeds, the relationship object is included in results.",
130
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
131
- queries: [
132
- ["MATCH (a:A)", "OPTIONAL MATCH (a)-[rel:R1]->(b:B)", "RETURN a, rel, b"]
133
- ],
134
- results: [
135
- {
136
- a: {
137
- id: "1"
138
- },
139
- rel: {
140
- source: "1",
141
- target: "2",
142
- type: "R1"
143
- },
144
- b: {
145
- id: "2"
146
- }
147
- },
148
- {
149
- a: {
150
- id: "3"
151
- },
152
- rel: null,
153
- b: null
154
- }
155
- ]
156
- },
157
- {
158
- name: "Set optional relationship variable to null when no match",
159
- description: "When an optional relationship variable is bound but no match exists, both the relationship and target node variables are set to null.",
160
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).build(),
161
- queries: [
162
- ["MATCH (a:A)", "OPTIONAL MATCH (a)-[rel:R1]->(b:B)", "RETURN a, rel, b"]
163
- ],
164
- results: [
165
- {
166
- a: {
167
- id: "1"
168
- },
169
- rel: null,
170
- b: null
171
- }
172
- ]
173
- },
174
- {
175
- name: "Optional incoming relationship",
176
- description: "OPTIONAL MATCH works with incoming relationships (reverse direction), matching relationships where the optional node is the source.",
177
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("2", "1", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
178
- queries: [
179
- ["MATCH (a:A)", "OPTIONAL MATCH (a)<-[:R1]-(b:B)", "RETURN a, b"]
180
- ],
181
- results: [
182
- {
183
- a: {
184
- id: "1"
185
- },
186
- b: {
187
- id: "2"
188
- }
189
- },
190
- {
191
- a: {
192
- id: "3"
193
- },
194
- b: null
195
- }
196
- ]
197
- },
198
- {
199
- name: "Optional undirected relationship",
200
- description: "OPTIONAL MATCH works with undirected relationships, matching relationships in either direction.",
201
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
202
- queries: [["MATCH (a:A)", "OPTIONAL MATCH (a)-[:R1]-(b:B)", "RETURN a, b"]],
203
- results: [
204
- {
205
- a: {
206
- id: "1"
207
- },
208
- b: {
209
- id: "2"
210
- }
211
- },
212
- {
213
- a: {
214
- id: "3"
215
- },
216
- b: null
217
- }
218
- ]
219
- },
220
- {
221
- name: "Optional match starting from empty graph",
222
- description: "When OPTIONAL MATCH is used without a required MATCH and the graph is empty, it returns no results.",
223
- graphFactory: () => new import_graph2.GraphBuilder().build(),
224
- queries: [["OPTIONAL MATCH (a:A)", "RETURN a"]],
225
- results: []
226
- },
227
- {
228
- name: "Optional match with nodes in graph",
229
- description: "When OPTIONAL MATCH is used without a required MATCH and nodes exist, it matches all nodes like a regular MATCH.",
230
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).build(),
231
- queries: [["OPTIONAL MATCH (a:A)", "RETURN a"]],
232
- results: [
233
- {
234
- a: {
235
- id: "1"
236
- }
237
- },
238
- {
239
- a: {
240
- id: "2"
241
- }
242
- }
243
- ]
244
- },
245
- {
246
- name: "Optional match with property filter on optional node",
247
- description: "Property filters can be applied to optional nodes in the OPTIONAL MATCH pattern, filtering which optional matches succeed.",
248
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B", { id: "2" })).addNode((0, import_graph2.stubNode)("3", "B", { id: "3" })).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addEdge((0, import_graph2.stubEdge)("1", "3", "R1")).addNode((0, import_graph2.stubNode)("4", "A")).build(),
249
- queries: [
250
- [
251
- "MATCH (a:A)",
252
- 'OPTIONAL MATCH (a)-[:R1]->(b:B {id: "2"})',
253
- "RETURN a, b"
254
- ]
255
- ],
256
- results: [
257
- {
258
- a: {
259
- id: "1"
260
- },
261
- b: {
262
- id: "2"
263
- }
264
- },
265
- {
266
- a: {
267
- id: "4"
268
- },
269
- b: null
270
- }
271
- ]
272
- }
273
- ];
274
- // Annotate the CommonJS export names for ESM import in node:
275
- 0 && (module.exports = {
276
- ADVANCED_OPTIONAL_MATCH_FEATURES
277
- });
@@ -1,69 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var anonymous_relationship_feature_exports = {};
19
- __export(anonymous_relationship_feature_exports, {
20
- ANONYMOUS_RELATIONSHIP_FEATURES: () => ANONYMOUS_RELATIONSHIP_FEATURES
21
- });
22
- module.exports = __toCommonJS(anonymous_relationship_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const ANONYMOUS_RELATIONSHIP_FEATURES = [
25
- {
26
- name: "Match any relationship type",
27
- description: "Empty relationship type specification [] matches any relationship type.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "ANY_TYPE")).build(),
29
- queries: [["MATCH (a:A)-[]->(b:B)", "RETURN a, b"]],
30
- results: [
31
- {
32
- a: {
33
- id: "1"
34
- },
35
- b: {
36
- id: "2"
37
- }
38
- }
39
- ]
40
- },
41
- {
42
- name: "Match different relationship types",
43
- description: "Empty relationship type matches relationships of any type, including different types in the same graph.",
44
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).addNode((0, import_graph2.stubNode)("4", "B")).addEdge((0, import_graph2.stubEdge)("3", "4", "R2")).build(),
45
- queries: [["MATCH (a:A)-[]->(b:B)", "RETURN a, b"]],
46
- results: [
47
- {
48
- a: {
49
- id: "1"
50
- },
51
- b: {
52
- id: "2"
53
- }
54
- },
55
- {
56
- a: {
57
- id: "3"
58
- },
59
- b: {
60
- id: "4"
61
- }
62
- }
63
- ]
64
- }
65
- ];
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- ANONYMOUS_RELATIONSHIP_FEATURES
69
- });
@@ -1,105 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var anonymous_variable_length_feature_exports = {};
19
- __export(anonymous_variable_length_feature_exports, {
20
- ANONYMOUS_VARIABLE_LENGTH_FEATURES: () => ANONYMOUS_VARIABLE_LENGTH_FEATURES
21
- });
22
- module.exports = __toCommonJS(anonymous_variable_length_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const ANONYMOUS_VARIABLE_LENGTH_FEATURES = [
25
- {
26
- name: "Match any relationship type with variable length",
27
- description: "Anonymous variable-length paths [*] match paths of any relationship type with zero or more edges.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "C")).addNode((0, import_graph2.stubNode)("3", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addEdge((0, import_graph2.stubEdge)("2", "3", "R2")).build(),
29
- queries: [["MATCH (a:A)-[*]->(b:B)", "RETURN a, b"]],
30
- results: [
31
- {
32
- a: {
33
- id: "1"
34
- },
35
- b: {
36
- id: "3"
37
- }
38
- }
39
- ]
40
- },
41
- {
42
- name: "Match pattern with anonymous variable-length at edges and specific type in middle",
43
- description: "Variable-length paths can mix anonymous types [*] with specific types in complex patterns.",
44
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addNode((0, import_graph2.stubNode)("3", "C")).addNode((0, import_graph2.stubNode)("4", "D")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addEdge((0, import_graph2.stubEdge)("2", "3", "R2")).addEdge((0, import_graph2.stubEdge)("3", "4", "R3")).build(),
45
- queries: [
46
- ["MATCH (a:A)-[*]->(b:B)-[:R2*]->(c:C)-[*]->(d:D)", "RETURN a, b, c, d"]
47
- ],
48
- results: [
49
- {
50
- a: {
51
- id: "1"
52
- },
53
- b: {
54
- id: "2"
55
- },
56
- c: {
57
- id: "3"
58
- },
59
- d: {
60
- id: "4"
61
- }
62
- }
63
- ]
64
- },
65
- {
66
- name: "Match zero-length path (same node) with anonymous variable-length",
67
- description: "Anonymous variable-length paths support zero-length paths when source and target are different nodes (no path).",
68
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).build(),
69
- queries: [["MATCH (a:A)-[*]->(b:B)", "RETURN a, b"]],
70
- results: []
71
- },
72
- {
73
- name: "Match zero-length path when source and target are same node",
74
- description: "Anonymous variable-length paths match zero-length paths when source and target variables refer to the same node.",
75
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).build(),
76
- queries: [["MATCH (a:A)-[*]->(a:A)", "RETURN a"]],
77
- results: [
78
- {
79
- a: {
80
- id: "1"
81
- }
82
- }
83
- ]
84
- },
85
- {
86
- name: "Traverse multiple hops with different relationship types",
87
- description: "Anonymous variable-length paths can traverse multiple hops with different relationship types.",
88
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "X")).addNode((0, import_graph2.stubNode)("3", "Y")).addNode((0, import_graph2.stubNode)("4", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "TYPE1")).addEdge((0, import_graph2.stubEdge)("2", "3", "TYPE2")).addEdge((0, import_graph2.stubEdge)("3", "4", "TYPE3")).build(),
89
- queries: [["MATCH (a:A)-[*]->(b:B)", "RETURN a, b"]],
90
- results: [
91
- {
92
- a: {
93
- id: "1"
94
- },
95
- b: {
96
- id: "4"
97
- }
98
- }
99
- ]
100
- }
101
- ];
102
- // Annotate the CommonJS export names for ESM import in node:
103
- 0 && (module.exports = {
104
- ANONYMOUS_VARIABLE_LENGTH_FEATURES
105
- });
@@ -1,70 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var basic_filtering_feature_exports = {};
19
- __export(basic_filtering_feature_exports, {
20
- BASIC_FILTERING_FEATURES: () => BASIC_FILTERING_FEATURES
21
- });
22
- module.exports = __toCommonJS(basic_filtering_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const BASIC_FILTERING_FEATURES = [
25
- {
26
- name: "Filter single node with property in pattern",
27
- description: "Filter nodes by property directly in the MATCH pattern. Equivalent to using WHERE clause.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1")).addNode((0, import_graph2.stubNode)("2")).addNode((0, import_graph2.stubNode)("3")).build(),
29
- queries: [
30
- ['MATCH (a:A {id: "1"})', "RETURN a"],
31
- ["MATCH (a:A)", 'WHERE a.id = "1"', "RETURN a"]
32
- ],
33
- results: [
34
- {
35
- a: {
36
- id: "1"
37
- }
38
- }
39
- ]
40
- },
41
- {
42
- name: "Filter multiple nodes with properties in pattern",
43
- description: "Filter multiple nodes by properties directly in the MATCH pattern.",
44
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addNode((0, import_graph2.stubNode)("3", "A")).addNode((0, import_graph2.stubNode)("4", "B")).build(),
45
- queries: [
46
- ['MATCH (a:A {id: "1"}), (b:B {id: "2"})', "RETURN a, b"],
47
- ['MATCH (a:A {id: "1"}), (b:B)', 'WHERE b.id = "2"', "RETURN a, b"],
48
- [
49
- "MATCH (a:A)",
50
- "MATCH (b:B)",
51
- 'WHERE a.id = "1" AND b.id = "2"',
52
- "RETURN a, b"
53
- ]
54
- ],
55
- results: [
56
- {
57
- a: {
58
- id: "1"
59
- },
60
- b: {
61
- id: "2"
62
- }
63
- }
64
- ]
65
- }
66
- ];
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- BASIC_FILTERING_FEATURES
70
- });
@@ -1,99 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var basic_optional_match_feature_exports = {};
19
- __export(basic_optional_match_feature_exports, {
20
- BASIC_OPTIONAL_MATCH_FEATURES: () => BASIC_OPTIONAL_MATCH_FEATURES
21
- });
22
- module.exports = __toCommonJS(basic_optional_match_feature_exports);
23
- var import_graph2 = require("../../graph.stub");
24
- const BASIC_OPTIONAL_MATCH_FEATURES = [
25
- {
26
- name: "Left outer join - all required nodes preserved",
27
- description: "OPTIONAL MATCH performs a left outer join. All required MATCH results are preserved, even if optional matches fail.",
28
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).addNode((0, import_graph2.stubNode)("3", "B")).addEdge((0, import_graph2.stubEdge)("1", "3", "R1")).build(),
29
- queries: [
30
- ["MATCH (a:A)", "OPTIONAL MATCH (a)-[:R1]->(b:B)", "RETURN a, b"]
31
- ],
32
- results: [
33
- {
34
- a: {
35
- id: "1"
36
- },
37
- b: {
38
- id: "3"
39
- }
40
- },
41
- {
42
- a: {
43
- id: "2"
44
- },
45
- b: null
46
- }
47
- ]
48
- },
49
- {
50
- name: "Optional variable set to null when no match exists",
51
- description: "When an optional match fails, the optional variable is set to null in the result.",
52
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "B")).addEdge((0, import_graph2.stubEdge)("1", "2", "R1")).addNode((0, import_graph2.stubNode)("3", "A")).build(),
53
- queries: [
54
- ["MATCH (a:A)", "OPTIONAL MATCH (a)-[:R1]->(b:B)", "RETURN a, b"]
55
- ],
56
- results: [
57
- {
58
- a: {
59
- id: "1"
60
- },
61
- b: {
62
- id: "2"
63
- }
64
- },
65
- {
66
- a: {
67
- id: "3"
68
- },
69
- b: null
70
- }
71
- ]
72
- },
73
- {
74
- name: "Set optional variable to null when no match exists",
75
- description: "When all optional matches fail (no connections exist), all optional variables are set to null for all required matches.",
76
- graphFactory: () => new import_graph2.GraphBuilder().addNode((0, import_graph2.stubNode)("1", "A")).addNode((0, import_graph2.stubNode)("2", "A")).build(),
77
- queries: [
78
- ["MATCH (a:A)", "OPTIONAL MATCH (a)-[:R1]->(b:B)", "RETURN a, b"]
79
- ],
80
- results: [
81
- {
82
- a: {
83
- id: "1"
84
- },
85
- b: null
86
- },
87
- {
88
- a: {
89
- id: "2"
90
- },
91
- b: null
92
- }
93
- ]
94
- }
95
- ];
96
- // Annotate the CommonJS export names for ESM import in node:
97
- 0 && (module.exports = {
98
- BASIC_OPTIONAL_MATCH_FEATURES
99
- });