exonware-xwnode 0.0.1.21__py3-none-any.whl → 0.0.1.23__py3-none-any.whl

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 (250) hide show
  1. exonware/__init__.py +8 -1
  2. exonware/xwnode/__init__.py +18 -5
  3. exonware/xwnode/add_strategy_types.py +165 -0
  4. exonware/xwnode/base.py +7 -5
  5. exonware/xwnode/common/__init__.py +1 -1
  6. exonware/xwnode/common/graph/__init__.py +30 -0
  7. exonware/xwnode/common/graph/caching.py +131 -0
  8. exonware/xwnode/common/graph/contracts.py +100 -0
  9. exonware/xwnode/common/graph/errors.py +44 -0
  10. exonware/xwnode/common/graph/indexing.py +260 -0
  11. exonware/xwnode/common/graph/manager.py +568 -0
  12. exonware/xwnode/common/management/__init__.py +3 -5
  13. exonware/xwnode/common/management/manager.py +9 -9
  14. exonware/xwnode/common/management/migration.py +6 -6
  15. exonware/xwnode/common/monitoring/__init__.py +3 -5
  16. exonware/xwnode/common/monitoring/metrics.py +7 -3
  17. exonware/xwnode/common/monitoring/pattern_detector.py +2 -2
  18. exonware/xwnode/common/monitoring/performance_monitor.py +6 -2
  19. exonware/xwnode/common/patterns/__init__.py +3 -5
  20. exonware/xwnode/common/patterns/advisor.py +1 -1
  21. exonware/xwnode/common/patterns/flyweight.py +6 -2
  22. exonware/xwnode/common/patterns/registry.py +203 -184
  23. exonware/xwnode/common/utils/__init__.py +25 -11
  24. exonware/xwnode/common/utils/simple.py +1 -1
  25. exonware/xwnode/config.py +3 -8
  26. exonware/xwnode/contracts.py +4 -105
  27. exonware/xwnode/defs.py +413 -159
  28. exonware/xwnode/edges/strategies/__init__.py +86 -4
  29. exonware/xwnode/edges/strategies/_base_edge.py +2 -2
  30. exonware/xwnode/edges/strategies/adj_list.py +287 -121
  31. exonware/xwnode/edges/strategies/adj_matrix.py +316 -222
  32. exonware/xwnode/edges/strategies/base.py +1 -1
  33. exonware/xwnode/edges/strategies/{edge_bidir_wrapper.py → bidir_wrapper.py} +45 -4
  34. exonware/xwnode/edges/strategies/bitemporal.py +520 -0
  35. exonware/xwnode/edges/strategies/{edge_block_adj_matrix.py → block_adj_matrix.py} +77 -6
  36. exonware/xwnode/edges/strategies/bv_graph.py +664 -0
  37. exonware/xwnode/edges/strategies/compressed_graph.py +217 -0
  38. exonware/xwnode/edges/strategies/{edge_coo.py → coo.py} +46 -4
  39. exonware/xwnode/edges/strategies/{edge_csc.py → csc.py} +45 -4
  40. exonware/xwnode/edges/strategies/{edge_csr.py → csr.py} +94 -12
  41. exonware/xwnode/edges/strategies/{edge_dynamic_adj_list.py → dynamic_adj_list.py} +46 -4
  42. exonware/xwnode/edges/strategies/edge_list.py +168 -0
  43. exonware/xwnode/edges/strategies/edge_property_store.py +2 -2
  44. exonware/xwnode/edges/strategies/euler_tour.py +560 -0
  45. exonware/xwnode/edges/strategies/{edge_flow_network.py → flow_network.py} +2 -2
  46. exonware/xwnode/edges/strategies/graphblas.py +449 -0
  47. exonware/xwnode/edges/strategies/hnsw.py +637 -0
  48. exonware/xwnode/edges/strategies/hop2_labels.py +467 -0
  49. exonware/xwnode/edges/strategies/{edge_hyperedge_set.py → hyperedge_set.py} +2 -2
  50. exonware/xwnode/edges/strategies/incidence_matrix.py +250 -0
  51. exonware/xwnode/edges/strategies/k2_tree.py +613 -0
  52. exonware/xwnode/edges/strategies/link_cut.py +626 -0
  53. exonware/xwnode/edges/strategies/multiplex.py +532 -0
  54. exonware/xwnode/edges/strategies/{edge_neural_graph.py → neural_graph.py} +2 -2
  55. exonware/xwnode/edges/strategies/{edge_octree.py → octree.py} +69 -11
  56. exonware/xwnode/edges/strategies/{edge_quadtree.py → quadtree.py} +66 -10
  57. exonware/xwnode/edges/strategies/roaring_adj.py +438 -0
  58. exonware/xwnode/edges/strategies/{edge_rtree.py → rtree.py} +43 -5
  59. exonware/xwnode/edges/strategies/{edge_temporal_edgeset.py → temporal_edgeset.py} +24 -5
  60. exonware/xwnode/edges/strategies/{edge_tree_graph_basic.py → tree_graph_basic.py} +78 -7
  61. exonware/xwnode/edges/strategies/{edge_weighted_graph.py → weighted_graph.py} +188 -10
  62. exonware/xwnode/errors.py +3 -6
  63. exonware/xwnode/facade.py +20 -20
  64. exonware/xwnode/nodes/strategies/__init__.py +29 -9
  65. exonware/xwnode/nodes/strategies/adjacency_list.py +650 -177
  66. exonware/xwnode/nodes/strategies/aho_corasick.py +358 -183
  67. exonware/xwnode/nodes/strategies/array_list.py +36 -3
  68. exonware/xwnode/nodes/strategies/art.py +581 -0
  69. exonware/xwnode/nodes/strategies/{node_avl_tree.py → avl_tree.py} +77 -6
  70. exonware/xwnode/nodes/strategies/{node_b_plus_tree.py → b_plus_tree.py} +81 -40
  71. exonware/xwnode/nodes/strategies/{node_btree.py → b_tree.py} +79 -9
  72. exonware/xwnode/nodes/strategies/base.py +469 -98
  73. exonware/xwnode/nodes/strategies/{node_bitmap.py → bitmap.py} +12 -12
  74. exonware/xwnode/nodes/strategies/{node_bitset_dynamic.py → bitset_dynamic.py} +11 -11
  75. exonware/xwnode/nodes/strategies/{node_bloom_filter.py → bloom_filter.py} +15 -2
  76. exonware/xwnode/nodes/strategies/bloomier_filter.py +519 -0
  77. exonware/xwnode/nodes/strategies/bw_tree.py +531 -0
  78. exonware/xwnode/nodes/strategies/contracts.py +1 -1
  79. exonware/xwnode/nodes/strategies/{node_count_min_sketch.py → count_min_sketch.py} +3 -2
  80. exonware/xwnode/nodes/strategies/{node_cow_tree.py → cow_tree.py} +135 -13
  81. exonware/xwnode/nodes/strategies/crdt_map.py +629 -0
  82. exonware/xwnode/nodes/strategies/{node_cuckoo_hash.py → cuckoo_hash.py} +2 -2
  83. exonware/xwnode/nodes/strategies/{node_xdata_optimized.py → data_interchange_optimized.py} +21 -4
  84. exonware/xwnode/nodes/strategies/dawg.py +876 -0
  85. exonware/xwnode/nodes/strategies/deque.py +321 -153
  86. exonware/xwnode/nodes/strategies/extendible_hash.py +93 -0
  87. exonware/xwnode/nodes/strategies/{node_fenwick_tree.py → fenwick_tree.py} +111 -19
  88. exonware/xwnode/nodes/strategies/hamt.py +403 -0
  89. exonware/xwnode/nodes/strategies/hash_map.py +354 -67
  90. exonware/xwnode/nodes/strategies/heap.py +105 -5
  91. exonware/xwnode/nodes/strategies/hopscotch_hash.py +525 -0
  92. exonware/xwnode/nodes/strategies/{node_hyperloglog.py → hyperloglog.py} +6 -5
  93. exonware/xwnode/nodes/strategies/interval_tree.py +742 -0
  94. exonware/xwnode/nodes/strategies/kd_tree.py +703 -0
  95. exonware/xwnode/nodes/strategies/learned_index.py +533 -0
  96. exonware/xwnode/nodes/strategies/linear_hash.py +93 -0
  97. exonware/xwnode/nodes/strategies/linked_list.py +316 -119
  98. exonware/xwnode/nodes/strategies/{node_lsm_tree.py → lsm_tree.py} +219 -15
  99. exonware/xwnode/nodes/strategies/masstree.py +130 -0
  100. exonware/xwnode/nodes/strategies/{node_persistent_tree.py → persistent_tree.py} +149 -9
  101. exonware/xwnode/nodes/strategies/priority_queue.py +544 -132
  102. exonware/xwnode/nodes/strategies/queue.py +249 -120
  103. exonware/xwnode/nodes/strategies/{node_red_black_tree.py → red_black_tree.py} +183 -72
  104. exonware/xwnode/nodes/strategies/{node_roaring_bitmap.py → roaring_bitmap.py} +19 -6
  105. exonware/xwnode/nodes/strategies/rope.py +717 -0
  106. exonware/xwnode/nodes/strategies/{node_segment_tree.py → segment_tree.py} +106 -106
  107. exonware/xwnode/nodes/strategies/{node_set_hash.py → set_hash.py} +30 -29
  108. exonware/xwnode/nodes/strategies/{node_skip_list.py → skip_list.py} +74 -6
  109. exonware/xwnode/nodes/strategies/sparse_matrix.py +427 -131
  110. exonware/xwnode/nodes/strategies/{node_splay_tree.py → splay_tree.py} +55 -6
  111. exonware/xwnode/nodes/strategies/stack.py +244 -112
  112. exonware/xwnode/nodes/strategies/{node_suffix_array.py → suffix_array.py} +5 -1
  113. exonware/xwnode/nodes/strategies/t_tree.py +94 -0
  114. exonware/xwnode/nodes/strategies/{node_treap.py → treap.py} +75 -6
  115. exonware/xwnode/nodes/strategies/{node_tree_graph_hybrid.py → tree_graph_hybrid.py} +46 -5
  116. exonware/xwnode/nodes/strategies/trie.py +153 -9
  117. exonware/xwnode/nodes/strategies/union_find.py +111 -5
  118. exonware/xwnode/nodes/strategies/veb_tree.py +856 -0
  119. exonware/xwnode/strategies/__init__.py +5 -51
  120. exonware/xwnode/version.py +3 -3
  121. {exonware_xwnode-0.0.1.21.dist-info → exonware_xwnode-0.0.1.23.dist-info}/METADATA +23 -3
  122. exonware_xwnode-0.0.1.23.dist-info/RECORD +130 -0
  123. exonware/xwnode/edges/strategies/edge_adj_list.py +0 -353
  124. exonware/xwnode/edges/strategies/edge_adj_matrix.py +0 -445
  125. exonware/xwnode/nodes/strategies/_base_node.py +0 -307
  126. exonware/xwnode/nodes/strategies/node_aho_corasick.py +0 -525
  127. exonware/xwnode/nodes/strategies/node_array_list.py +0 -179
  128. exonware/xwnode/nodes/strategies/node_hash_map.py +0 -273
  129. exonware/xwnode/nodes/strategies/node_heap.py +0 -196
  130. exonware/xwnode/nodes/strategies/node_linked_list.py +0 -413
  131. exonware/xwnode/nodes/strategies/node_trie.py +0 -257
  132. exonware/xwnode/nodes/strategies/node_union_find.py +0 -192
  133. exonware/xwnode/queries/executors/__init__.py +0 -47
  134. exonware/xwnode/queries/executors/advanced/__init__.py +0 -37
  135. exonware/xwnode/queries/executors/advanced/aggregate_executor.py +0 -50
  136. exonware/xwnode/queries/executors/advanced/ask_executor.py +0 -50
  137. exonware/xwnode/queries/executors/advanced/construct_executor.py +0 -50
  138. exonware/xwnode/queries/executors/advanced/describe_executor.py +0 -50
  139. exonware/xwnode/queries/executors/advanced/for_loop_executor.py +0 -50
  140. exonware/xwnode/queries/executors/advanced/foreach_executor.py +0 -50
  141. exonware/xwnode/queries/executors/advanced/join_executor.py +0 -50
  142. exonware/xwnode/queries/executors/advanced/let_executor.py +0 -50
  143. exonware/xwnode/queries/executors/advanced/mutation_executor.py +0 -50
  144. exonware/xwnode/queries/executors/advanced/options_executor.py +0 -50
  145. exonware/xwnode/queries/executors/advanced/pipe_executor.py +0 -50
  146. exonware/xwnode/queries/executors/advanced/subscribe_executor.py +0 -50
  147. exonware/xwnode/queries/executors/advanced/subscription_executor.py +0 -50
  148. exonware/xwnode/queries/executors/advanced/union_executor.py +0 -50
  149. exonware/xwnode/queries/executors/advanced/window_executor.py +0 -51
  150. exonware/xwnode/queries/executors/advanced/with_cte_executor.py +0 -50
  151. exonware/xwnode/queries/executors/aggregation/__init__.py +0 -21
  152. exonware/xwnode/queries/executors/aggregation/avg_executor.py +0 -50
  153. exonware/xwnode/queries/executors/aggregation/count_executor.py +0 -38
  154. exonware/xwnode/queries/executors/aggregation/distinct_executor.py +0 -50
  155. exonware/xwnode/queries/executors/aggregation/group_executor.py +0 -50
  156. exonware/xwnode/queries/executors/aggregation/having_executor.py +0 -50
  157. exonware/xwnode/queries/executors/aggregation/max_executor.py +0 -50
  158. exonware/xwnode/queries/executors/aggregation/min_executor.py +0 -50
  159. exonware/xwnode/queries/executors/aggregation/sum_executor.py +0 -50
  160. exonware/xwnode/queries/executors/aggregation/summarize_executor.py +0 -50
  161. exonware/xwnode/queries/executors/array/__init__.py +0 -9
  162. exonware/xwnode/queries/executors/array/indexing_executor.py +0 -51
  163. exonware/xwnode/queries/executors/array/slicing_executor.py +0 -51
  164. exonware/xwnode/queries/executors/base.py +0 -257
  165. exonware/xwnode/queries/executors/capability_checker.py +0 -204
  166. exonware/xwnode/queries/executors/contracts.py +0 -166
  167. exonware/xwnode/queries/executors/core/__init__.py +0 -17
  168. exonware/xwnode/queries/executors/core/create_executor.py +0 -96
  169. exonware/xwnode/queries/executors/core/delete_executor.py +0 -99
  170. exonware/xwnode/queries/executors/core/drop_executor.py +0 -100
  171. exonware/xwnode/queries/executors/core/insert_executor.py +0 -39
  172. exonware/xwnode/queries/executors/core/select_executor.py +0 -152
  173. exonware/xwnode/queries/executors/core/update_executor.py +0 -102
  174. exonware/xwnode/queries/executors/data/__init__.py +0 -13
  175. exonware/xwnode/queries/executors/data/alter_executor.py +0 -50
  176. exonware/xwnode/queries/executors/data/load_executor.py +0 -50
  177. exonware/xwnode/queries/executors/data/merge_executor.py +0 -50
  178. exonware/xwnode/queries/executors/data/store_executor.py +0 -50
  179. exonware/xwnode/queries/executors/defs.py +0 -93
  180. exonware/xwnode/queries/executors/engine.py +0 -221
  181. exonware/xwnode/queries/executors/errors.py +0 -68
  182. exonware/xwnode/queries/executors/filtering/__init__.py +0 -25
  183. exonware/xwnode/queries/executors/filtering/between_executor.py +0 -80
  184. exonware/xwnode/queries/executors/filtering/filter_executor.py +0 -79
  185. exonware/xwnode/queries/executors/filtering/has_executor.py +0 -70
  186. exonware/xwnode/queries/executors/filtering/in_executor.py +0 -70
  187. exonware/xwnode/queries/executors/filtering/like_executor.py +0 -76
  188. exonware/xwnode/queries/executors/filtering/optional_executor.py +0 -76
  189. exonware/xwnode/queries/executors/filtering/range_executor.py +0 -80
  190. exonware/xwnode/queries/executors/filtering/term_executor.py +0 -77
  191. exonware/xwnode/queries/executors/filtering/values_executor.py +0 -71
  192. exonware/xwnode/queries/executors/filtering/where_executor.py +0 -44
  193. exonware/xwnode/queries/executors/graph/__init__.py +0 -15
  194. exonware/xwnode/queries/executors/graph/in_traverse_executor.py +0 -51
  195. exonware/xwnode/queries/executors/graph/match_executor.py +0 -51
  196. exonware/xwnode/queries/executors/graph/out_executor.py +0 -51
  197. exonware/xwnode/queries/executors/graph/path_executor.py +0 -51
  198. exonware/xwnode/queries/executors/graph/return_executor.py +0 -51
  199. exonware/xwnode/queries/executors/ordering/__init__.py +0 -9
  200. exonware/xwnode/queries/executors/ordering/by_executor.py +0 -50
  201. exonware/xwnode/queries/executors/ordering/order_executor.py +0 -51
  202. exonware/xwnode/queries/executors/projection/__init__.py +0 -9
  203. exonware/xwnode/queries/executors/projection/extend_executor.py +0 -50
  204. exonware/xwnode/queries/executors/projection/project_executor.py +0 -50
  205. exonware/xwnode/queries/executors/registry.py +0 -173
  206. exonware/xwnode/queries/parsers/__init__.py +0 -26
  207. exonware/xwnode/queries/parsers/base.py +0 -86
  208. exonware/xwnode/queries/parsers/contracts.py +0 -46
  209. exonware/xwnode/queries/parsers/errors.py +0 -53
  210. exonware/xwnode/queries/parsers/sql_param_extractor.py +0 -318
  211. exonware/xwnode/queries/strategies/__init__.py +0 -24
  212. exonware/xwnode/queries/strategies/base.py +0 -236
  213. exonware/xwnode/queries/strategies/cql.py +0 -201
  214. exonware/xwnode/queries/strategies/cypher.py +0 -181
  215. exonware/xwnode/queries/strategies/datalog.py +0 -70
  216. exonware/xwnode/queries/strategies/elastic_dsl.py +0 -70
  217. exonware/xwnode/queries/strategies/eql.py +0 -70
  218. exonware/xwnode/queries/strategies/flux.py +0 -70
  219. exonware/xwnode/queries/strategies/gql.py +0 -70
  220. exonware/xwnode/queries/strategies/graphql.py +0 -240
  221. exonware/xwnode/queries/strategies/gremlin.py +0 -181
  222. exonware/xwnode/queries/strategies/hiveql.py +0 -214
  223. exonware/xwnode/queries/strategies/hql.py +0 -70
  224. exonware/xwnode/queries/strategies/jmespath.py +0 -219
  225. exonware/xwnode/queries/strategies/jq.py +0 -66
  226. exonware/xwnode/queries/strategies/json_query.py +0 -66
  227. exonware/xwnode/queries/strategies/jsoniq.py +0 -248
  228. exonware/xwnode/queries/strategies/kql.py +0 -70
  229. exonware/xwnode/queries/strategies/linq.py +0 -238
  230. exonware/xwnode/queries/strategies/logql.py +0 -70
  231. exonware/xwnode/queries/strategies/mql.py +0 -68
  232. exonware/xwnode/queries/strategies/n1ql.py +0 -210
  233. exonware/xwnode/queries/strategies/partiql.py +0 -70
  234. exonware/xwnode/queries/strategies/pig.py +0 -215
  235. exonware/xwnode/queries/strategies/promql.py +0 -70
  236. exonware/xwnode/queries/strategies/sparql.py +0 -220
  237. exonware/xwnode/queries/strategies/sql.py +0 -275
  238. exonware/xwnode/queries/strategies/xml_query.py +0 -66
  239. exonware/xwnode/queries/strategies/xpath.py +0 -223
  240. exonware/xwnode/queries/strategies/xquery.py +0 -258
  241. exonware/xwnode/queries/strategies/xwnode_executor.py +0 -332
  242. exonware/xwnode/queries/strategies/xwquery.py +0 -456
  243. exonware_xwnode-0.0.1.21.dist-info/RECORD +0 -214
  244. /exonware/xwnode/nodes/strategies/{node_ordered_map.py → ordered_map.py} +0 -0
  245. /exonware/xwnode/nodes/strategies/{node_ordered_map_balanced.py → ordered_map_balanced.py} +0 -0
  246. /exonware/xwnode/nodes/strategies/{node_patricia.py → patricia.py} +0 -0
  247. /exonware/xwnode/nodes/strategies/{node_radix_trie.py → radix_trie.py} +0 -0
  248. /exonware/xwnode/nodes/strategies/{node_set_tree.py → set_tree.py} +0 -0
  249. {exonware_xwnode-0.0.1.21.dist-info → exonware_xwnode-0.0.1.23.dist-info}/WHEEL +0 -0
  250. {exonware_xwnode-0.0.1.21.dist-info → exonware_xwnode-0.0.1.23.dist-info}/licenses/LICENSE +0 -0
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/core/insert_executor.py
4
-
5
- INSERT Operation Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 08-Oct-2025
12
- """
13
-
14
- from ..base import AUniversalOperationExecutor
15
- from ..contracts import Action, ExecutionContext, ExecutionResult
16
-
17
-
18
- class InsertExecutor(AUniversalOperationExecutor):
19
- """INSERT operation executor - Universal operation."""
20
-
21
- OPERATION_NAME = "INSERT"
22
-
23
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
24
- """Execute INSERT operation on node."""
25
- key = action.params.get('key')
26
- value = action.params.get('value')
27
-
28
- # Insert into node using strategy
29
- if hasattr(context.node, 'insert'):
30
- context.node.insert(key, value)
31
- elif hasattr(context.node, 'put'):
32
- context.node.put(key, value)
33
- elif hasattr(context.node, '_strategy'):
34
- context.node._strategy.insert(key, value)
35
-
36
- return ExecutionResult(data={'inserted': key}, affected_count=1)
37
-
38
-
39
- __all__ = ['InsertExecutor']
@@ -1,152 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/core/select_executor.py
4
-
5
- SELECT Operation Executor
6
-
7
- Implements SELECT operation execution on all node types.
8
-
9
- Company: eXonware.com
10
- Author: Eng. Muhammad AlShehri
11
- Email: connect@exonware.com
12
- Version: 0.0.1.21
13
- Generation Date: 08-Oct-2025
14
- """
15
-
16
- from typing import Any, List, Dict, Optional
17
- from ..base import AUniversalOperationExecutor
18
- from ..contracts import Action, ExecutionContext, ExecutionResult
19
- from ..defs import OperationCapability
20
- from ...nodes.strategies.contracts import NodeType
21
-
22
-
23
- class SelectExecutor(AUniversalOperationExecutor):
24
- """
25
- SELECT operation executor - Universal operation.
26
-
27
- Works on all node types (LINEAR, TREE, GRAPH, MATRIX).
28
- Retrieves and projects data from nodes.
29
- """
30
-
31
- OPERATION_NAME = "SELECT"
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """
35
- Execute SELECT operation.
36
-
37
- Supports:
38
- - Column projection
39
- - Star (*) selection
40
- - Expressions and aliases
41
- - Adapts to different node types
42
- """
43
- # Extract parameters
44
- columns = action.params.get('columns', ['*'])
45
- source = action.params.get('from', context.node)
46
-
47
- # Get node type
48
- node_type = self._get_node_type(context.node)
49
-
50
- # Route to appropriate handler based on node type
51
- if node_type == NodeType.LINEAR:
52
- data = self._select_from_linear(source, columns, context)
53
- elif node_type == NodeType.TREE:
54
- data = self._select_from_tree(source, columns, context)
55
- elif node_type == NodeType.GRAPH:
56
- data = self._select_from_graph(source, columns, context)
57
- elif node_type == NodeType.MATRIX:
58
- data = self._select_from_matrix(source, columns, context)
59
- else: # HYBRID
60
- data = self._select_from_tree(source, columns, context) # Default to tree
61
-
62
- return ExecutionResult(
63
- data=data,
64
- affected_count=len(data) if isinstance(data, list) else 1
65
- )
66
-
67
- def _get_node_type(self, node: Any) -> NodeType:
68
- """Get node's strategy type."""
69
- if hasattr(node, '_strategy') and hasattr(node._strategy, 'STRATEGY_TYPE'):
70
- return node._strategy.STRATEGY_TYPE
71
- elif hasattr(node, 'STRATEGY_TYPE'):
72
- return node.STRATEGY_TYPE
73
- return NodeType.TREE # Default
74
-
75
- def _select_from_linear(self, source: Any, columns: List[str], context: ExecutionContext) -> List[Dict]:
76
- """Select from linear node (list-like)."""
77
- results = []
78
-
79
- # Iterate through linear structure
80
- if hasattr(source, 'items'):
81
- for key, value in source.items():
82
- if columns == ['*']:
83
- results.append({'key': key, 'value': value})
84
- else:
85
- row = self._project_columns(value, columns)
86
- results.append(row)
87
-
88
- return results
89
-
90
- def _select_from_tree(self, source: Any, columns: List[str], context: ExecutionContext) -> List[Dict]:
91
- """Select from tree node (key-value map)."""
92
- results = []
93
-
94
- # Iterate through tree structure
95
- if hasattr(source, 'items'):
96
- for key, value in source.items():
97
- if columns == ['*']:
98
- results.append({'key': key, 'value': value})
99
- else:
100
- row = self._project_columns(value, columns)
101
- if row:
102
- results.append(row)
103
-
104
- return results
105
-
106
- def _select_from_graph(self, source: Any, columns: List[str], context: ExecutionContext) -> List[Dict]:
107
- """Select from graph node."""
108
- # For graphs, return nodes
109
- results = []
110
-
111
- if hasattr(source, 'items'):
112
- for key, value in source.items():
113
- if columns == ['*']:
114
- results.append({'node_id': key, 'node_data': value})
115
- else:
116
- row = self._project_columns(value, columns)
117
- if row:
118
- row['node_id'] = key
119
- results.append(row)
120
-
121
- return results
122
-
123
- def _select_from_matrix(self, source: Any, columns: List[str], context: ExecutionContext) -> List[Dict]:
124
- """Select from matrix node."""
125
- results = []
126
-
127
- # Iterate through matrix
128
- if hasattr(source, 'items'):
129
- for key, value in source.items():
130
- if columns == ['*']:
131
- results.append({'position': key, 'value': value})
132
- else:
133
- row = self._project_columns(value, columns)
134
- if row:
135
- results.append(row)
136
-
137
- return results
138
-
139
- def _project_columns(self, value: Any, columns: List[str]) -> Optional[Dict]:
140
- """Project specific columns from a value."""
141
- if not isinstance(value, dict):
142
- return {'value': value}
143
-
144
- projected = {}
145
- for col in columns:
146
- if col in value:
147
- projected[col] = value[col]
148
-
149
- return projected if projected else None
150
-
151
-
152
- __all__ = ['SelectExecutor']
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/core/update_executor.py
4
-
5
- UPDATE Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 08-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AUniversalOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
- from ...nodes.strategies.contracts import NodeType
19
-
20
-
21
- class UpdateExecutor(AUniversalOperationExecutor):
22
- """
23
- UPDATE operation executor - Universal operation.
24
-
25
- Updates existing data in nodes based on specified conditions.
26
- Works on all node types (LINEAR, TREE, GRAPH, MATRIX, HYBRID).
27
-
28
- Capability: Universal
29
- Operation Type: CORE
30
- """
31
-
32
- OPERATION_NAME = "UPDATE"
33
- OPERATION_TYPE = OperationType.CORE
34
- SUPPORTED_NODE_TYPES = [] # Empty = Universal (all types)
35
-
36
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
37
- """Execute UPDATE operation."""
38
- # 1. Extract parameters
39
- params = action.params
40
- target = params.get('target', None) # What to update (path/key)
41
- values = params.get('values', {}) # New values
42
- condition = params.get('where', None) # Update condition
43
-
44
- # 2. Get node strategy
45
- node = context.node
46
-
47
- # 3. Execute update
48
- result_data = self._execute_update(node, target, values, condition, context)
49
-
50
- # 4. Return result
51
- return ExecutionResult(
52
- success=True,
53
- data=result_data,
54
- operation=self.OPERATION_NAME,
55
- metadata={
56
- 'updated_count': result_data.get('count', 0),
57
- 'target': target,
58
- 'condition': condition
59
- }
60
- )
61
-
62
- def _execute_update(self, node: Any, target: str, values: Dict,
63
- condition: Any, context: ExecutionContext) -> Dict:
64
- """Actual UPDATE logic."""
65
- updated_count = 0
66
- updated_items = []
67
-
68
- if target:
69
- # Update specific target
70
- try:
71
- current = node.get(target, default=None)
72
- if current is not None and self._matches_condition(current, condition):
73
- node.set(target, values)
74
- updated_count = 1
75
- updated_items.append(target)
76
- except Exception as e:
77
- return {
78
- 'count': 0,
79
- 'items': [],
80
- 'error': str(e)
81
- }
82
- else:
83
- # Update all matching items
84
- # This is a simplified implementation - real version would traverse node
85
- updated_count = 0
86
- updated_items = []
87
-
88
- return {
89
- 'count': updated_count,
90
- 'items': updated_items,
91
- 'values': values
92
- }
93
-
94
- def _matches_condition(self, item: Any, condition: Any) -> bool:
95
- """Check if item matches condition."""
96
- if condition is None:
97
- return True
98
-
99
- # Simplified condition checking
100
- # Real implementation would evaluate WHERE clause
101
- return True
102
-
@@ -1,13 +0,0 @@
1
- """Data operation executors."""
2
-
3
- from .load_executor import LoadExecutor
4
- from .store_executor import StoreExecutor
5
- from .merge_executor import MergeExecutor
6
- from .alter_executor import AlterExecutor
7
-
8
- __all__ = [
9
- 'LoadExecutor',
10
- 'StoreExecutor',
11
- 'MergeExecutor',
12
- 'AlterExecutor',
13
- ]
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/data/alter_executor.py
4
-
5
- ALTER Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AUniversalOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
-
19
- class AlterExecutor(AUniversalOperationExecutor):
20
- """
21
- ALTER operation executor.
22
-
23
- Alters structure/schema
24
-
25
- Capability: Universal
26
- Operation Type: DATA_OPS
27
- """
28
-
29
- OPERATION_NAME = "ALTER"
30
- OPERATION_TYPE = OperationType.DATA_OPS
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute ALTER operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_alter(node, params, context)
39
-
40
- return ExecutionResult(
41
- success=True,
42
- data=result_data,
43
- operation=self.OPERATION_NAME,
44
- metadata={'operation': self.OPERATION_NAME}
45
- )
46
-
47
- def _execute_alter(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute alter logic."""
49
- # Implementation here
50
- return {'result': 'ALTER executed', 'params': params}
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/data/load_executor.py
4
-
5
- LOAD Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AUniversalOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
-
19
- class LoadExecutor(AUniversalOperationExecutor):
20
- """
21
- LOAD operation executor.
22
-
23
- Loads data from external sources
24
-
25
- Capability: Universal
26
- Operation Type: DATA_OPS
27
- """
28
-
29
- OPERATION_NAME = "LOAD"
30
- OPERATION_TYPE = OperationType.DATA_OPS
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute LOAD operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_load(node, params, context)
39
-
40
- return ExecutionResult(
41
- success=True,
42
- data=result_data,
43
- operation=self.OPERATION_NAME,
44
- metadata={'operation': self.OPERATION_NAME}
45
- )
46
-
47
- def _execute_load(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute load logic."""
49
- # Implementation here
50
- return {'result': 'LOAD executed', 'params': params}
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/data/merge_executor.py
4
-
5
- MERGE Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AUniversalOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
-
19
- class MergeExecutor(AUniversalOperationExecutor):
20
- """
21
- MERGE operation executor.
22
-
23
- Merges/upserts data
24
-
25
- Capability: Universal
26
- Operation Type: DATA_OPS
27
- """
28
-
29
- OPERATION_NAME = "MERGE"
30
- OPERATION_TYPE = OperationType.DATA_OPS
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute MERGE operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_merge(node, params, context)
39
-
40
- return ExecutionResult(
41
- success=True,
42
- data=result_data,
43
- operation=self.OPERATION_NAME,
44
- metadata={'operation': self.OPERATION_NAME}
45
- )
46
-
47
- def _execute_merge(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute merge logic."""
49
- # Implementation here
50
- return {'result': 'MERGE executed', 'params': params}
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/data/store_executor.py
4
-
5
- STORE Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.21
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AUniversalOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
-
19
- class StoreExecutor(AUniversalOperationExecutor):
20
- """
21
- STORE operation executor.
22
-
23
- Stores data to external destinations
24
-
25
- Capability: Universal
26
- Operation Type: DATA_OPS
27
- """
28
-
29
- OPERATION_NAME = "STORE"
30
- OPERATION_TYPE = OperationType.DATA_OPS
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute STORE operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_store(node, params, context)
39
-
40
- return ExecutionResult(
41
- success=True,
42
- data=result_data,
43
- operation=self.OPERATION_NAME,
44
- metadata={'operation': self.OPERATION_NAME}
45
- )
46
-
47
- def _execute_store(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute store logic."""
49
- # Implementation here
50
- return {'result': 'STORE executed', 'params': params}
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/defs.py
4
-
5
- Executor Types and Enums
6
-
7
- Module-specific types for query operation executors.
8
- Imports shared types from root defs.py per DEV_GUIDELINES.md.
9
-
10
- Company: eXonware.com
11
- Author: Eng. Muhammad AlShehri
12
- Email: connect@exonware.com
13
- Version: 0.0.1.21
14
- Generation Date: 08-Oct-2025
15
- """
16
-
17
- from enum import Enum, Flag, auto
18
-
19
- # Import shared types from root
20
- from ...defs import QueryMode, QueryTrait
21
-
22
- # Import node type from nodes module
23
- from ...nodes.strategies.contracts import NodeType
24
-
25
-
26
- class OperationType(Enum):
27
- """
28
- Operation category classification.
29
-
30
- Used to group the 50 operations by their primary purpose.
31
- """
32
- CORE = auto() # SELECT, INSERT, UPDATE, DELETE, CREATE, DROP
33
- FILTERING = auto() # WHERE, FILTER, BETWEEN, LIKE, IN, HAS
34
- AGGREGATION = auto() # GROUP BY, HAVING, SUM, AVG, COUNT, MIN, MAX, DISTINCT
35
- ORDERING = auto() # ORDER BY, LIMIT, OFFSET
36
- JOINING = auto() # JOIN, UNION, WITH, OPTIONAL
37
- GRAPH = auto() # MATCH, PATH, OUT, IN_TRAVERSE, RETURN
38
- PROJECTION = auto() # PROJECT, EXTEND, CONSTRUCT
39
- SEARCH = auto() # TERM, RANGE
40
- DATA_OPS = auto() # LOAD, STORE, MERGE, ALTER, DESCRIBE
41
- CONTROL_FLOW = auto() # FOREACH, LET, FOR
42
- WINDOW = auto() # WINDOW, AGGREGATE
43
- ARRAY = auto() # SLICING, INDEXING
44
- ADVANCED = auto() # ASK, SUBSCRIBE, MUTATION, PIPE, OPTIONS, VALUES
45
-
46
-
47
- class ExecutionStatus(Enum):
48
- """
49
- Execution status for operations.
50
- """
51
- PENDING = auto() # Not yet started
52
- VALIDATING = auto() # Validating action
53
- EXECUTING = auto() # Currently executing
54
- COMPLETED = auto() # Successfully completed
55
- FAILED = auto() # Execution failed
56
- CANCELLED = auto() # Execution cancelled
57
-
58
-
59
- class OperationCapability(Flag):
60
- """
61
- Operation capability flags.
62
-
63
- Defines what capabilities an operation requires to execute.
64
- Moved from contracts.py per DEV_GUIDELINES.md (enums in types.py).
65
- """
66
- NONE = 0
67
-
68
- # Node type requirements
69
- REQUIRES_LINEAR = auto()
70
- REQUIRES_TREE = auto()
71
- REQUIRES_GRAPH = auto()
72
- REQUIRES_MATRIX = auto()
73
-
74
- # Trait requirements
75
- REQUIRES_ORDERED = auto()
76
- REQUIRES_INDEXED = auto()
77
- REQUIRES_HIERARCHICAL = auto()
78
- REQUIRES_WEIGHTED = auto()
79
- REQUIRES_SPATIAL = auto()
80
-
81
- # Special requirements
82
- REQUIRES_MUTABLE = auto()
83
- REQUIRES_TRANSACTIONAL = auto()
84
-
85
-
86
- __all__ = [
87
- 'OperationType',
88
- 'ExecutionStatus',
89
- 'OperationCapability',
90
- 'NodeType', # Re-export for convenience
91
- 'QueryMode', # Re-export from root
92
- 'QueryTrait', # Re-export from root
93
- ]