exonware-xwnode 0.0.1.22__py3-none-any.whl → 0.0.1.24__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.
- exonware/__init__.py +1 -1
- exonware/xwnode/__init__.py +18 -5
- exonware/xwnode/add_strategy_types.py +165 -0
- exonware/xwnode/common/__init__.py +1 -1
- exonware/xwnode/common/graph/__init__.py +30 -0
- exonware/xwnode/common/graph/caching.py +131 -0
- exonware/xwnode/common/graph/contracts.py +100 -0
- exonware/xwnode/common/graph/errors.py +44 -0
- exonware/xwnode/common/graph/indexing.py +260 -0
- exonware/xwnode/common/graph/manager.py +568 -0
- exonware/xwnode/common/management/__init__.py +3 -5
- exonware/xwnode/common/management/manager.py +2 -2
- exonware/xwnode/common/management/migration.py +3 -3
- exonware/xwnode/common/monitoring/__init__.py +3 -5
- exonware/xwnode/common/monitoring/metrics.py +6 -2
- exonware/xwnode/common/monitoring/pattern_detector.py +1 -1
- exonware/xwnode/common/monitoring/performance_monitor.py +5 -1
- exonware/xwnode/common/patterns/__init__.py +3 -5
- exonware/xwnode/common/patterns/flyweight.py +5 -1
- exonware/xwnode/common/patterns/registry.py +202 -183
- exonware/xwnode/common/utils/__init__.py +25 -11
- exonware/xwnode/common/utils/simple.py +1 -1
- exonware/xwnode/config.py +3 -8
- exonware/xwnode/contracts.py +4 -105
- exonware/xwnode/defs.py +413 -159
- exonware/xwnode/edges/strategies/__init__.py +86 -4
- exonware/xwnode/edges/strategies/_base_edge.py +2 -2
- exonware/xwnode/edges/strategies/adj_list.py +287 -121
- exonware/xwnode/edges/strategies/adj_matrix.py +316 -222
- exonware/xwnode/edges/strategies/base.py +1 -1
- exonware/xwnode/edges/strategies/{edge_bidir_wrapper.py → bidir_wrapper.py} +45 -4
- exonware/xwnode/edges/strategies/bitemporal.py +520 -0
- exonware/xwnode/edges/strategies/{edge_block_adj_matrix.py → block_adj_matrix.py} +77 -6
- exonware/xwnode/edges/strategies/bv_graph.py +664 -0
- exonware/xwnode/edges/strategies/compressed_graph.py +217 -0
- exonware/xwnode/edges/strategies/{edge_coo.py → coo.py} +46 -4
- exonware/xwnode/edges/strategies/{edge_csc.py → csc.py} +45 -4
- exonware/xwnode/edges/strategies/{edge_csr.py → csr.py} +94 -12
- exonware/xwnode/edges/strategies/{edge_dynamic_adj_list.py → dynamic_adj_list.py} +46 -4
- exonware/xwnode/edges/strategies/edge_list.py +168 -0
- exonware/xwnode/edges/strategies/edge_property_store.py +2 -2
- exonware/xwnode/edges/strategies/euler_tour.py +560 -0
- exonware/xwnode/edges/strategies/{edge_flow_network.py → flow_network.py} +2 -2
- exonware/xwnode/edges/strategies/graphblas.py +449 -0
- exonware/xwnode/edges/strategies/hnsw.py +637 -0
- exonware/xwnode/edges/strategies/hop2_labels.py +467 -0
- exonware/xwnode/edges/strategies/{edge_hyperedge_set.py → hyperedge_set.py} +2 -2
- exonware/xwnode/edges/strategies/incidence_matrix.py +250 -0
- exonware/xwnode/edges/strategies/k2_tree.py +613 -0
- exonware/xwnode/edges/strategies/link_cut.py +626 -0
- exonware/xwnode/edges/strategies/multiplex.py +532 -0
- exonware/xwnode/edges/strategies/{edge_neural_graph.py → neural_graph.py} +2 -2
- exonware/xwnode/edges/strategies/{edge_octree.py → octree.py} +69 -11
- exonware/xwnode/edges/strategies/{edge_quadtree.py → quadtree.py} +66 -10
- exonware/xwnode/edges/strategies/roaring_adj.py +438 -0
- exonware/xwnode/edges/strategies/{edge_rtree.py → rtree.py} +43 -5
- exonware/xwnode/edges/strategies/{edge_temporal_edgeset.py → temporal_edgeset.py} +24 -5
- exonware/xwnode/edges/strategies/{edge_tree_graph_basic.py → tree_graph_basic.py} +78 -7
- exonware/xwnode/edges/strategies/{edge_weighted_graph.py → weighted_graph.py} +188 -10
- exonware/xwnode/errors.py +3 -6
- exonware/xwnode/facade.py +20 -20
- exonware/xwnode/nodes/strategies/__init__.py +29 -9
- exonware/xwnode/nodes/strategies/adjacency_list.py +650 -177
- exonware/xwnode/nodes/strategies/aho_corasick.py +358 -183
- exonware/xwnode/nodes/strategies/array_list.py +36 -3
- exonware/xwnode/nodes/strategies/art.py +581 -0
- exonware/xwnode/nodes/strategies/{node_avl_tree.py → avl_tree.py} +77 -6
- exonware/xwnode/nodes/strategies/{node_b_plus_tree.py → b_plus_tree.py} +81 -40
- exonware/xwnode/nodes/strategies/{node_btree.py → b_tree.py} +79 -9
- exonware/xwnode/nodes/strategies/base.py +469 -98
- exonware/xwnode/nodes/strategies/{node_bitmap.py → bitmap.py} +12 -12
- exonware/xwnode/nodes/strategies/{node_bitset_dynamic.py → bitset_dynamic.py} +11 -11
- exonware/xwnode/nodes/strategies/{node_bloom_filter.py → bloom_filter.py} +15 -2
- exonware/xwnode/nodes/strategies/bloomier_filter.py +519 -0
- exonware/xwnode/nodes/strategies/bw_tree.py +531 -0
- exonware/xwnode/nodes/strategies/contracts.py +1 -1
- exonware/xwnode/nodes/strategies/{node_count_min_sketch.py → count_min_sketch.py} +3 -2
- exonware/xwnode/nodes/strategies/{node_cow_tree.py → cow_tree.py} +135 -13
- exonware/xwnode/nodes/strategies/crdt_map.py +629 -0
- exonware/xwnode/nodes/strategies/{node_cuckoo_hash.py → cuckoo_hash.py} +2 -2
- exonware/xwnode/nodes/strategies/{node_xdata_optimized.py → data_interchange_optimized.py} +21 -4
- exonware/xwnode/nodes/strategies/dawg.py +876 -0
- exonware/xwnode/nodes/strategies/deque.py +321 -153
- exonware/xwnode/nodes/strategies/extendible_hash.py +93 -0
- exonware/xwnode/nodes/strategies/{node_fenwick_tree.py → fenwick_tree.py} +111 -19
- exonware/xwnode/nodes/strategies/hamt.py +403 -0
- exonware/xwnode/nodes/strategies/hash_map.py +354 -67
- exonware/xwnode/nodes/strategies/heap.py +105 -5
- exonware/xwnode/nodes/strategies/hopscotch_hash.py +525 -0
- exonware/xwnode/nodes/strategies/{node_hyperloglog.py → hyperloglog.py} +6 -5
- exonware/xwnode/nodes/strategies/interval_tree.py +742 -0
- exonware/xwnode/nodes/strategies/kd_tree.py +703 -0
- exonware/xwnode/nodes/strategies/learned_index.py +533 -0
- exonware/xwnode/nodes/strategies/linear_hash.py +93 -0
- exonware/xwnode/nodes/strategies/linked_list.py +316 -119
- exonware/xwnode/nodes/strategies/{node_lsm_tree.py → lsm_tree.py} +219 -15
- exonware/xwnode/nodes/strategies/masstree.py +130 -0
- exonware/xwnode/nodes/strategies/{node_persistent_tree.py → persistent_tree.py} +149 -9
- exonware/xwnode/nodes/strategies/priority_queue.py +544 -132
- exonware/xwnode/nodes/strategies/queue.py +249 -120
- exonware/xwnode/nodes/strategies/{node_red_black_tree.py → red_black_tree.py} +183 -72
- exonware/xwnode/nodes/strategies/{node_roaring_bitmap.py → roaring_bitmap.py} +19 -6
- exonware/xwnode/nodes/strategies/rope.py +717 -0
- exonware/xwnode/nodes/strategies/{node_segment_tree.py → segment_tree.py} +106 -106
- exonware/xwnode/nodes/strategies/{node_set_hash.py → set_hash.py} +30 -29
- exonware/xwnode/nodes/strategies/{node_skip_list.py → skip_list.py} +74 -6
- exonware/xwnode/nodes/strategies/sparse_matrix.py +427 -131
- exonware/xwnode/nodes/strategies/{node_splay_tree.py → splay_tree.py} +55 -6
- exonware/xwnode/nodes/strategies/stack.py +244 -112
- exonware/xwnode/nodes/strategies/{node_suffix_array.py → suffix_array.py} +5 -1
- exonware/xwnode/nodes/strategies/t_tree.py +94 -0
- exonware/xwnode/nodes/strategies/{node_treap.py → treap.py} +75 -6
- exonware/xwnode/nodes/strategies/{node_tree_graph_hybrid.py → tree_graph_hybrid.py} +46 -5
- exonware/xwnode/nodes/strategies/trie.py +153 -9
- exonware/xwnode/nodes/strategies/union_find.py +111 -5
- exonware/xwnode/nodes/strategies/veb_tree.py +856 -0
- exonware/xwnode/strategies/__init__.py +5 -51
- exonware/xwnode/version.py +3 -3
- exonware_xwnode-0.0.1.24.dist-info/METADATA +900 -0
- exonware_xwnode-0.0.1.24.dist-info/RECORD +130 -0
- exonware/xwnode/edges/strategies/edge_adj_list.py +0 -353
- exonware/xwnode/edges/strategies/edge_adj_matrix.py +0 -445
- exonware/xwnode/nodes/strategies/_base_node.py +0 -307
- exonware/xwnode/nodes/strategies/node_aho_corasick.py +0 -525
- exonware/xwnode/nodes/strategies/node_array_list.py +0 -179
- exonware/xwnode/nodes/strategies/node_hash_map.py +0 -273
- exonware/xwnode/nodes/strategies/node_heap.py +0 -196
- exonware/xwnode/nodes/strategies/node_linked_list.py +0 -413
- exonware/xwnode/nodes/strategies/node_trie.py +0 -257
- exonware/xwnode/nodes/strategies/node_union_find.py +0 -192
- exonware/xwnode/queries/executors/__init__.py +0 -47
- exonware/xwnode/queries/executors/advanced/__init__.py +0 -37
- exonware/xwnode/queries/executors/advanced/aggregate_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/ask_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/construct_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/describe_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/for_loop_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/foreach_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/join_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/let_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/mutation_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/options_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/pipe_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/subscribe_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/subscription_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/union_executor.py +0 -50
- exonware/xwnode/queries/executors/advanced/window_executor.py +0 -51
- exonware/xwnode/queries/executors/advanced/with_cte_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/__init__.py +0 -21
- exonware/xwnode/queries/executors/aggregation/avg_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/count_executor.py +0 -38
- exonware/xwnode/queries/executors/aggregation/distinct_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/group_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/having_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/max_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/min_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/sum_executor.py +0 -50
- exonware/xwnode/queries/executors/aggregation/summarize_executor.py +0 -50
- exonware/xwnode/queries/executors/array/__init__.py +0 -9
- exonware/xwnode/queries/executors/array/indexing_executor.py +0 -51
- exonware/xwnode/queries/executors/array/slicing_executor.py +0 -51
- exonware/xwnode/queries/executors/base.py +0 -257
- exonware/xwnode/queries/executors/capability_checker.py +0 -204
- exonware/xwnode/queries/executors/contracts.py +0 -166
- exonware/xwnode/queries/executors/core/__init__.py +0 -17
- exonware/xwnode/queries/executors/core/create_executor.py +0 -96
- exonware/xwnode/queries/executors/core/delete_executor.py +0 -99
- exonware/xwnode/queries/executors/core/drop_executor.py +0 -100
- exonware/xwnode/queries/executors/core/insert_executor.py +0 -39
- exonware/xwnode/queries/executors/core/select_executor.py +0 -152
- exonware/xwnode/queries/executors/core/update_executor.py +0 -102
- exonware/xwnode/queries/executors/data/__init__.py +0 -13
- exonware/xwnode/queries/executors/data/alter_executor.py +0 -50
- exonware/xwnode/queries/executors/data/load_executor.py +0 -50
- exonware/xwnode/queries/executors/data/merge_executor.py +0 -50
- exonware/xwnode/queries/executors/data/store_executor.py +0 -50
- exonware/xwnode/queries/executors/defs.py +0 -93
- exonware/xwnode/queries/executors/engine.py +0 -221
- exonware/xwnode/queries/executors/errors.py +0 -68
- exonware/xwnode/queries/executors/filtering/__init__.py +0 -25
- exonware/xwnode/queries/executors/filtering/between_executor.py +0 -80
- exonware/xwnode/queries/executors/filtering/filter_executor.py +0 -79
- exonware/xwnode/queries/executors/filtering/has_executor.py +0 -70
- exonware/xwnode/queries/executors/filtering/in_executor.py +0 -70
- exonware/xwnode/queries/executors/filtering/like_executor.py +0 -76
- exonware/xwnode/queries/executors/filtering/optional_executor.py +0 -76
- exonware/xwnode/queries/executors/filtering/range_executor.py +0 -80
- exonware/xwnode/queries/executors/filtering/term_executor.py +0 -77
- exonware/xwnode/queries/executors/filtering/values_executor.py +0 -71
- exonware/xwnode/queries/executors/filtering/where_executor.py +0 -44
- exonware/xwnode/queries/executors/graph/__init__.py +0 -15
- exonware/xwnode/queries/executors/graph/in_traverse_executor.py +0 -51
- exonware/xwnode/queries/executors/graph/match_executor.py +0 -51
- exonware/xwnode/queries/executors/graph/out_executor.py +0 -51
- exonware/xwnode/queries/executors/graph/path_executor.py +0 -51
- exonware/xwnode/queries/executors/graph/return_executor.py +0 -51
- exonware/xwnode/queries/executors/ordering/__init__.py +0 -9
- exonware/xwnode/queries/executors/ordering/by_executor.py +0 -50
- exonware/xwnode/queries/executors/ordering/order_executor.py +0 -51
- exonware/xwnode/queries/executors/projection/__init__.py +0 -9
- exonware/xwnode/queries/executors/projection/extend_executor.py +0 -50
- exonware/xwnode/queries/executors/projection/project_executor.py +0 -50
- exonware/xwnode/queries/executors/registry.py +0 -173
- exonware/xwnode/queries/parsers/__init__.py +0 -26
- exonware/xwnode/queries/parsers/base.py +0 -86
- exonware/xwnode/queries/parsers/contracts.py +0 -46
- exonware/xwnode/queries/parsers/errors.py +0 -53
- exonware/xwnode/queries/parsers/sql_param_extractor.py +0 -318
- exonware/xwnode/queries/strategies/__init__.py +0 -24
- exonware/xwnode/queries/strategies/base.py +0 -236
- exonware/xwnode/queries/strategies/cql.py +0 -201
- exonware/xwnode/queries/strategies/cypher.py +0 -181
- exonware/xwnode/queries/strategies/datalog.py +0 -70
- exonware/xwnode/queries/strategies/elastic_dsl.py +0 -70
- exonware/xwnode/queries/strategies/eql.py +0 -70
- exonware/xwnode/queries/strategies/flux.py +0 -70
- exonware/xwnode/queries/strategies/gql.py +0 -70
- exonware/xwnode/queries/strategies/graphql.py +0 -240
- exonware/xwnode/queries/strategies/gremlin.py +0 -181
- exonware/xwnode/queries/strategies/hiveql.py +0 -214
- exonware/xwnode/queries/strategies/hql.py +0 -70
- exonware/xwnode/queries/strategies/jmespath.py +0 -219
- exonware/xwnode/queries/strategies/jq.py +0 -66
- exonware/xwnode/queries/strategies/json_query.py +0 -66
- exonware/xwnode/queries/strategies/jsoniq.py +0 -248
- exonware/xwnode/queries/strategies/kql.py +0 -70
- exonware/xwnode/queries/strategies/linq.py +0 -238
- exonware/xwnode/queries/strategies/logql.py +0 -70
- exonware/xwnode/queries/strategies/mql.py +0 -68
- exonware/xwnode/queries/strategies/n1ql.py +0 -210
- exonware/xwnode/queries/strategies/partiql.py +0 -70
- exonware/xwnode/queries/strategies/pig.py +0 -215
- exonware/xwnode/queries/strategies/promql.py +0 -70
- exonware/xwnode/queries/strategies/sparql.py +0 -220
- exonware/xwnode/queries/strategies/sql.py +0 -275
- exonware/xwnode/queries/strategies/xml_query.py +0 -66
- exonware/xwnode/queries/strategies/xpath.py +0 -223
- exonware/xwnode/queries/strategies/xquery.py +0 -258
- exonware/xwnode/queries/strategies/xwnode_executor.py +0 -332
- exonware/xwnode/queries/strategies/xwquery.py +0 -456
- exonware_xwnode-0.0.1.22.dist-info/METADATA +0 -168
- exonware_xwnode-0.0.1.22.dist-info/RECORD +0 -214
- /exonware/xwnode/nodes/strategies/{node_ordered_map.py → ordered_map.py} +0 -0
- /exonware/xwnode/nodes/strategies/{node_ordered_map_balanced.py → ordered_map_balanced.py} +0 -0
- /exonware/xwnode/nodes/strategies/{node_patricia.py → patricia.py} +0 -0
- /exonware/xwnode/nodes/strategies/{node_radix_trie.py → radix_trie.py} +0 -0
- /exonware/xwnode/nodes/strategies/{node_set_tree.py → set_tree.py} +0 -0
- {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.24.dist-info}/WHEEL +0 -0
- {exonware_xwnode-0.0.1.22.dist-info → exonware_xwnode-0.0.1.24.dist-info}/licenses/LICENSE +0 -0
@@ -1,76 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/filtering/optional_executor.py
|
4
|
-
|
5
|
-
OPTIONAL 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: 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
|
-
|
19
|
-
|
20
|
-
class OptionalExecutor(AUniversalOperationExecutor):
|
21
|
-
"""
|
22
|
-
OPTIONAL operation executor - Universal operation.
|
23
|
-
|
24
|
-
Performs optional matching (like LEFT JOIN or OPTIONAL MATCH in SPARQL).
|
25
|
-
Returns items whether or not the optional condition matches.
|
26
|
-
|
27
|
-
Capability: Universal
|
28
|
-
Operation Type: FILTERING
|
29
|
-
"""
|
30
|
-
|
31
|
-
OPERATION_NAME = "OPTIONAL"
|
32
|
-
OPERATION_TYPE = OperationType.FILTERING
|
33
|
-
SUPPORTED_NODE_TYPES = [] # Universal
|
34
|
-
|
35
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
36
|
-
"""Execute OPTIONAL operation."""
|
37
|
-
params = action.params
|
38
|
-
condition = params.get('condition', None)
|
39
|
-
path = params.get('path', None)
|
40
|
-
|
41
|
-
node = context.node
|
42
|
-
result_data = self._execute_optional(node, condition, path, context)
|
43
|
-
|
44
|
-
return ExecutionResult(
|
45
|
-
success=True,
|
46
|
-
data=result_data,
|
47
|
-
operation=self.OPERATION_NAME,
|
48
|
-
metadata={'total_count': len(result_data.get('items', []))}
|
49
|
-
)
|
50
|
-
|
51
|
-
def _execute_optional(self, node: Any, condition: Any, path: str, context: ExecutionContext) -> Dict:
|
52
|
-
"""Execute OPTIONAL matching."""
|
53
|
-
all_items = []
|
54
|
-
|
55
|
-
# Get data
|
56
|
-
if path:
|
57
|
-
data = node.get(path, default=[])
|
58
|
-
else:
|
59
|
-
data = node.to_native()
|
60
|
-
|
61
|
-
# Include all items, mark which match optional condition
|
62
|
-
if isinstance(data, list):
|
63
|
-
for item in data:
|
64
|
-
result_item = item.copy() if isinstance(item, dict) else {'value': item}
|
65
|
-
result_item['_optional_matched'] = self._matches_condition(item, condition)
|
66
|
-
all_items.append(result_item)
|
67
|
-
|
68
|
-
return {'items': all_items, 'count': len(all_items)}
|
69
|
-
|
70
|
-
def _matches_condition(self, item: Any, condition: Any) -> bool:
|
71
|
-
"""Check if item matches optional condition."""
|
72
|
-
if condition is None:
|
73
|
-
return False
|
74
|
-
# Simplified condition matching
|
75
|
-
return False
|
76
|
-
|
@@ -1,80 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/filtering/range_executor.py
|
4
|
-
|
5
|
-
RANGE 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: 08-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
|
-
|
21
|
-
class RangeExecutor(AOperationExecutor):
|
22
|
-
"""
|
23
|
-
RANGE operation executor - Tree/Matrix operation.
|
24
|
-
|
25
|
-
Performs range queries on ordered data structures.
|
26
|
-
Optimized for TREE and MATRIX node types with efficient range scanning.
|
27
|
-
|
28
|
-
Capability: Tree/Matrix only
|
29
|
-
Operation Type: FILTERING
|
30
|
-
"""
|
31
|
-
|
32
|
-
OPERATION_NAME = "RANGE"
|
33
|
-
OPERATION_TYPE = OperationType.FILTERING
|
34
|
-
SUPPORTED_NODE_TYPES = [NodeType.TREE, NodeType.MATRIX, NodeType.HYBRID]
|
35
|
-
|
36
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
37
|
-
"""Execute RANGE operation."""
|
38
|
-
params = action.params
|
39
|
-
start = params.get('start')
|
40
|
-
end = params.get('end')
|
41
|
-
inclusive = params.get('inclusive', True)
|
42
|
-
path = params.get('path', None)
|
43
|
-
|
44
|
-
node = context.node
|
45
|
-
result_data = self._execute_range(node, start, end, inclusive, path, context)
|
46
|
-
|
47
|
-
return ExecutionResult(
|
48
|
-
success=True,
|
49
|
-
data=result_data,
|
50
|
-
operation=self.OPERATION_NAME,
|
51
|
-
metadata={'item_count': len(result_data.get('items', []))}
|
52
|
-
)
|
53
|
-
|
54
|
-
def _execute_range(self, node: Any, start: Any, end: Any, inclusive: bool,
|
55
|
-
path: str, context: ExecutionContext) -> Dict:
|
56
|
-
"""Execute RANGE query."""
|
57
|
-
range_items = []
|
58
|
-
|
59
|
-
# Get data
|
60
|
-
if path:
|
61
|
-
data = node.get(path, default={})
|
62
|
-
else:
|
63
|
-
data = node.to_native()
|
64
|
-
|
65
|
-
# Range query (simplified - would use tree traversal in real impl)
|
66
|
-
if isinstance(data, dict):
|
67
|
-
for key, value in sorted(data.items()):
|
68
|
-
if inclusive:
|
69
|
-
if start <= key <= end:
|
70
|
-
range_items.append({key: value})
|
71
|
-
else:
|
72
|
-
if start < key < end:
|
73
|
-
range_items.append({key: value})
|
74
|
-
|
75
|
-
return {
|
76
|
-
'items': range_items,
|
77
|
-
'count': len(range_items),
|
78
|
-
'range': {'start': start, 'end': end, 'inclusive': inclusive}
|
79
|
-
}
|
80
|
-
|
@@ -1,77 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/filtering/term_executor.py
|
4
|
-
|
5
|
-
TERM 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: 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
|
-
|
19
|
-
|
20
|
-
class TermExecutor(AUniversalOperationExecutor):
|
21
|
-
"""
|
22
|
-
TERM operation executor - Universal operation.
|
23
|
-
|
24
|
-
Performs term-based search/matching (exact term match).
|
25
|
-
Used in search engines and text indexing.
|
26
|
-
|
27
|
-
Capability: Universal
|
28
|
-
Operation Type: SEARCH
|
29
|
-
"""
|
30
|
-
|
31
|
-
OPERATION_NAME = "TERM"
|
32
|
-
OPERATION_TYPE = OperationType.SEARCH
|
33
|
-
SUPPORTED_NODE_TYPES = [] # Universal
|
34
|
-
|
35
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
36
|
-
"""Execute TERM operation."""
|
37
|
-
params = action.params
|
38
|
-
field = params.get('field')
|
39
|
-
term = params.get('term', '')
|
40
|
-
path = params.get('path', None)
|
41
|
-
case_sensitive = params.get('case_sensitive', False)
|
42
|
-
|
43
|
-
node = context.node
|
44
|
-
result_data = self._execute_term(node, field, term, path, case_sensitive, context)
|
45
|
-
|
46
|
-
return ExecutionResult(
|
47
|
-
success=True,
|
48
|
-
data=result_data,
|
49
|
-
operation=self.OPERATION_NAME,
|
50
|
-
metadata={'matched_count': len(result_data.get('items', []))}
|
51
|
-
)
|
52
|
-
|
53
|
-
def _execute_term(self, node: Any, field: str, term: str, path: str,
|
54
|
-
case_sensitive: bool, context: ExecutionContext) -> Dict:
|
55
|
-
"""Execute TERM search."""
|
56
|
-
matched_items = []
|
57
|
-
|
58
|
-
# Get data
|
59
|
-
if path:
|
60
|
-
data = node.get(path, default=[])
|
61
|
-
else:
|
62
|
-
data = node.to_native()
|
63
|
-
|
64
|
-
# Normalize term if case-insensitive
|
65
|
-
search_term = term if case_sensitive else term.lower()
|
66
|
-
|
67
|
-
# Search for term
|
68
|
-
if isinstance(data, list):
|
69
|
-
for item in data:
|
70
|
-
value = item.get(field) if isinstance(item, dict) else str(item)
|
71
|
-
if value:
|
72
|
-
compare_value = str(value) if case_sensitive else str(value).lower()
|
73
|
-
if search_term in compare_value:
|
74
|
-
matched_items.append(item)
|
75
|
-
|
76
|
-
return {'items': matched_items, 'count': len(matched_items), 'term': term}
|
77
|
-
|
@@ -1,71 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/filtering/values_executor.py
|
4
|
-
|
5
|
-
VALUES 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: 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
|
-
|
19
|
-
|
20
|
-
class ValuesExecutor(AUniversalOperationExecutor):
|
21
|
-
"""
|
22
|
-
VALUES operation executor - Universal operation.
|
23
|
-
|
24
|
-
Handles VALUES clause (inline data/constants).
|
25
|
-
Used in SQL and SPARQL for providing inline value lists.
|
26
|
-
|
27
|
-
Capability: Universal
|
28
|
-
Operation Type: DATA_OPS
|
29
|
-
"""
|
30
|
-
|
31
|
-
OPERATION_NAME = "VALUES"
|
32
|
-
OPERATION_TYPE = OperationType.DATA_OPS
|
33
|
-
SUPPORTED_NODE_TYPES = [] # Universal
|
34
|
-
|
35
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
36
|
-
"""Execute VALUES operation."""
|
37
|
-
params = action.params
|
38
|
-
values = params.get('values', [])
|
39
|
-
columns = params.get('columns', [])
|
40
|
-
|
41
|
-
result_data = self._execute_values(values, columns, context)
|
42
|
-
|
43
|
-
return ExecutionResult(
|
44
|
-
success=True,
|
45
|
-
data=result_data,
|
46
|
-
operation=self.OPERATION_NAME,
|
47
|
-
metadata={'row_count': len(result_data.get('rows', []))}
|
48
|
-
)
|
49
|
-
|
50
|
-
def _execute_values(self, values: List, columns: List, context: ExecutionContext) -> Dict:
|
51
|
-
"""Execute VALUES inline data."""
|
52
|
-
rows = []
|
53
|
-
|
54
|
-
# Convert values to rows with column names
|
55
|
-
if columns:
|
56
|
-
for value_row in values:
|
57
|
-
if isinstance(value_row, list):
|
58
|
-
row = dict(zip(columns, value_row))
|
59
|
-
rows.append(row)
|
60
|
-
elif isinstance(value_row, dict):
|
61
|
-
rows.append(value_row)
|
62
|
-
else:
|
63
|
-
# No columns specified, use values as-is
|
64
|
-
rows = values if isinstance(values, list) else [values]
|
65
|
-
|
66
|
-
return {
|
67
|
-
'rows': rows,
|
68
|
-
'count': len(rows),
|
69
|
-
'columns': columns
|
70
|
-
}
|
71
|
-
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/filtering/where_executor.py
|
4
|
-
|
5
|
-
WHERE Operation 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: 08-Oct-2025
|
12
|
-
"""
|
13
|
-
|
14
|
-
from typing import Any, List, Dict
|
15
|
-
from ..base import AUniversalOperationExecutor
|
16
|
-
from ..contracts import Action, ExecutionContext, ExecutionResult
|
17
|
-
|
18
|
-
|
19
|
-
class WhereExecutor(AUniversalOperationExecutor):
|
20
|
-
"""WHERE operation executor - Universal filtering operation."""
|
21
|
-
|
22
|
-
OPERATION_NAME = "WHERE"
|
23
|
-
|
24
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
25
|
-
"""Execute WHERE operation - filter data based on condition."""
|
26
|
-
condition = action.params.get('condition', '')
|
27
|
-
data = action.params.get('data', [])
|
28
|
-
|
29
|
-
# Simple condition evaluation (can be enhanced with expression parser)
|
30
|
-
filtered = []
|
31
|
-
for item in data:
|
32
|
-
if self._evaluate_condition(item, condition):
|
33
|
-
filtered.append(item)
|
34
|
-
|
35
|
-
return ExecutionResult(data=filtered, affected_count=len(filtered))
|
36
|
-
|
37
|
-
def _evaluate_condition(self, item: Any, condition: str) -> bool:
|
38
|
-
"""Evaluate condition on item (simplified)."""
|
39
|
-
# TODO: Implement full expression evaluation
|
40
|
-
# For now, return True (pass-through)
|
41
|
-
return True
|
42
|
-
|
43
|
-
|
44
|
-
__all__ = ['WhereExecutor']
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"""Graph operation executors."""
|
2
|
-
|
3
|
-
from .match_executor import MatchExecutor
|
4
|
-
from .path_executor import PathExecutor
|
5
|
-
from .out_executor import OutExecutor
|
6
|
-
from .in_traverse_executor import InTraverseExecutor
|
7
|
-
from .return_executor import ReturnExecutor
|
8
|
-
|
9
|
-
__all__ = [
|
10
|
-
'MatchExecutor',
|
11
|
-
'PathExecutor',
|
12
|
-
'OutExecutor',
|
13
|
-
'InTraverseExecutor',
|
14
|
-
'ReturnExecutor',
|
15
|
-
]
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/graph/in_traverse_executor.py
|
4
|
-
|
5
|
-
IN_TRAVERSE 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 InTraverseExecutor(AOperationExecutor):
|
21
|
-
"""
|
22
|
-
IN_TRAVERSE operation executor.
|
23
|
-
|
24
|
-
Inbound graph traversal
|
25
|
-
|
26
|
-
Capability: GRAPH, TREE, HYBRID only
|
27
|
-
Operation Type: GRAPH
|
28
|
-
"""
|
29
|
-
|
30
|
-
OPERATION_NAME = "IN_TRAVERSE"
|
31
|
-
OPERATION_TYPE = OperationType.GRAPH
|
32
|
-
SUPPORTED_NODE_TYPES = [NodeType.GRAPH, NodeType.TREE, NodeType.HYBRID]
|
33
|
-
|
34
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
35
|
-
"""Execute IN_TRAVERSE operation."""
|
36
|
-
params = action.params
|
37
|
-
node = context.node
|
38
|
-
|
39
|
-
result_data = self._execute_in_traverse(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_in_traverse(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
49
|
-
"""Execute in_traverse logic."""
|
50
|
-
# Implementation here
|
51
|
-
return {'result': 'IN_TRAVERSE executed', 'params': params}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/graph/match_executor.py
|
4
|
-
|
5
|
-
MATCH 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 MatchExecutor(AOperationExecutor):
|
21
|
-
"""
|
22
|
-
MATCH operation executor.
|
23
|
-
|
24
|
-
Graph pattern matching
|
25
|
-
|
26
|
-
Capability: GRAPH, TREE, HYBRID only
|
27
|
-
Operation Type: GRAPH
|
28
|
-
"""
|
29
|
-
|
30
|
-
OPERATION_NAME = "MATCH"
|
31
|
-
OPERATION_TYPE = OperationType.GRAPH
|
32
|
-
SUPPORTED_NODE_TYPES = [NodeType.GRAPH, NodeType.TREE, NodeType.HYBRID]
|
33
|
-
|
34
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
35
|
-
"""Execute MATCH operation."""
|
36
|
-
params = action.params
|
37
|
-
node = context.node
|
38
|
-
|
39
|
-
result_data = self._execute_match(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_match(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
49
|
-
"""Execute match logic."""
|
50
|
-
# Implementation here
|
51
|
-
return {'result': 'MATCH executed', 'params': params}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/graph/out_executor.py
|
4
|
-
|
5
|
-
OUT 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 OutExecutor(AOperationExecutor):
|
21
|
-
"""
|
22
|
-
OUT operation executor.
|
23
|
-
|
24
|
-
Outbound graph traversal
|
25
|
-
|
26
|
-
Capability: GRAPH, TREE, HYBRID only
|
27
|
-
Operation Type: GRAPH
|
28
|
-
"""
|
29
|
-
|
30
|
-
OPERATION_NAME = "OUT"
|
31
|
-
OPERATION_TYPE = OperationType.GRAPH
|
32
|
-
SUPPORTED_NODE_TYPES = [NodeType.GRAPH, NodeType.TREE, NodeType.HYBRID]
|
33
|
-
|
34
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
35
|
-
"""Execute OUT operation."""
|
36
|
-
params = action.params
|
37
|
-
node = context.node
|
38
|
-
|
39
|
-
result_data = self._execute_out(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_out(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
49
|
-
"""Execute out logic."""
|
50
|
-
# Implementation here
|
51
|
-
return {'result': 'OUT executed', 'params': params}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/graph/path_executor.py
|
4
|
-
|
5
|
-
PATH 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 PathExecutor(AOperationExecutor):
|
21
|
-
"""
|
22
|
-
PATH operation executor.
|
23
|
-
|
24
|
-
Path operations in graphs
|
25
|
-
|
26
|
-
Capability: GRAPH, TREE, HYBRID only
|
27
|
-
Operation Type: GRAPH
|
28
|
-
"""
|
29
|
-
|
30
|
-
OPERATION_NAME = "PATH"
|
31
|
-
OPERATION_TYPE = OperationType.GRAPH
|
32
|
-
SUPPORTED_NODE_TYPES = [NodeType.GRAPH, NodeType.TREE, NodeType.HYBRID]
|
33
|
-
|
34
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
35
|
-
"""Execute PATH operation."""
|
36
|
-
params = action.params
|
37
|
-
node = context.node
|
38
|
-
|
39
|
-
result_data = self._execute_path(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_path(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
49
|
-
"""Execute path logic."""
|
50
|
-
# Implementation here
|
51
|
-
return {'result': 'PATH executed', 'params': params}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/graph/return_executor.py
|
4
|
-
|
5
|
-
RETURN 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 ReturnExecutor(AOperationExecutor):
|
21
|
-
"""
|
22
|
-
RETURN operation executor.
|
23
|
-
|
24
|
-
Returns graph query results
|
25
|
-
|
26
|
-
Capability: GRAPH, TREE, HYBRID only
|
27
|
-
Operation Type: GRAPH
|
28
|
-
"""
|
29
|
-
|
30
|
-
OPERATION_NAME = "RETURN"
|
31
|
-
OPERATION_TYPE = OperationType.GRAPH
|
32
|
-
SUPPORTED_NODE_TYPES = [NodeType.GRAPH, NodeType.TREE, NodeType.HYBRID]
|
33
|
-
|
34
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
35
|
-
"""Execute RETURN operation."""
|
36
|
-
params = action.params
|
37
|
-
node = context.node
|
38
|
-
|
39
|
-
result_data = self._execute_return(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_return(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
49
|
-
"""Execute return logic."""
|
50
|
-
# Implementation here
|
51
|
-
return {'result': 'RETURN executed', 'params': params}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
#exonware/xwnode/src/exonware/xwnode/queries/executors/ordering/by_executor.py
|
4
|
-
|
5
|
-
BY 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 ByExecutor(AUniversalOperationExecutor):
|
20
|
-
"""
|
21
|
-
BY operation executor.
|
22
|
-
|
23
|
-
Modifier for ORDER/GROUP BY
|
24
|
-
|
25
|
-
Capability: Universal
|
26
|
-
Operation Type: ORDERING
|
27
|
-
"""
|
28
|
-
|
29
|
-
OPERATION_NAME = "BY"
|
30
|
-
OPERATION_TYPE = OperationType.ORDERING
|
31
|
-
SUPPORTED_NODE_TYPES = [] # Universal
|
32
|
-
|
33
|
-
def _do_execute(self, action: Action, context: ExecutionContext) -> ExecutionResult:
|
34
|
-
"""Execute BY operation."""
|
35
|
-
params = action.params
|
36
|
-
node = context.node
|
37
|
-
|
38
|
-
result_data = self._execute_by(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_by(self, node: Any, params: Dict, context: ExecutionContext) -> Dict:
|
48
|
-
"""Execute by logic."""
|
49
|
-
# Implementation here
|
50
|
-
return {'result': 'BY executed', 'params': params}
|