flowquery 1.0.46 → 1.0.48

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 (422) hide show
  1. package/dist/flowquery.min.js +1 -1
  2. package/dist/index.d.ts +0 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +6 -4
  5. package/dist/index.js.map +1 -1
  6. package/dist/parsing/data_structures/list_comprehension.d.ts +56 -0
  7. package/dist/parsing/data_structures/list_comprehension.d.ts.map +1 -0
  8. package/dist/parsing/data_structures/list_comprehension.js +102 -0
  9. package/dist/parsing/data_structures/list_comprehension.js.map +1 -0
  10. package/dist/parsing/parser.d.ts +18 -0
  11. package/dist/parsing/parser.d.ts.map +1 -1
  12. package/dist/parsing/parser.js +92 -0
  13. package/dist/parsing/parser.js.map +1 -1
  14. package/package.json +4 -1
  15. package/.editorconfig +0 -21
  16. package/.gitattributes +0 -3
  17. package/.github/workflows/npm-publish.yml +0 -32
  18. package/.github/workflows/python-publish.yml +0 -143
  19. package/.github/workflows/release.yml +0 -107
  20. package/.husky/pre-commit +0 -28
  21. package/.prettierrc +0 -22
  22. package/CODE_OF_CONDUCT.md +0 -10
  23. package/FlowQueryLogoIcon.png +0 -0
  24. package/SECURITY.md +0 -14
  25. package/SUPPORT.md +0 -13
  26. package/docs/flowquery.min.js +0 -1
  27. package/docs/index.html +0 -105
  28. package/flowquery-py/CONTRIBUTING.md +0 -127
  29. package/flowquery-py/README.md +0 -67
  30. package/flowquery-py/misc/data/test.json +0 -10
  31. package/flowquery-py/misc/data/users.json +0 -242
  32. package/flowquery-py/notebooks/TestFlowQuery.ipynb +0 -440
  33. package/flowquery-py/pyproject.toml +0 -121
  34. package/flowquery-py/setup_env.ps1 +0 -92
  35. package/flowquery-py/setup_env.sh +0 -87
  36. package/flowquery-py/src/__init__.py +0 -38
  37. package/flowquery-py/src/__main__.py +0 -10
  38. package/flowquery-py/src/compute/__init__.py +0 -6
  39. package/flowquery-py/src/compute/flowquery.py +0 -68
  40. package/flowquery-py/src/compute/runner.py +0 -64
  41. package/flowquery-py/src/extensibility.py +0 -52
  42. package/flowquery-py/src/graph/__init__.py +0 -31
  43. package/flowquery-py/src/graph/data.py +0 -136
  44. package/flowquery-py/src/graph/database.py +0 -141
  45. package/flowquery-py/src/graph/hops.py +0 -43
  46. package/flowquery-py/src/graph/node.py +0 -143
  47. package/flowquery-py/src/graph/node_data.py +0 -26
  48. package/flowquery-py/src/graph/node_reference.py +0 -50
  49. package/flowquery-py/src/graph/pattern.py +0 -115
  50. package/flowquery-py/src/graph/pattern_expression.py +0 -67
  51. package/flowquery-py/src/graph/patterns.py +0 -42
  52. package/flowquery-py/src/graph/physical_node.py +0 -41
  53. package/flowquery-py/src/graph/physical_relationship.py +0 -36
  54. package/flowquery-py/src/graph/relationship.py +0 -193
  55. package/flowquery-py/src/graph/relationship_data.py +0 -36
  56. package/flowquery-py/src/graph/relationship_match_collector.py +0 -85
  57. package/flowquery-py/src/graph/relationship_reference.py +0 -21
  58. package/flowquery-py/src/io/__init__.py +0 -5
  59. package/flowquery-py/src/io/command_line.py +0 -108
  60. package/flowquery-py/src/parsing/__init__.py +0 -17
  61. package/flowquery-py/src/parsing/alias.py +0 -20
  62. package/flowquery-py/src/parsing/alias_option.py +0 -11
  63. package/flowquery-py/src/parsing/ast_node.py +0 -147
  64. package/flowquery-py/src/parsing/base_parser.py +0 -84
  65. package/flowquery-py/src/parsing/components/__init__.py +0 -19
  66. package/flowquery-py/src/parsing/components/csv.py +0 -8
  67. package/flowquery-py/src/parsing/components/from_.py +0 -12
  68. package/flowquery-py/src/parsing/components/headers.py +0 -12
  69. package/flowquery-py/src/parsing/components/json.py +0 -8
  70. package/flowquery-py/src/parsing/components/null.py +0 -10
  71. package/flowquery-py/src/parsing/components/post.py +0 -8
  72. package/flowquery-py/src/parsing/components/text.py +0 -8
  73. package/flowquery-py/src/parsing/context.py +0 -50
  74. package/flowquery-py/src/parsing/data_structures/__init__.py +0 -15
  75. package/flowquery-py/src/parsing/data_structures/associative_array.py +0 -41
  76. package/flowquery-py/src/parsing/data_structures/json_array.py +0 -30
  77. package/flowquery-py/src/parsing/data_structures/key_value_pair.py +0 -38
  78. package/flowquery-py/src/parsing/data_structures/lookup.py +0 -51
  79. package/flowquery-py/src/parsing/data_structures/range_lookup.py +0 -42
  80. package/flowquery-py/src/parsing/expressions/__init__.py +0 -61
  81. package/flowquery-py/src/parsing/expressions/boolean.py +0 -20
  82. package/flowquery-py/src/parsing/expressions/expression.py +0 -141
  83. package/flowquery-py/src/parsing/expressions/expression_map.py +0 -26
  84. package/flowquery-py/src/parsing/expressions/f_string.py +0 -27
  85. package/flowquery-py/src/parsing/expressions/identifier.py +0 -21
  86. package/flowquery-py/src/parsing/expressions/number.py +0 -32
  87. package/flowquery-py/src/parsing/expressions/operator.py +0 -271
  88. package/flowquery-py/src/parsing/expressions/reference.py +0 -47
  89. package/flowquery-py/src/parsing/expressions/string.py +0 -27
  90. package/flowquery-py/src/parsing/functions/__init__.py +0 -127
  91. package/flowquery-py/src/parsing/functions/aggregate_function.py +0 -60
  92. package/flowquery-py/src/parsing/functions/async_function.py +0 -65
  93. package/flowquery-py/src/parsing/functions/avg.py +0 -55
  94. package/flowquery-py/src/parsing/functions/coalesce.py +0 -43
  95. package/flowquery-py/src/parsing/functions/collect.py +0 -75
  96. package/flowquery-py/src/parsing/functions/count.py +0 -79
  97. package/flowquery-py/src/parsing/functions/date_.py +0 -61
  98. package/flowquery-py/src/parsing/functions/datetime_.py +0 -62
  99. package/flowquery-py/src/parsing/functions/duration.py +0 -159
  100. package/flowquery-py/src/parsing/functions/element_id.py +0 -50
  101. package/flowquery-py/src/parsing/functions/function.py +0 -68
  102. package/flowquery-py/src/parsing/functions/function_factory.py +0 -170
  103. package/flowquery-py/src/parsing/functions/function_metadata.py +0 -148
  104. package/flowquery-py/src/parsing/functions/functions.py +0 -67
  105. package/flowquery-py/src/parsing/functions/head.py +0 -39
  106. package/flowquery-py/src/parsing/functions/id_.py +0 -49
  107. package/flowquery-py/src/parsing/functions/join.py +0 -49
  108. package/flowquery-py/src/parsing/functions/keys.py +0 -34
  109. package/flowquery-py/src/parsing/functions/last.py +0 -39
  110. package/flowquery-py/src/parsing/functions/localdatetime.py +0 -60
  111. package/flowquery-py/src/parsing/functions/localtime.py +0 -57
  112. package/flowquery-py/src/parsing/functions/max_.py +0 -49
  113. package/flowquery-py/src/parsing/functions/min_.py +0 -49
  114. package/flowquery-py/src/parsing/functions/nodes.py +0 -48
  115. package/flowquery-py/src/parsing/functions/predicate_function.py +0 -47
  116. package/flowquery-py/src/parsing/functions/predicate_sum.py +0 -49
  117. package/flowquery-py/src/parsing/functions/properties.py +0 -50
  118. package/flowquery-py/src/parsing/functions/rand.py +0 -28
  119. package/flowquery-py/src/parsing/functions/range_.py +0 -41
  120. package/flowquery-py/src/parsing/functions/reducer_element.py +0 -15
  121. package/flowquery-py/src/parsing/functions/relationships.py +0 -46
  122. package/flowquery-py/src/parsing/functions/replace.py +0 -39
  123. package/flowquery-py/src/parsing/functions/round_.py +0 -34
  124. package/flowquery-py/src/parsing/functions/schema.py +0 -40
  125. package/flowquery-py/src/parsing/functions/size.py +0 -34
  126. package/flowquery-py/src/parsing/functions/split.py +0 -54
  127. package/flowquery-py/src/parsing/functions/string_distance.py +0 -92
  128. package/flowquery-py/src/parsing/functions/stringify.py +0 -49
  129. package/flowquery-py/src/parsing/functions/substring.py +0 -76
  130. package/flowquery-py/src/parsing/functions/sum.py +0 -51
  131. package/flowquery-py/src/parsing/functions/tail.py +0 -37
  132. package/flowquery-py/src/parsing/functions/temporal_utils.py +0 -186
  133. package/flowquery-py/src/parsing/functions/time_.py +0 -57
  134. package/flowquery-py/src/parsing/functions/timestamp.py +0 -37
  135. package/flowquery-py/src/parsing/functions/to_float.py +0 -46
  136. package/flowquery-py/src/parsing/functions/to_integer.py +0 -46
  137. package/flowquery-py/src/parsing/functions/to_json.py +0 -35
  138. package/flowquery-py/src/parsing/functions/to_lower.py +0 -37
  139. package/flowquery-py/src/parsing/functions/to_string.py +0 -41
  140. package/flowquery-py/src/parsing/functions/trim.py +0 -37
  141. package/flowquery-py/src/parsing/functions/type_.py +0 -47
  142. package/flowquery-py/src/parsing/functions/value_holder.py +0 -24
  143. package/flowquery-py/src/parsing/logic/__init__.py +0 -15
  144. package/flowquery-py/src/parsing/logic/case.py +0 -28
  145. package/flowquery-py/src/parsing/logic/else_.py +0 -12
  146. package/flowquery-py/src/parsing/logic/end.py +0 -8
  147. package/flowquery-py/src/parsing/logic/then.py +0 -12
  148. package/flowquery-py/src/parsing/logic/when.py +0 -12
  149. package/flowquery-py/src/parsing/operations/__init__.py +0 -46
  150. package/flowquery-py/src/parsing/operations/aggregated_return.py +0 -25
  151. package/flowquery-py/src/parsing/operations/aggregated_with.py +0 -22
  152. package/flowquery-py/src/parsing/operations/call.py +0 -73
  153. package/flowquery-py/src/parsing/operations/create_node.py +0 -35
  154. package/flowquery-py/src/parsing/operations/create_relationship.py +0 -35
  155. package/flowquery-py/src/parsing/operations/delete_node.py +0 -29
  156. package/flowquery-py/src/parsing/operations/delete_relationship.py +0 -29
  157. package/flowquery-py/src/parsing/operations/group_by.py +0 -148
  158. package/flowquery-py/src/parsing/operations/limit.py +0 -33
  159. package/flowquery-py/src/parsing/operations/load.py +0 -148
  160. package/flowquery-py/src/parsing/operations/match.py +0 -52
  161. package/flowquery-py/src/parsing/operations/operation.py +0 -69
  162. package/flowquery-py/src/parsing/operations/order_by.py +0 -114
  163. package/flowquery-py/src/parsing/operations/projection.py +0 -21
  164. package/flowquery-py/src/parsing/operations/return_op.py +0 -88
  165. package/flowquery-py/src/parsing/operations/union.py +0 -115
  166. package/flowquery-py/src/parsing/operations/union_all.py +0 -17
  167. package/flowquery-py/src/parsing/operations/unwind.py +0 -42
  168. package/flowquery-py/src/parsing/operations/where.py +0 -43
  169. package/flowquery-py/src/parsing/operations/with_op.py +0 -18
  170. package/flowquery-py/src/parsing/parser.py +0 -1384
  171. package/flowquery-py/src/parsing/parser_state.py +0 -26
  172. package/flowquery-py/src/parsing/token_to_node.py +0 -109
  173. package/flowquery-py/src/tokenization/__init__.py +0 -23
  174. package/flowquery-py/src/tokenization/keyword.py +0 -54
  175. package/flowquery-py/src/tokenization/operator.py +0 -29
  176. package/flowquery-py/src/tokenization/string_walker.py +0 -158
  177. package/flowquery-py/src/tokenization/symbol.py +0 -19
  178. package/flowquery-py/src/tokenization/token.py +0 -693
  179. package/flowquery-py/src/tokenization/token_mapper.py +0 -53
  180. package/flowquery-py/src/tokenization/token_type.py +0 -21
  181. package/flowquery-py/src/tokenization/tokenizer.py +0 -214
  182. package/flowquery-py/src/tokenization/trie.py +0 -125
  183. package/flowquery-py/src/utils/__init__.py +0 -6
  184. package/flowquery-py/src/utils/object_utils.py +0 -20
  185. package/flowquery-py/src/utils/string_utils.py +0 -113
  186. package/flowquery-py/tests/__init__.py +0 -1
  187. package/flowquery-py/tests/compute/__init__.py +0 -1
  188. package/flowquery-py/tests/compute/test_runner.py +0 -4902
  189. package/flowquery-py/tests/graph/__init__.py +0 -1
  190. package/flowquery-py/tests/graph/test_create.py +0 -56
  191. package/flowquery-py/tests/graph/test_data.py +0 -73
  192. package/flowquery-py/tests/graph/test_match.py +0 -40
  193. package/flowquery-py/tests/parsing/__init__.py +0 -1
  194. package/flowquery-py/tests/parsing/test_context.py +0 -34
  195. package/flowquery-py/tests/parsing/test_expression.py +0 -248
  196. package/flowquery-py/tests/parsing/test_parser.py +0 -1237
  197. package/flowquery-py/tests/test_extensibility.py +0 -611
  198. package/flowquery-py/tests/tokenization/__init__.py +0 -1
  199. package/flowquery-py/tests/tokenization/test_token_mapper.py +0 -60
  200. package/flowquery-py/tests/tokenization/test_tokenizer.py +0 -198
  201. package/flowquery-py/tests/tokenization/test_trie.py +0 -30
  202. package/flowquery-vscode/.vscode-test.mjs +0 -5
  203. package/flowquery-vscode/.vscodeignore +0 -13
  204. package/flowquery-vscode/LICENSE +0 -21
  205. package/flowquery-vscode/README.md +0 -11
  206. package/flowquery-vscode/demo/FlowQueryVSCodeDemo.gif +0 -0
  207. package/flowquery-vscode/eslint.config.mjs +0 -25
  208. package/flowquery-vscode/extension.js +0 -508
  209. package/flowquery-vscode/flowQueryEngine/flowquery.min.js +0 -1
  210. package/flowquery-vscode/flowquery-worker.js +0 -66
  211. package/flowquery-vscode/images/FlowQueryLogoIcon.png +0 -0
  212. package/flowquery-vscode/jsconfig.json +0 -13
  213. package/flowquery-vscode/libs/page.css +0 -53
  214. package/flowquery-vscode/libs/table.css +0 -13
  215. package/flowquery-vscode/libs/tabs.css +0 -66
  216. package/flowquery-vscode/package-lock.json +0 -2917
  217. package/flowquery-vscode/package.json +0 -51
  218. package/flowquery-vscode/test/extension.test.js +0 -196
  219. package/flowquery-vscode/test/worker.test.js +0 -25
  220. package/flowquery-vscode/vsc-extension-quickstart.md +0 -42
  221. package/jest.config.js +0 -14
  222. package/misc/apps/RAG/README.md +0 -29
  223. package/misc/apps/RAG/data/chats.json +0 -302
  224. package/misc/apps/RAG/data/emails.json +0 -182
  225. package/misc/apps/RAG/data/events.json +0 -226
  226. package/misc/apps/RAG/data/files.json +0 -172
  227. package/misc/apps/RAG/data/users.json +0 -158
  228. package/misc/apps/RAG/jest.config.js +0 -21
  229. package/misc/apps/RAG/package.json +0 -48
  230. package/misc/apps/RAG/public/index.html +0 -18
  231. package/misc/apps/RAG/src/App.css +0 -42
  232. package/misc/apps/RAG/src/App.tsx +0 -50
  233. package/misc/apps/RAG/src/components/AdaptiveCardRenderer.css +0 -172
  234. package/misc/apps/RAG/src/components/AdaptiveCardRenderer.tsx +0 -380
  235. package/misc/apps/RAG/src/components/ApiKeySettings.tsx +0 -245
  236. package/misc/apps/RAG/src/components/ChatContainer.css +0 -67
  237. package/misc/apps/RAG/src/components/ChatContainer.tsx +0 -242
  238. package/misc/apps/RAG/src/components/ChatInput.css +0 -23
  239. package/misc/apps/RAG/src/components/ChatInput.tsx +0 -76
  240. package/misc/apps/RAG/src/components/ChatMessage.css +0 -160
  241. package/misc/apps/RAG/src/components/ChatMessage.tsx +0 -286
  242. package/misc/apps/RAG/src/components/FlowQueryAgent.ts +0 -708
  243. package/misc/apps/RAG/src/components/FlowQueryRunner.css +0 -113
  244. package/misc/apps/RAG/src/components/FlowQueryRunner.tsx +0 -371
  245. package/misc/apps/RAG/src/components/index.ts +0 -28
  246. package/misc/apps/RAG/src/graph/index.ts +0 -19
  247. package/misc/apps/RAG/src/graph/initializeGraph.ts +0 -254
  248. package/misc/apps/RAG/src/index.tsx +0 -29
  249. package/misc/apps/RAG/src/prompts/FlowQuerySystemPrompt.ts +0 -327
  250. package/misc/apps/RAG/src/prompts/index.ts +0 -10
  251. package/misc/apps/RAG/src/tests/graph.test.ts +0 -35
  252. package/misc/apps/RAG/src/utils/FlowQueryExecutor.ts +0 -130
  253. package/misc/apps/RAG/src/utils/FlowQueryExtractor.ts +0 -208
  254. package/misc/apps/RAG/src/utils/Llm.ts +0 -248
  255. package/misc/apps/RAG/src/utils/index.ts +0 -12
  256. package/misc/apps/RAG/tsconfig.json +0 -22
  257. package/misc/apps/RAG/webpack.config.js +0 -43
  258. package/misc/apps/README.md +0 -1
  259. package/misc/queries/analyze_catfacts.cql +0 -75
  260. package/misc/queries/azure_openai_completions.cql +0 -13
  261. package/misc/queries/azure_openai_models.cql +0 -9
  262. package/misc/queries/mock_pipeline.cql +0 -84
  263. package/misc/queries/openai_completions.cql +0 -15
  264. package/misc/queries/openai_models.cql +0 -13
  265. package/misc/queries/test.cql +0 -6
  266. package/misc/queries/tool_inference.cql +0 -24
  267. package/misc/queries/wisdom.cql +0 -6
  268. package/misc/queries/wisdom_letter_histogram.cql +0 -8
  269. package/src/compute/flowquery.ts +0 -46
  270. package/src/compute/runner.ts +0 -66
  271. package/src/extensibility.ts +0 -45
  272. package/src/graph/data.ts +0 -130
  273. package/src/graph/database.ts +0 -143
  274. package/src/graph/hops.ts +0 -22
  275. package/src/graph/node.ts +0 -122
  276. package/src/graph/node_data.ts +0 -18
  277. package/src/graph/node_reference.ts +0 -38
  278. package/src/graph/pattern.ts +0 -110
  279. package/src/graph/pattern_expression.ts +0 -48
  280. package/src/graph/patterns.ts +0 -36
  281. package/src/graph/physical_node.ts +0 -23
  282. package/src/graph/physical_relationship.ts +0 -23
  283. package/src/graph/relationship.ts +0 -167
  284. package/src/graph/relationship_data.ts +0 -31
  285. package/src/graph/relationship_match_collector.ts +0 -64
  286. package/src/graph/relationship_reference.ts +0 -25
  287. package/src/index.browser.ts +0 -46
  288. package/src/index.node.ts +0 -55
  289. package/src/index.ts +0 -12
  290. package/src/io/command_line.ts +0 -74
  291. package/src/parsing/alias.ts +0 -23
  292. package/src/parsing/alias_option.ts +0 -5
  293. package/src/parsing/ast_node.ts +0 -153
  294. package/src/parsing/base_parser.ts +0 -98
  295. package/src/parsing/components/csv.ts +0 -9
  296. package/src/parsing/components/from.ts +0 -12
  297. package/src/parsing/components/headers.ts +0 -12
  298. package/src/parsing/components/json.ts +0 -9
  299. package/src/parsing/components/null.ts +0 -9
  300. package/src/parsing/components/post.ts +0 -9
  301. package/src/parsing/components/text.ts +0 -9
  302. package/src/parsing/context.ts +0 -54
  303. package/src/parsing/data_structures/associative_array.ts +0 -43
  304. package/src/parsing/data_structures/json_array.ts +0 -31
  305. package/src/parsing/data_structures/key_value_pair.ts +0 -37
  306. package/src/parsing/data_structures/lookup.ts +0 -44
  307. package/src/parsing/data_structures/range_lookup.ts +0 -36
  308. package/src/parsing/expressions/boolean.ts +0 -21
  309. package/src/parsing/expressions/expression.ts +0 -150
  310. package/src/parsing/expressions/expression_map.ts +0 -22
  311. package/src/parsing/expressions/f_string.ts +0 -26
  312. package/src/parsing/expressions/identifier.ts +0 -22
  313. package/src/parsing/expressions/number.ts +0 -40
  314. package/src/parsing/expressions/operator.ts +0 -354
  315. package/src/parsing/expressions/reference.ts +0 -45
  316. package/src/parsing/expressions/string.ts +0 -34
  317. package/src/parsing/functions/aggregate_function.ts +0 -58
  318. package/src/parsing/functions/async_function.ts +0 -64
  319. package/src/parsing/functions/avg.ts +0 -47
  320. package/src/parsing/functions/coalesce.ts +0 -49
  321. package/src/parsing/functions/collect.ts +0 -54
  322. package/src/parsing/functions/count.ts +0 -54
  323. package/src/parsing/functions/date.ts +0 -63
  324. package/src/parsing/functions/datetime.ts +0 -63
  325. package/src/parsing/functions/duration.ts +0 -143
  326. package/src/parsing/functions/element_id.ts +0 -51
  327. package/src/parsing/functions/function.ts +0 -60
  328. package/src/parsing/functions/function_factory.ts +0 -195
  329. package/src/parsing/functions/function_metadata.ts +0 -217
  330. package/src/parsing/functions/functions.ts +0 -70
  331. package/src/parsing/functions/head.ts +0 -42
  332. package/src/parsing/functions/id.ts +0 -51
  333. package/src/parsing/functions/join.ts +0 -40
  334. package/src/parsing/functions/keys.ts +0 -29
  335. package/src/parsing/functions/last.ts +0 -42
  336. package/src/parsing/functions/localdatetime.ts +0 -63
  337. package/src/parsing/functions/localtime.ts +0 -58
  338. package/src/parsing/functions/max.ts +0 -37
  339. package/src/parsing/functions/min.ts +0 -37
  340. package/src/parsing/functions/nodes.ts +0 -54
  341. package/src/parsing/functions/predicate_function.ts +0 -48
  342. package/src/parsing/functions/predicate_sum.ts +0 -47
  343. package/src/parsing/functions/properties.ts +0 -56
  344. package/src/parsing/functions/rand.ts +0 -21
  345. package/src/parsing/functions/range.ts +0 -37
  346. package/src/parsing/functions/reducer_element.ts +0 -10
  347. package/src/parsing/functions/relationships.ts +0 -52
  348. package/src/parsing/functions/replace.ts +0 -38
  349. package/src/parsing/functions/round.ts +0 -28
  350. package/src/parsing/functions/schema.ts +0 -39
  351. package/src/parsing/functions/size.ts +0 -28
  352. package/src/parsing/functions/split.ts +0 -45
  353. package/src/parsing/functions/string_distance.ts +0 -83
  354. package/src/parsing/functions/stringify.ts +0 -37
  355. package/src/parsing/functions/substring.ts +0 -68
  356. package/src/parsing/functions/sum.ts +0 -41
  357. package/src/parsing/functions/tail.ts +0 -39
  358. package/src/parsing/functions/temporal_utils.ts +0 -180
  359. package/src/parsing/functions/time.ts +0 -58
  360. package/src/parsing/functions/timestamp.ts +0 -37
  361. package/src/parsing/functions/to_float.ts +0 -50
  362. package/src/parsing/functions/to_integer.ts +0 -50
  363. package/src/parsing/functions/to_json.ts +0 -28
  364. package/src/parsing/functions/to_lower.ts +0 -28
  365. package/src/parsing/functions/to_string.ts +0 -32
  366. package/src/parsing/functions/trim.ts +0 -28
  367. package/src/parsing/functions/type.ts +0 -39
  368. package/src/parsing/functions/value_holder.ts +0 -13
  369. package/src/parsing/logic/case.ts +0 -26
  370. package/src/parsing/logic/else.ts +0 -12
  371. package/src/parsing/logic/end.ts +0 -9
  372. package/src/parsing/logic/then.ts +0 -12
  373. package/src/parsing/logic/when.ts +0 -12
  374. package/src/parsing/operations/aggregated_return.ts +0 -22
  375. package/src/parsing/operations/aggregated_with.ts +0 -18
  376. package/src/parsing/operations/call.ts +0 -69
  377. package/src/parsing/operations/create_node.ts +0 -39
  378. package/src/parsing/operations/create_relationship.ts +0 -38
  379. package/src/parsing/operations/delete_node.ts +0 -33
  380. package/src/parsing/operations/delete_relationship.ts +0 -32
  381. package/src/parsing/operations/group_by.ts +0 -137
  382. package/src/parsing/operations/limit.ts +0 -31
  383. package/src/parsing/operations/load.ts +0 -146
  384. package/src/parsing/operations/match.ts +0 -54
  385. package/src/parsing/operations/operation.ts +0 -69
  386. package/src/parsing/operations/order_by.ts +0 -126
  387. package/src/parsing/operations/projection.ts +0 -18
  388. package/src/parsing/operations/return.ts +0 -76
  389. package/src/parsing/operations/union.ts +0 -114
  390. package/src/parsing/operations/union_all.ts +0 -16
  391. package/src/parsing/operations/unwind.ts +0 -36
  392. package/src/parsing/operations/where.ts +0 -42
  393. package/src/parsing/operations/with.ts +0 -20
  394. package/src/parsing/parser.ts +0 -1641
  395. package/src/parsing/parser_state.ts +0 -25
  396. package/src/parsing/token_to_node.ts +0 -114
  397. package/src/tokenization/keyword.ts +0 -50
  398. package/src/tokenization/operator.ts +0 -25
  399. package/src/tokenization/string_walker.ts +0 -197
  400. package/src/tokenization/symbol.ts +0 -15
  401. package/src/tokenization/token.ts +0 -764
  402. package/src/tokenization/token_mapper.ts +0 -53
  403. package/src/tokenization/token_type.ts +0 -16
  404. package/src/tokenization/tokenizer.ts +0 -250
  405. package/src/tokenization/trie.ts +0 -117
  406. package/src/utils/object_utils.ts +0 -17
  407. package/src/utils/string_utils.ts +0 -114
  408. package/tests/compute/runner.test.ts +0 -4559
  409. package/tests/extensibility.test.ts +0 -643
  410. package/tests/graph/create.test.ts +0 -36
  411. package/tests/graph/data.test.ts +0 -58
  412. package/tests/graph/match.test.ts +0 -29
  413. package/tests/parsing/context.test.ts +0 -27
  414. package/tests/parsing/expression.test.ts +0 -303
  415. package/tests/parsing/parser.test.ts +0 -1327
  416. package/tests/tokenization/token_mapper.test.ts +0 -47
  417. package/tests/tokenization/tokenizer.test.ts +0 -191
  418. package/tests/tokenization/trie.test.ts +0 -20
  419. package/tsconfig.json +0 -19
  420. package/typedoc.json +0 -16
  421. package/vscode-settings.json.recommended +0 -16
  422. package/webpack.config.js +0 -26
@@ -1,193 +0,0 @@
1
- """Graph relationship representation for FlowQuery."""
2
-
3
- from __future__ import annotations
4
-
5
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
6
-
7
- from ..parsing.ast_node import ASTNode
8
- from .hops import Hops
9
- from .relationship_data import RelationshipData
10
- from .relationship_match_collector import RelationshipMatchCollector, RelationshipMatchRecord
11
-
12
- if TYPE_CHECKING:
13
- from .node import Node
14
-
15
-
16
- class Relationship(ASTNode):
17
- """Represents a relationship in a graph pattern."""
18
-
19
- def __init__(self) -> None:
20
- super().__init__()
21
- self._identifier: Optional[str] = None
22
- self._types: List[str] = []
23
- self._hops: Hops = Hops()
24
- self._source: Optional['Node'] = None
25
- self._target: Optional['Node'] = None
26
- self._direction: str = "right"
27
- self._data: Optional['RelationshipData'] = None
28
- self._value: Optional[Union[RelationshipMatchRecord, List[RelationshipMatchRecord]]] = None
29
- self._matches: RelationshipMatchCollector = RelationshipMatchCollector()
30
- self._properties: Dict[str, Any] = {}
31
-
32
- @property
33
- def identifier(self) -> Optional[str]:
34
- return self._identifier
35
-
36
- @identifier.setter
37
- def identifier(self, value: str) -> None:
38
- self._identifier = value
39
-
40
- @property
41
- def type(self) -> Optional[str]:
42
- return self._types[0] if self._types else None
43
-
44
- @type.setter
45
- def type(self, value: str) -> None:
46
- self._types = [value]
47
-
48
- @property
49
- def types(self) -> List[str]:
50
- return self._types
51
-
52
- @types.setter
53
- def types(self, value: List[str]) -> None:
54
- self._types = value
55
-
56
- @property
57
- def hops(self) -> Hops:
58
- return self._hops
59
-
60
- @hops.setter
61
- def hops(self, value: Hops) -> None:
62
- self._hops = value
63
-
64
- @property
65
- def properties(self) -> Dict[str, Any]:
66
- return self._properties
67
-
68
- @properties.setter
69
- def properties(self, value: Dict[str, Any]) -> None:
70
- self._properties = value
71
-
72
- def _matches_properties(self, hop: int = 0) -> bool:
73
- """Check if current record matches all constraint properties."""
74
- if not self._properties:
75
- return True
76
- if self._data is None:
77
- return True
78
- for key, expression in self._properties.items():
79
- record = self._data.current(hop)
80
- if record is None:
81
- raise ValueError("No current relationship data available")
82
- if key not in record:
83
- raise ValueError("Relationship does not have property")
84
- return bool(record[key] == expression.value())
85
- return True
86
-
87
- @property
88
- def source(self) -> Optional['Node']:
89
- return self._source
90
-
91
- @source.setter
92
- def source(self, value: 'Node') -> None:
93
- self._source = value
94
-
95
- @property
96
- def target(self) -> Optional['Node']:
97
- return self._target
98
-
99
- @target.setter
100
- def target(self, value: 'Node') -> None:
101
- self._target = value
102
-
103
- @property
104
- def direction(self) -> str:
105
- return self._direction
106
-
107
- @direction.setter
108
- def direction(self, value: str) -> None:
109
- self._direction = value
110
-
111
- # Keep start/end aliases for backward compatibility
112
- @property
113
- def start(self) -> Optional['Node']:
114
- return self._source
115
-
116
- @start.setter
117
- def start(self, value: 'Node') -> None:
118
- self._source = value
119
-
120
- @property
121
- def end(self) -> Optional['Node']:
122
- return self._target
123
-
124
- @end.setter
125
- def end(self, value: 'Node') -> None:
126
- self._target = value
127
-
128
- def set_data(self, data: Optional['RelationshipData']) -> None:
129
- self._data = data
130
-
131
- def get_data(self) -> Optional['RelationshipData']:
132
- return self._data
133
-
134
- def set_value(self, relationship: 'Relationship', traversal_id: str = "") -> None:
135
- """Set value by pushing match to collector."""
136
- self._matches.push(relationship, traversal_id)
137
- self._value = self._matches.value()
138
-
139
- def value(self) -> Optional[Union[RelationshipMatchRecord, List[RelationshipMatchRecord]]]:
140
- return self._value
141
-
142
- @property
143
- def matches(self) -> List[RelationshipMatchRecord]:
144
- return self._matches.matches
145
-
146
- def set_end_node(self, node: 'Node') -> None:
147
- """Set the end node for the current match."""
148
- self._matches.end_node = node
149
-
150
- def _left_id_or_right_id(self) -> str:
151
- return "left_id" if self._direction == "left" else "right_id"
152
-
153
- async def find(self, left_id: str, hop: int = 0) -> None:
154
- """Find relationships starting from the given node ID."""
155
- # Save original source node
156
- original = self._source
157
- if hop > 0:
158
- # For hops greater than 0, the source becomes the target of the previous hop
159
- self._source = self._target
160
- if hop == 0:
161
- if self._data:
162
- self._data.reset()
163
-
164
- # Handle zero-hop case: when min is 0 on a variable-length relationship,
165
- # match source node as target (no traversal)
166
- if self._hops and self._hops.multi() and self._hops.min == 0 and self._target:
167
- # For zero-hop, target finds the same node as source (left_id)
168
- # No relationship match is pushed since no edge is traversed
169
- await self._target.find(left_id, hop)
170
-
171
- while self._data and self._data.find(left_id, hop, self._direction):
172
- data = self._data.current(hop)
173
- if data is None:
174
- continue
175
- id = data[self._left_id_or_right_id()]
176
- if hop + 1 >= self._hops.min:
177
- self.set_value(self, left_id)
178
- if not self._matches_properties(hop):
179
- continue
180
- if self._target:
181
- await self._target.find(id, hop)
182
- if hop + 1 < self._hops.max:
183
- if self._matches.is_circular(id):
184
- self._matches.pop()
185
- continue
186
- await self.find(id, hop + 1)
187
- self._matches.pop()
188
- else:
189
- # Below minimum hops: traverse the edge without yielding a match
190
- await self.find(id, hop + 1)
191
-
192
- # Restore original source node
193
- self._source = original
@@ -1,36 +0,0 @@
1
- """Relationship data class for FlowQuery."""
2
-
3
- from typing import Any, Dict, List, Optional, TypedDict
4
-
5
- from .data import Data
6
-
7
-
8
- class RelationshipRecord(TypedDict, total=False):
9
- """Represents a relationship record from the database."""
10
- left_id: str
11
- right_id: str
12
-
13
-
14
- class RelationshipData(Data):
15
- """Relationship data class extending Data with left_id and right_id indexing."""
16
-
17
- def __init__(self, records: Optional[List[Dict[str, Any]]] = None):
18
- super().__init__(records)
19
- self._build_index("left_id")
20
- self._build_index("right_id")
21
-
22
- def find(self, id: str, hop: int = 0, direction: str = "right") -> bool:
23
- """Find a relationship by node ID and direction."""
24
- key = "right_id" if direction == "left" else "left_id"
25
- return self._find(id, hop, key)
26
-
27
- def properties(self) -> Optional[Dict[str, Any]]:
28
- """Get properties of current relationship, excluding left_id, right_id, and _type."""
29
- current = self.current()
30
- if current:
31
- props = dict(current)
32
- props.pop("left_id", None)
33
- props.pop("right_id", None)
34
- props.pop("_type", None)
35
- return props
36
- return None
@@ -1,85 +0,0 @@
1
- """Collector for relationship match records."""
2
-
3
- from __future__ import annotations
4
-
5
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
6
-
7
- if TYPE_CHECKING:
8
- from .node import Node
9
- from .relationship import Relationship
10
-
11
- # A relationship match record is a plain dict with known keys (type,
12
- # startNode, endNode, properties) plus any extra relationship-property
13
- # keys spread at the top level – mirroring the TypeScript version that
14
- # uses an index signature ``[key: string]: any``.
15
- RelationshipMatchRecord = Dict[str, Any]
16
-
17
-
18
- class RelationshipMatchCollector:
19
- """Collects relationship matches during graph traversal."""
20
-
21
- def __init__(self) -> None:
22
- self._matches: List[RelationshipMatchRecord] = []
23
- self._node_ids: List[str] = []
24
-
25
- def push(self, relationship: 'Relationship', traversal_id: str = "") -> RelationshipMatchRecord:
26
- """Push a new match onto the collector."""
27
- start_node_value = relationship.source.value() if relationship.source else None
28
- rel_data = relationship.get_data()
29
- current_record = rel_data.current() if rel_data else None
30
- default_type = relationship.type or ""
31
- if current_record and isinstance(current_record, dict):
32
- actual_type = current_record.get('_type', default_type)
33
- else:
34
- actual_type = default_type
35
- rel_props: Dict[str, Any] = (rel_data.properties() or {}) if rel_data else {}
36
- match: RelationshipMatchRecord = {
37
- **rel_props,
38
- "type": actual_type,
39
- "startNode": start_node_value or {},
40
- "endNode": None,
41
- "properties": rel_props,
42
- }
43
- self._matches.append(match)
44
- self._node_ids.append(traversal_id)
45
- return match
46
-
47
- @property
48
- def end_node(self) -> Any:
49
- """Get the end node of the last match."""
50
- if self._matches:
51
- return self._matches[-1].get("endNode")
52
- return None
53
-
54
- @end_node.setter
55
- def end_node(self, node: 'Node') -> None:
56
- """Set the end node of the last match."""
57
- if self._matches:
58
- node_value = node.value()
59
- self._matches[-1]["endNode"] = node_value if node_value else None
60
-
61
- def pop(self) -> Optional[RelationshipMatchRecord]:
62
- """Pop the last match from the collector."""
63
- if self._node_ids:
64
- self._node_ids.pop()
65
- if self._matches:
66
- return self._matches.pop()
67
- return None
68
-
69
- def value(self) -> Optional[Union[RelationshipMatchRecord, List[RelationshipMatchRecord]]]:
70
- """Get the current value(s)."""
71
- if len(self._matches) == 0:
72
- return None
73
- elif len(self._matches) == 1:
74
- return self._matches[0]
75
- else:
76
- return self._matches
77
-
78
- @property
79
- def matches(self) -> List[RelationshipMatchRecord]:
80
- """Get all matches."""
81
- return self._matches
82
-
83
- def is_circular(self, next_id: str = "") -> bool:
84
- """Check if traversing to the given node id would form a cycle."""
85
- return next_id in self._node_ids
@@ -1,21 +0,0 @@
1
- from typing import Any, Optional
2
-
3
- from ..parsing.ast_node import ASTNode
4
- from .relationship import Relationship
5
-
6
-
7
- class RelationshipReference(Relationship):
8
- """Represents a reference to an existing relationship variable."""
9
-
10
- def __init__(self, relationship: Relationship, referred: ASTNode) -> None:
11
- super().__init__()
12
- self._referred = referred
13
- if relationship.types:
14
- self.types = relationship.types
15
-
16
- @property
17
- def referred(self) -> ASTNode:
18
- return self._referred
19
-
20
- def value(self) -> Optional[Any]:
21
- return self._referred.value() if self._referred else None
@@ -1,5 +0,0 @@
1
- """IO module for FlowQuery."""
2
-
3
- from .command_line import CommandLine
4
-
5
- __all__ = ["CommandLine"]
@@ -1,108 +0,0 @@
1
- """Interactive command-line interface for FlowQuery."""
2
-
3
- import argparse
4
- import asyncio
5
-
6
- from ..compute.runner import Runner
7
-
8
-
9
- class CommandLine:
10
- """Interactive command-line interface for FlowQuery.
11
-
12
- Provides a REPL (Read-Eval-Print Loop) for executing FlowQuery statements
13
- and displaying results.
14
-
15
- Example:
16
- cli = CommandLine()
17
- cli.loop() # Starts interactive mode
18
-
19
- # Or execute a single query:
20
- cli.execute("load json from 'https://example.com/data' as d return d")
21
- """
22
-
23
- def execute(self, query: str) -> None:
24
- """Execute a single FlowQuery statement and print results.
25
-
26
- Args:
27
- query: The FlowQuery statement to execute.
28
- """
29
- # Remove the termination semicolon if present
30
- query = query.strip().rstrip(";")
31
-
32
- try:
33
- runner = Runner(query)
34
- asyncio.run(self._execute(runner))
35
- except Exception as e:
36
- print(f"Error: {e}")
37
-
38
- def loop(self) -> None:
39
- """Starts the interactive command loop.
40
-
41
- Prompts the user for FlowQuery statements, executes them, and displays results.
42
- Type "exit" to quit the loop. End multi-line queries with ";".
43
- """
44
- print('Welcome to FlowQuery! Type "exit" to quit.')
45
- print('End queries with ";" to execute. Multi-line input supported.')
46
-
47
- while True:
48
- try:
49
- lines = []
50
- prompt = "> "
51
- while True:
52
- line = input(prompt)
53
- if line.strip() == "exit":
54
- print("Exiting FlowQuery.")
55
- return
56
- lines.append(line)
57
- user_input = "\n".join(lines)
58
- if user_input.strip().endswith(";"):
59
- break
60
- prompt = "... "
61
- except EOFError:
62
- break
63
-
64
- if user_input.strip() == "":
65
- continue
66
-
67
- # Remove the termination semicolon before sending to the engine
68
- user_input = user_input.strip().rstrip(";")
69
-
70
- try:
71
- runner = Runner(user_input)
72
- asyncio.run(self._execute(runner))
73
- except Exception as e:
74
- print(f"Error: {e}")
75
-
76
- print("Exiting FlowQuery.")
77
-
78
- async def _execute(self, runner: Runner) -> None:
79
- await runner.run()
80
- print(runner.results)
81
-
82
-
83
- def main() -> None:
84
- """Entry point for the flowquery CLI command.
85
-
86
- Usage:
87
- flowquery # Start interactive mode
88
- flowquery -c "query" # Execute a single query
89
- flowquery --command "query"
90
- """
91
- parser = argparse.ArgumentParser(
92
- description="FlowQuery - A declarative query language for data processing pipelines",
93
- prog="flowquery"
94
- )
95
- parser.add_argument(
96
- "-c", "--command",
97
- type=str,
98
- metavar="QUERY",
99
- help="Execute a FlowQuery statement and exit"
100
- )
101
-
102
- args = parser.parse_args()
103
- cli = CommandLine()
104
-
105
- if args.command:
106
- cli.execute(args.command)
107
- else:
108
- cli.loop()
@@ -1,17 +0,0 @@
1
- """Parsing module for FlowQuery."""
2
-
3
- from .alias import Alias
4
- from .alias_option import AliasOption
5
- from .ast_node import ASTNode
6
- from .base_parser import BaseParser
7
- from .context import Context
8
- from .parser import Parser
9
-
10
- __all__ = [
11
- "ASTNode",
12
- "Context",
13
- "Alias",
14
- "AliasOption",
15
- "BaseParser",
16
- "Parser",
17
- ]
@@ -1,20 +0,0 @@
1
- """Alias node for FlowQuery AST."""
2
-
3
- from .ast_node import ASTNode
4
-
5
-
6
- class Alias(ASTNode):
7
- """Represents an alias in the FlowQuery AST."""
8
-
9
- def __init__(self, alias: str):
10
- super().__init__()
11
- self._alias = alias
12
-
13
- def __str__(self) -> str:
14
- return f"Alias ({self._alias})"
15
-
16
- def get_alias(self) -> str:
17
- return self._alias
18
-
19
- def value(self) -> str:
20
- return self._alias
@@ -1,11 +0,0 @@
1
- """Alias option enumeration for FlowQuery parsing."""
2
-
3
- from enum import Enum
4
-
5
-
6
- class AliasOption(Enum):
7
- """Enumeration of alias options for parsing."""
8
-
9
- NOT_ALLOWED = 0
10
- OPTIONAL = 1
11
- REQUIRED = 2
@@ -1,147 +0,0 @@
1
- """Represents a node in the Abstract Syntax Tree (AST)."""
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Any, Generator, List, Optional
6
-
7
-
8
- class ASTNode:
9
- """Represents a node in the Abstract Syntax Tree (AST).
10
-
11
- The AST is a tree representation of the parsed FlowQuery statement structure.
12
- Each node can have children and maintains a reference to its parent.
13
-
14
- Example:
15
- root = ASTNode()
16
- child = ASTNode()
17
- root.add_child(child)
18
- """
19
-
20
- def __init__(self) -> None:
21
- self._parent: Optional[ASTNode] = None
22
- self.children: List[ASTNode] = []
23
-
24
- def add_child(self, child: ASTNode) -> None:
25
- """Adds a child node to this node and sets the child's parent reference.
26
-
27
- Args:
28
- child: The child node to add
29
- """
30
- child._parent = self
31
- self.children.append(child)
32
-
33
- def first_child(self) -> ASTNode:
34
- """Returns the first child node.
35
-
36
- Returns:
37
- The first child node
38
-
39
- Raises:
40
- ValueError: If the node has no children
41
- """
42
- if len(self.children) == 0:
43
- raise ValueError('Expected child')
44
- return self.children[0]
45
-
46
- def last_child(self) -> ASTNode:
47
- """Returns the last child node.
48
-
49
- Returns:
50
- The last child node
51
-
52
- Raises:
53
- ValueError: If the node has no children
54
- """
55
- if len(self.children) == 0:
56
- raise ValueError('Expected child')
57
- return self.children[-1]
58
-
59
- def get_children(self) -> List[ASTNode]:
60
- """Returns all child nodes.
61
-
62
- Returns:
63
- Array of child nodes
64
- """
65
- return self.children
66
-
67
- def child_count(self) -> int:
68
- """Returns the number of child nodes.
69
-
70
- Returns:
71
- The count of children
72
- """
73
- return len(self.children)
74
-
75
- def value(self) -> Any:
76
- """Returns the value of this node. Override in subclasses to provide specific values.
77
-
78
- Returns:
79
- The node's value, or None if not applicable
80
- """
81
- return None
82
-
83
- def is_operator(self) -> bool:
84
- """Checks if this node represents an operator.
85
-
86
- Returns:
87
- True if this is an operator node, False otherwise
88
- """
89
- return False
90
-
91
- def is_operand(self) -> bool:
92
- """Checks if this node represents an operand (the opposite of an operator).
93
-
94
- Returns:
95
- True if this is an operand node, False otherwise
96
- """
97
- return not self.is_operator()
98
-
99
- @property
100
- def precedence(self) -> int:
101
- """Gets the operator precedence for this node. Higher values indicate higher precedence.
102
-
103
- Returns:
104
- The precedence value (0 for non-operators)
105
- """
106
- return 0
107
-
108
- @property
109
- def left_associative(self) -> bool:
110
- """Indicates whether this operator is left-associative.
111
-
112
- Returns:
113
- True if left-associative, False otherwise
114
- """
115
- return False
116
-
117
- def print(self) -> str:
118
- """Prints a string representation of the AST tree starting from this node.
119
-
120
- Returns:
121
- A formatted string showing the tree structure
122
- """
123
- return '\n'.join(self._print(0))
124
-
125
- def _print(self, indent: int) -> Generator[str, None, None]:
126
- """Generator function for recursively printing the tree structure.
127
-
128
- Args:
129
- indent: The current indentation level
130
-
131
- Yields:
132
- Lines representing each node in the tree
133
- """
134
- if indent == 0:
135
- yield self.__class__.__name__
136
- elif indent > 0:
137
- yield '-' * indent + f' {self}'
138
- for child in self.children:
139
- yield from child._print(indent + 1)
140
-
141
- def __str__(self) -> str:
142
- """Returns a string representation of this node. Override in subclasses for custom formatting.
143
-
144
- Returns:
145
- The string representation
146
- """
147
- return self.__class__.__name__