exonware-xwnode 0.0.1.22__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 (248) hide show
  1. exonware/__init__.py +1 -1
  2. exonware/xwnode/__init__.py +18 -5
  3. exonware/xwnode/add_strategy_types.py +165 -0
  4. exonware/xwnode/common/__init__.py +1 -1
  5. exonware/xwnode/common/graph/__init__.py +30 -0
  6. exonware/xwnode/common/graph/caching.py +131 -0
  7. exonware/xwnode/common/graph/contracts.py +100 -0
  8. exonware/xwnode/common/graph/errors.py +44 -0
  9. exonware/xwnode/common/graph/indexing.py +260 -0
  10. exonware/xwnode/common/graph/manager.py +568 -0
  11. exonware/xwnode/common/management/__init__.py +3 -5
  12. exonware/xwnode/common/management/manager.py +2 -2
  13. exonware/xwnode/common/management/migration.py +3 -3
  14. exonware/xwnode/common/monitoring/__init__.py +3 -5
  15. exonware/xwnode/common/monitoring/metrics.py +6 -2
  16. exonware/xwnode/common/monitoring/pattern_detector.py +1 -1
  17. exonware/xwnode/common/monitoring/performance_monitor.py +5 -1
  18. exonware/xwnode/common/patterns/__init__.py +3 -5
  19. exonware/xwnode/common/patterns/flyweight.py +5 -1
  20. exonware/xwnode/common/patterns/registry.py +202 -183
  21. exonware/xwnode/common/utils/__init__.py +25 -11
  22. exonware/xwnode/common/utils/simple.py +1 -1
  23. exonware/xwnode/config.py +3 -8
  24. exonware/xwnode/contracts.py +4 -105
  25. exonware/xwnode/defs.py +413 -159
  26. exonware/xwnode/edges/strategies/__init__.py +86 -4
  27. exonware/xwnode/edges/strategies/_base_edge.py +2 -2
  28. exonware/xwnode/edges/strategies/adj_list.py +287 -121
  29. exonware/xwnode/edges/strategies/adj_matrix.py +316 -222
  30. exonware/xwnode/edges/strategies/base.py +1 -1
  31. exonware/xwnode/edges/strategies/{edge_bidir_wrapper.py → bidir_wrapper.py} +45 -4
  32. exonware/xwnode/edges/strategies/bitemporal.py +520 -0
  33. exonware/xwnode/edges/strategies/{edge_block_adj_matrix.py → block_adj_matrix.py} +77 -6
  34. exonware/xwnode/edges/strategies/bv_graph.py +664 -0
  35. exonware/xwnode/edges/strategies/compressed_graph.py +217 -0
  36. exonware/xwnode/edges/strategies/{edge_coo.py → coo.py} +46 -4
  37. exonware/xwnode/edges/strategies/{edge_csc.py → csc.py} +45 -4
  38. exonware/xwnode/edges/strategies/{edge_csr.py → csr.py} +94 -12
  39. exonware/xwnode/edges/strategies/{edge_dynamic_adj_list.py → dynamic_adj_list.py} +46 -4
  40. exonware/xwnode/edges/strategies/edge_list.py +168 -0
  41. exonware/xwnode/edges/strategies/edge_property_store.py +2 -2
  42. exonware/xwnode/edges/strategies/euler_tour.py +560 -0
  43. exonware/xwnode/edges/strategies/{edge_flow_network.py → flow_network.py} +2 -2
  44. exonware/xwnode/edges/strategies/graphblas.py +449 -0
  45. exonware/xwnode/edges/strategies/hnsw.py +637 -0
  46. exonware/xwnode/edges/strategies/hop2_labels.py +467 -0
  47. exonware/xwnode/edges/strategies/{edge_hyperedge_set.py → hyperedge_set.py} +2 -2
  48. exonware/xwnode/edges/strategies/incidence_matrix.py +250 -0
  49. exonware/xwnode/edges/strategies/k2_tree.py +613 -0
  50. exonware/xwnode/edges/strategies/link_cut.py +626 -0
  51. exonware/xwnode/edges/strategies/multiplex.py +532 -0
  52. exonware/xwnode/edges/strategies/{edge_neural_graph.py → neural_graph.py} +2 -2
  53. exonware/xwnode/edges/strategies/{edge_octree.py → octree.py} +69 -11
  54. exonware/xwnode/edges/strategies/{edge_quadtree.py → quadtree.py} +66 -10
  55. exonware/xwnode/edges/strategies/roaring_adj.py +438 -0
  56. exonware/xwnode/edges/strategies/{edge_rtree.py → rtree.py} +43 -5
  57. exonware/xwnode/edges/strategies/{edge_temporal_edgeset.py → temporal_edgeset.py} +24 -5
  58. exonware/xwnode/edges/strategies/{edge_tree_graph_basic.py → tree_graph_basic.py} +78 -7
  59. exonware/xwnode/edges/strategies/{edge_weighted_graph.py → weighted_graph.py} +188 -10
  60. exonware/xwnode/errors.py +3 -6
  61. exonware/xwnode/facade.py +20 -20
  62. exonware/xwnode/nodes/strategies/__init__.py +29 -9
  63. exonware/xwnode/nodes/strategies/adjacency_list.py +650 -177
  64. exonware/xwnode/nodes/strategies/aho_corasick.py +358 -183
  65. exonware/xwnode/nodes/strategies/array_list.py +36 -3
  66. exonware/xwnode/nodes/strategies/art.py +581 -0
  67. exonware/xwnode/nodes/strategies/{node_avl_tree.py → avl_tree.py} +77 -6
  68. exonware/xwnode/nodes/strategies/{node_b_plus_tree.py → b_plus_tree.py} +81 -40
  69. exonware/xwnode/nodes/strategies/{node_btree.py → b_tree.py} +79 -9
  70. exonware/xwnode/nodes/strategies/base.py +469 -98
  71. exonware/xwnode/nodes/strategies/{node_bitmap.py → bitmap.py} +12 -12
  72. exonware/xwnode/nodes/strategies/{node_bitset_dynamic.py → bitset_dynamic.py} +11 -11
  73. exonware/xwnode/nodes/strategies/{node_bloom_filter.py → bloom_filter.py} +15 -2
  74. exonware/xwnode/nodes/strategies/bloomier_filter.py +519 -0
  75. exonware/xwnode/nodes/strategies/bw_tree.py +531 -0
  76. exonware/xwnode/nodes/strategies/contracts.py +1 -1
  77. exonware/xwnode/nodes/strategies/{node_count_min_sketch.py → count_min_sketch.py} +3 -2
  78. exonware/xwnode/nodes/strategies/{node_cow_tree.py → cow_tree.py} +135 -13
  79. exonware/xwnode/nodes/strategies/crdt_map.py +629 -0
  80. exonware/xwnode/nodes/strategies/{node_cuckoo_hash.py → cuckoo_hash.py} +2 -2
  81. exonware/xwnode/nodes/strategies/{node_xdata_optimized.py → data_interchange_optimized.py} +21 -4
  82. exonware/xwnode/nodes/strategies/dawg.py +876 -0
  83. exonware/xwnode/nodes/strategies/deque.py +321 -153
  84. exonware/xwnode/nodes/strategies/extendible_hash.py +93 -0
  85. exonware/xwnode/nodes/strategies/{node_fenwick_tree.py → fenwick_tree.py} +111 -19
  86. exonware/xwnode/nodes/strategies/hamt.py +403 -0
  87. exonware/xwnode/nodes/strategies/hash_map.py +354 -67
  88. exonware/xwnode/nodes/strategies/heap.py +105 -5
  89. exonware/xwnode/nodes/strategies/hopscotch_hash.py +525 -0
  90. exonware/xwnode/nodes/strategies/{node_hyperloglog.py → hyperloglog.py} +6 -5
  91. exonware/xwnode/nodes/strategies/interval_tree.py +742 -0
  92. exonware/xwnode/nodes/strategies/kd_tree.py +703 -0
  93. exonware/xwnode/nodes/strategies/learned_index.py +533 -0
  94. exonware/xwnode/nodes/strategies/linear_hash.py +93 -0
  95. exonware/xwnode/nodes/strategies/linked_list.py +316 -119
  96. exonware/xwnode/nodes/strategies/{node_lsm_tree.py → lsm_tree.py} +219 -15
  97. exonware/xwnode/nodes/strategies/masstree.py +130 -0
  98. exonware/xwnode/nodes/strategies/{node_persistent_tree.py → persistent_tree.py} +149 -9
  99. exonware/xwnode/nodes/strategies/priority_queue.py +544 -132
  100. exonware/xwnode/nodes/strategies/queue.py +249 -120
  101. exonware/xwnode/nodes/strategies/{node_red_black_tree.py → red_black_tree.py} +183 -72
  102. exonware/xwnode/nodes/strategies/{node_roaring_bitmap.py → roaring_bitmap.py} +19 -6
  103. exonware/xwnode/nodes/strategies/rope.py +717 -0
  104. exonware/xwnode/nodes/strategies/{node_segment_tree.py → segment_tree.py} +106 -106
  105. exonware/xwnode/nodes/strategies/{node_set_hash.py → set_hash.py} +30 -29
  106. exonware/xwnode/nodes/strategies/{node_skip_list.py → skip_list.py} +74 -6
  107. exonware/xwnode/nodes/strategies/sparse_matrix.py +427 -131
  108. exonware/xwnode/nodes/strategies/{node_splay_tree.py → splay_tree.py} +55 -6
  109. exonware/xwnode/nodes/strategies/stack.py +244 -112
  110. exonware/xwnode/nodes/strategies/{node_suffix_array.py → suffix_array.py} +5 -1
  111. exonware/xwnode/nodes/strategies/t_tree.py +94 -0
  112. exonware/xwnode/nodes/strategies/{node_treap.py → treap.py} +75 -6
  113. exonware/xwnode/nodes/strategies/{node_tree_graph_hybrid.py → tree_graph_hybrid.py} +46 -5
  114. exonware/xwnode/nodes/strategies/trie.py +153 -9
  115. exonware/xwnode/nodes/strategies/union_find.py +111 -5
  116. exonware/xwnode/nodes/strategies/veb_tree.py +856 -0
  117. exonware/xwnode/strategies/__init__.py +5 -51
  118. exonware/xwnode/version.py +3 -3
  119. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/METADATA +23 -3
  120. exonware_xwnode-0.0.1.23.dist-info/RECORD +130 -0
  121. exonware/xwnode/edges/strategies/edge_adj_list.py +0 -353
  122. exonware/xwnode/edges/strategies/edge_adj_matrix.py +0 -445
  123. exonware/xwnode/nodes/strategies/_base_node.py +0 -307
  124. exonware/xwnode/nodes/strategies/node_aho_corasick.py +0 -525
  125. exonware/xwnode/nodes/strategies/node_array_list.py +0 -179
  126. exonware/xwnode/nodes/strategies/node_hash_map.py +0 -273
  127. exonware/xwnode/nodes/strategies/node_heap.py +0 -196
  128. exonware/xwnode/nodes/strategies/node_linked_list.py +0 -413
  129. exonware/xwnode/nodes/strategies/node_trie.py +0 -257
  130. exonware/xwnode/nodes/strategies/node_union_find.py +0 -192
  131. exonware/xwnode/queries/executors/__init__.py +0 -47
  132. exonware/xwnode/queries/executors/advanced/__init__.py +0 -37
  133. exonware/xwnode/queries/executors/advanced/aggregate_executor.py +0 -50
  134. exonware/xwnode/queries/executors/advanced/ask_executor.py +0 -50
  135. exonware/xwnode/queries/executors/advanced/construct_executor.py +0 -50
  136. exonware/xwnode/queries/executors/advanced/describe_executor.py +0 -50
  137. exonware/xwnode/queries/executors/advanced/for_loop_executor.py +0 -50
  138. exonware/xwnode/queries/executors/advanced/foreach_executor.py +0 -50
  139. exonware/xwnode/queries/executors/advanced/join_executor.py +0 -50
  140. exonware/xwnode/queries/executors/advanced/let_executor.py +0 -50
  141. exonware/xwnode/queries/executors/advanced/mutation_executor.py +0 -50
  142. exonware/xwnode/queries/executors/advanced/options_executor.py +0 -50
  143. exonware/xwnode/queries/executors/advanced/pipe_executor.py +0 -50
  144. exonware/xwnode/queries/executors/advanced/subscribe_executor.py +0 -50
  145. exonware/xwnode/queries/executors/advanced/subscription_executor.py +0 -50
  146. exonware/xwnode/queries/executors/advanced/union_executor.py +0 -50
  147. exonware/xwnode/queries/executors/advanced/window_executor.py +0 -51
  148. exonware/xwnode/queries/executors/advanced/with_cte_executor.py +0 -50
  149. exonware/xwnode/queries/executors/aggregation/__init__.py +0 -21
  150. exonware/xwnode/queries/executors/aggregation/avg_executor.py +0 -50
  151. exonware/xwnode/queries/executors/aggregation/count_executor.py +0 -38
  152. exonware/xwnode/queries/executors/aggregation/distinct_executor.py +0 -50
  153. exonware/xwnode/queries/executors/aggregation/group_executor.py +0 -50
  154. exonware/xwnode/queries/executors/aggregation/having_executor.py +0 -50
  155. exonware/xwnode/queries/executors/aggregation/max_executor.py +0 -50
  156. exonware/xwnode/queries/executors/aggregation/min_executor.py +0 -50
  157. exonware/xwnode/queries/executors/aggregation/sum_executor.py +0 -50
  158. exonware/xwnode/queries/executors/aggregation/summarize_executor.py +0 -50
  159. exonware/xwnode/queries/executors/array/__init__.py +0 -9
  160. exonware/xwnode/queries/executors/array/indexing_executor.py +0 -51
  161. exonware/xwnode/queries/executors/array/slicing_executor.py +0 -51
  162. exonware/xwnode/queries/executors/base.py +0 -257
  163. exonware/xwnode/queries/executors/capability_checker.py +0 -204
  164. exonware/xwnode/queries/executors/contracts.py +0 -166
  165. exonware/xwnode/queries/executors/core/__init__.py +0 -17
  166. exonware/xwnode/queries/executors/core/create_executor.py +0 -96
  167. exonware/xwnode/queries/executors/core/delete_executor.py +0 -99
  168. exonware/xwnode/queries/executors/core/drop_executor.py +0 -100
  169. exonware/xwnode/queries/executors/core/insert_executor.py +0 -39
  170. exonware/xwnode/queries/executors/core/select_executor.py +0 -152
  171. exonware/xwnode/queries/executors/core/update_executor.py +0 -102
  172. exonware/xwnode/queries/executors/data/__init__.py +0 -13
  173. exonware/xwnode/queries/executors/data/alter_executor.py +0 -50
  174. exonware/xwnode/queries/executors/data/load_executor.py +0 -50
  175. exonware/xwnode/queries/executors/data/merge_executor.py +0 -50
  176. exonware/xwnode/queries/executors/data/store_executor.py +0 -50
  177. exonware/xwnode/queries/executors/defs.py +0 -93
  178. exonware/xwnode/queries/executors/engine.py +0 -221
  179. exonware/xwnode/queries/executors/errors.py +0 -68
  180. exonware/xwnode/queries/executors/filtering/__init__.py +0 -25
  181. exonware/xwnode/queries/executors/filtering/between_executor.py +0 -80
  182. exonware/xwnode/queries/executors/filtering/filter_executor.py +0 -79
  183. exonware/xwnode/queries/executors/filtering/has_executor.py +0 -70
  184. exonware/xwnode/queries/executors/filtering/in_executor.py +0 -70
  185. exonware/xwnode/queries/executors/filtering/like_executor.py +0 -76
  186. exonware/xwnode/queries/executors/filtering/optional_executor.py +0 -76
  187. exonware/xwnode/queries/executors/filtering/range_executor.py +0 -80
  188. exonware/xwnode/queries/executors/filtering/term_executor.py +0 -77
  189. exonware/xwnode/queries/executors/filtering/values_executor.py +0 -71
  190. exonware/xwnode/queries/executors/filtering/where_executor.py +0 -44
  191. exonware/xwnode/queries/executors/graph/__init__.py +0 -15
  192. exonware/xwnode/queries/executors/graph/in_traverse_executor.py +0 -51
  193. exonware/xwnode/queries/executors/graph/match_executor.py +0 -51
  194. exonware/xwnode/queries/executors/graph/out_executor.py +0 -51
  195. exonware/xwnode/queries/executors/graph/path_executor.py +0 -51
  196. exonware/xwnode/queries/executors/graph/return_executor.py +0 -51
  197. exonware/xwnode/queries/executors/ordering/__init__.py +0 -9
  198. exonware/xwnode/queries/executors/ordering/by_executor.py +0 -50
  199. exonware/xwnode/queries/executors/ordering/order_executor.py +0 -51
  200. exonware/xwnode/queries/executors/projection/__init__.py +0 -9
  201. exonware/xwnode/queries/executors/projection/extend_executor.py +0 -50
  202. exonware/xwnode/queries/executors/projection/project_executor.py +0 -50
  203. exonware/xwnode/queries/executors/registry.py +0 -173
  204. exonware/xwnode/queries/parsers/__init__.py +0 -26
  205. exonware/xwnode/queries/parsers/base.py +0 -86
  206. exonware/xwnode/queries/parsers/contracts.py +0 -46
  207. exonware/xwnode/queries/parsers/errors.py +0 -53
  208. exonware/xwnode/queries/parsers/sql_param_extractor.py +0 -318
  209. exonware/xwnode/queries/strategies/__init__.py +0 -24
  210. exonware/xwnode/queries/strategies/base.py +0 -236
  211. exonware/xwnode/queries/strategies/cql.py +0 -201
  212. exonware/xwnode/queries/strategies/cypher.py +0 -181
  213. exonware/xwnode/queries/strategies/datalog.py +0 -70
  214. exonware/xwnode/queries/strategies/elastic_dsl.py +0 -70
  215. exonware/xwnode/queries/strategies/eql.py +0 -70
  216. exonware/xwnode/queries/strategies/flux.py +0 -70
  217. exonware/xwnode/queries/strategies/gql.py +0 -70
  218. exonware/xwnode/queries/strategies/graphql.py +0 -240
  219. exonware/xwnode/queries/strategies/gremlin.py +0 -181
  220. exonware/xwnode/queries/strategies/hiveql.py +0 -214
  221. exonware/xwnode/queries/strategies/hql.py +0 -70
  222. exonware/xwnode/queries/strategies/jmespath.py +0 -219
  223. exonware/xwnode/queries/strategies/jq.py +0 -66
  224. exonware/xwnode/queries/strategies/json_query.py +0 -66
  225. exonware/xwnode/queries/strategies/jsoniq.py +0 -248
  226. exonware/xwnode/queries/strategies/kql.py +0 -70
  227. exonware/xwnode/queries/strategies/linq.py +0 -238
  228. exonware/xwnode/queries/strategies/logql.py +0 -70
  229. exonware/xwnode/queries/strategies/mql.py +0 -68
  230. exonware/xwnode/queries/strategies/n1ql.py +0 -210
  231. exonware/xwnode/queries/strategies/partiql.py +0 -70
  232. exonware/xwnode/queries/strategies/pig.py +0 -215
  233. exonware/xwnode/queries/strategies/promql.py +0 -70
  234. exonware/xwnode/queries/strategies/sparql.py +0 -220
  235. exonware/xwnode/queries/strategies/sql.py +0 -275
  236. exonware/xwnode/queries/strategies/xml_query.py +0 -66
  237. exonware/xwnode/queries/strategies/xpath.py +0 -223
  238. exonware/xwnode/queries/strategies/xquery.py +0 -258
  239. exonware/xwnode/queries/strategies/xwnode_executor.py +0 -332
  240. exonware/xwnode/queries/strategies/xwquery.py +0 -456
  241. exonware_xwnode-0.0.1.22.dist-info/RECORD +0 -214
  242. /exonware/xwnode/nodes/strategies/{node_ordered_map.py → ordered_map.py} +0 -0
  243. /exonware/xwnode/nodes/strategies/{node_ordered_map_balanced.py → ordered_map_balanced.py} +0 -0
  244. /exonware/xwnode/nodes/strategies/{node_patricia.py → patricia.py} +0 -0
  245. /exonware/xwnode/nodes/strategies/{node_radix_trie.py → radix_trie.py} +0 -0
  246. /exonware/xwnode/nodes/strategies/{node_set_tree.py → set_tree.py} +0 -0
  247. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/WHEEL +0 -0
  248. {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.23.dist-info}/licenses/LICENSE +0 -0
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/ordering/order_executor.py
4
-
5
- ORDER Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.22
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from typing import Any, Dict, List
15
- from ..base import AOperationExecutor
16
- from ..contracts import Action, ExecutionContext, ExecutionResult
17
- from ..defs import OperationType
18
- from ...nodes.strategies.contracts import NodeType
19
-
20
- class OrderExecutor(AOperationExecutor):
21
- """
22
- ORDER operation executor.
23
-
24
- Orders/sorts data
25
-
26
- Capability: TREE, LINEAR only
27
- Operation Type: ORDERING
28
- """
29
-
30
- OPERATION_NAME = "ORDER"
31
- OPERATION_TYPE = OperationType.ORDERING
32
- SUPPORTED_NODE_TYPES = [NodeType.TREE, NodeType.LINEAR]
33
-
34
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
35
- """Execute ORDER operation."""
36
- params = action.params
37
- node = context.node
38
-
39
- result_data = self._execute_order(node, params, context)
40
-
41
- return ExecutionResult(
42
- success=True,
43
- data=result_data,
44
- operation=self.OPERATION_NAME,
45
- metadata={'operation': self.OPERATION_NAME}
46
- )
47
-
48
- def _execute_order(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
49
- """Execute order logic."""
50
- # Implementation here
51
- return {'result': 'ORDER executed', 'params': params}
@@ -1,9 +0,0 @@
1
- """Projection operation executors."""
2
-
3
- from .project_executor import ProjectExecutor
4
- from .extend_executor import ExtendExecutor
5
-
6
- __all__ = [
7
- 'ProjectExecutor',
8
- 'ExtendExecutor',
9
- ]
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/projection/extend_executor.py
4
-
5
- EXTEND Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.22
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 ExtendExecutor(AUniversalOperationExecutor):
20
- """
21
- EXTEND operation executor.
22
-
23
- Extends data with computed fields
24
-
25
- Capability: Universal
26
- Operation Type: PROJECTION
27
- """
28
-
29
- OPERATION_NAME = "EXTEND"
30
- OPERATION_TYPE = OperationType.PROJECTION
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute EXTEND operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_extend(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_extend(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute extend logic."""
49
- # Implementation here
50
- return {'result': 'EXTEND executed', 'params': params}
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/projection/project_executor.py
4
-
5
- PROJECT Executor
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.22
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 ProjectExecutor(AUniversalOperationExecutor):
20
- """
21
- PROJECT operation executor.
22
-
23
- Projects/selects specific fields
24
-
25
- Capability: Universal
26
- Operation Type: PROJECTION
27
- """
28
-
29
- OPERATION_NAME = "PROJECT"
30
- OPERATION_TYPE = OperationType.PROJECTION
31
- SUPPORTED_NODE_TYPES = [] # Universal
32
-
33
- def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
34
- """Execute PROJECT operation."""
35
- params = action.params
36
- node = context.node
37
-
38
- result_data = self._execute_project(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_project(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
48
- """Execute project logic."""
49
- # Implementation here
50
- return {'result': 'PROJECT executed', 'params': params}
@@ -1,173 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/executors/registry.py
4
-
5
- Operation Executor Registry
6
-
7
- This module provides registry for managing operation executors.
8
-
9
- Company: eXonware.com
10
- Author: Eng. Muhammad AlShehri
11
- Email: connect@exonware.com
12
- Version: 0.0.1.22
13
- Generation Date: 08-Oct-2025
14
- """
15
-
16
- import threading
17
- from typing import Dict, Type, Optional, List
18
-
19
- from .contracts import IOperationExecutor, NodeType
20
- from ...errors import XWNodeValueError
21
-
22
-
23
- class OperationRegistry:
24
- """
25
- Registry for operation executors.
26
-
27
- Manages registration and retrieval of executors for the 50 XWQuery operations.
28
- Thread-safe implementation with singleton pattern.
29
- """
30
-
31
- _instance = None
32
- _lock = threading.Lock()
33
-
34
- def __new__(cls):
35
- """Ensure singleton instance."""
36
- if cls._instance is None:
37
- with cls._lock:
38
- if cls._instance is None:
39
- cls._instance = super().__new__(cls)
40
- cls._instance._initialized = False
41
- return cls._instance
42
-
43
- def __init__(self):
44
- """Initialize the registry."""
45
- if self._initialized:
46
- return
47
-
48
- self._executors: Dict[str, Type[IOperationExecutor]] = {}
49
- self._instances: Dict[str, IOperationExecutor] = {}
50
- self._lock = threading.RLock()
51
- self._initialized = True
52
-
53
- def register(self, operation_name: str, executor_class: Type[IOperationExecutor]) -> None:
54
- """
55
- Register an executor for an operation.
56
-
57
- Args:
58
- operation_name: Name of operation (e.g., "SELECT")
59
- executor_class: Executor class
60
- """
61
- with self._lock:
62
- self._executors[operation_name.upper()] = executor_class
63
-
64
- def get(self, operation_name: str) -> Optional[IOperationExecutor]:
65
- """
66
- Get executor instance for an operation.
67
-
68
- Args:
69
- operation_name: Name of operation
70
-
71
- Returns:
72
- Executor instance or None if not found
73
- """
74
- operation_name = operation_name.upper()
75
-
76
- with self._lock:
77
- # Return cached instance if exists
78
- if operation_name in self._instances:
79
- return self._instances[operation_name]
80
-
81
- # Create new instance
82
- if operation_name in self._executors:
83
- executor_class = self._executors[operation_name]
84
- instance = executor_class()
85
- self._instances[operation_name] = instance
86
- return instance
87
-
88
- return None
89
-
90
- def has(self, operation_name: str) -> bool:
91
- """
92
- Check if operation is registered.
93
-
94
- Args:
95
- operation_name: Name of operation
96
-
97
- Returns:
98
- True if operation is registered
99
- """
100
- return operation_name.upper() in self._executors
101
-
102
- def list_operations(self) -> List[str]:
103
- """Get list of all registered operations."""
104
- with self._lock:
105
- return list(self._executors.keys())
106
-
107
- def list_operations_for_node_type(self, node_type: NodeType) -> List[str]:
108
- """
109
- Get list of operations supported by a node type.
110
-
111
- Args:
112
- node_type: Node type to check
113
-
114
- Returns:
115
- List of operation names
116
- """
117
- operations = []
118
-
119
- with self._lock:
120
- for op_name, executor_class in self._executors.items():
121
- # Instantiate temporarily to check
122
- executor = executor_class()
123
- if executor.can_execute_on(node_type):
124
- operations.append(op_name)
125
-
126
- return operations
127
-
128
- def clear(self) -> None:
129
- """Clear all registrations (for testing)."""
130
- with self._lock:
131
- self._executors.clear()
132
- self._instances.clear()
133
-
134
-
135
- # Global registry instance
136
- _global_registry: Optional[OperationRegistry] = None
137
- _global_lock = threading.Lock()
138
-
139
-
140
- def get_operation_registry() -> OperationRegistry:
141
- """Get the global operation registry instance."""
142
- global _global_registry
143
-
144
- if _global_registry is None:
145
- with _global_lock:
146
- if _global_registry is None:
147
- _global_registry = OperationRegistry()
148
-
149
- return _global_registry
150
-
151
-
152
- def register_operation(operation_name: str):
153
- """
154
- Decorator to register an operation executor.
155
-
156
- Usage:
157
- @register_operation("CUSTOM_OP")
158
- class CustomOperationExecutor(AOperationExecutor):
159
- ...
160
- """
161
- def decorator(executor_class: Type[IOperationExecutor]):
162
- registry = get_operation_registry()
163
- registry.register(operation_name, executor_class)
164
- return executor_class
165
- return decorator
166
-
167
-
168
- __all__ = [
169
- 'OperationRegistry',
170
- 'get_operation_registry',
171
- 'register_operation',
172
- 'UnsupportedOperationError',
173
- ]
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/parsers/__init__.py
4
-
5
- Query Parsers Module
6
-
7
- Company: eXonware.com
8
- Author: Eng. Muhammad AlShehri
9
- Email: connect@exonware.com
10
- Version: 0.0.1.22
11
- Generation Date: 09-Oct-2025
12
- """
13
-
14
- from .contracts import IParamExtractor
15
- from .errors import ParserError, ParseError
16
- from .base import AParamExtractor
17
- from .sql_param_extractor import SQLParamExtractor
18
-
19
- __all__ = [
20
- 'IParamExtractor',
21
- 'ParserError',
22
- 'ParseError',
23
- 'AParamExtractor',
24
- 'SQLParamExtractor',
25
- ]
26
-
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/parsers/base.py
4
-
5
- Parser Base Classes
6
-
7
- Abstract base class for parameter extractors.
8
- Follows DEV_GUIDELINES.md: base.py extends contracts.py interfaces.
9
-
10
- Company: eXonware.com
11
- Author: Eng. Muhammad AlShehri
12
- Email: connect@exonware.com
13
- Version: 0.0.1.22
14
- Generation Date: 09-Oct-2025
15
- """
16
-
17
- from abc import ABC
18
- from typing import Dict, Any, Union
19
-
20
- from .contracts import IParamExtractor
21
- from .errors import ParseError
22
-
23
-
24
- class AParamExtractor(IParamExtractor, ABC):
25
- """
26
- Abstract base class for parameter extractors.
27
-
28
- Extends IParamExtractor interface per DEV_GUIDELINES.md.
29
- """
30
-
31
- def _parse_value(self, value_str: str) -> Union[str, int, float, bool, None]:
32
- """
33
- Parse value from string to appropriate type.
34
-
35
- Args:
36
- value_str: String representation of value
37
-
38
- Returns:
39
- Parsed value with correct type
40
- """
41
- value_str = value_str.strip().strip('"').strip("'")
42
-
43
- # Try boolean
44
- if value_str.lower() == 'true':
45
- return True
46
- if value_str.lower() == 'false':
47
- return False
48
- if value_str.lower() == 'null' or value_str.lower() == 'none':
49
- return None
50
-
51
- # Try number
52
- try:
53
- if '.' in value_str:
54
- return float(value_str)
55
- return int(value_str)
56
- except ValueError:
57
- pass
58
-
59
- # Return as string
60
- return value_str
61
-
62
- def _split_fields(self, fields_str: str) -> list:
63
- """Split comma-separated fields, handling nested expressions."""
64
- if fields_str.strip() == '*':
65
- return ['*']
66
-
67
- fields = []
68
- current = []
69
- paren_depth = 0
70
-
71
- for char in fields_str:
72
- if char == '(':
73
- paren_depth += 1
74
- elif char == ')':
75
- paren_depth -= 1
76
- elif char == ',' and paren_depth == 0:
77
- fields.append(''.join(current).strip())
78
- current = []
79
- continue
80
- current.append(char)
81
-
82
- if current:
83
- fields.append(''.join(current).strip())
84
-
85
- return fields
86
-
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/parsers/contracts.py
4
-
5
- Parser Contracts
6
-
7
- Interfaces for query parameter extractors.
8
- Follows DEV_GUIDELINES.md: contracts.py for all interfaces.
9
-
10
- Company: eXonware.com
11
- Author: Eng. Muhammad AlShehri
12
- Email: connect@exonware.com
13
- Version: 0.0.1.22
14
- Generation Date: 09-Oct-2025
15
- """
16
-
17
- from abc import ABC, abstractmethod
18
- from typing import Dict, Any
19
-
20
-
21
- class IParamExtractor(ABC):
22
- """
23
- Interface for parameter extractors.
24
-
25
- Extracts structured parameters from query strings.
26
- """
27
-
28
- @abstractmethod
29
- def extract_params(self, query: str, action_type: str) -> Dict[str, Any]:
30
- """
31
- Extract structured parameters from query.
32
-
33
- Args:
34
- query: Raw query string
35
- action_type: Type of action (SELECT, INSERT, etc.)
36
-
37
- Returns:
38
- Structured parameters dictionary
39
- """
40
- pass
41
-
42
- @abstractmethod
43
- def can_parse(self, query: str) -> bool:
44
- """Check if this extractor can parse the query."""
45
- pass
46
-
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- #exonware/xwnode/src/exonware/xwnode/queries/parsers/errors.py
4
-
5
- Parser Errors
6
-
7
- Module-specific errors for query parsers.
8
- Extends root error classes per DEV_GUIDELINES.md - no redundancy.
9
-
10
- Company: eXonware.com
11
- Author: Eng. Muhammad AlShehri
12
- Email: connect@exonware.com
13
- Version: 0.0.1.22
14
- Generation Date: 09-Oct-2025
15
- """
16
-
17
- # Import and REUSE root error classes per DEV_GUIDELINES
18
- from ...errors import XWNodeError, XWNodeValueError
19
-
20
-
21
- class ParserError(XWNodeError):
22
- """
23
- Base error for parser operations.
24
-
25
- Extends XWNodeError from root - follows DEV_GUIDELINES principle.
26
- """
27
- pass
28
-
29
-
30
- class ParseError(ParserError):
31
- """Raised when query parsing fails."""
32
-
33
- def __init__(self, query: str, reason: str, position: int = None):
34
- message = f"Failed to parse query: {reason}"
35
- if position is not None:
36
- message += f" at position {position}"
37
- super().__init__(message)
38
- self.query = query
39
- self.reason = reason
40
- self.position = position
41
-
42
-
43
- class UnsupportedSyntaxError(ParserError):
44
- """Raised when syntax is not supported."""
45
- pass
46
-
47
-
48
- __all__ = [
49
- 'ParserError',
50
- 'ParseError',
51
- 'UnsupportedSyntaxError',
52
- ]
53
-