exonware-xwnode 0.0.1.12__py3-none-any.whl → 0.0.1.14__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 +1 -1
- exonware/xwnode/base.py +1 -1
- exonware/xwnode/common/__init__.py +20 -0
- exonware/xwnode/common/management/__init__.py +26 -0
- exonware/xwnode/{strategies → common/management}/manager.py +2 -2
- exonware/xwnode/common/monitoring/__init__.py +26 -0
- exonware/xwnode/{strategies → common/monitoring}/metrics.py +2 -2
- exonware/xwnode/{strategies → common/monitoring}/pattern_detector.py +2 -2
- exonware/xwnode/{strategies → common/monitoring}/performance_monitor.py +2 -2
- exonware/xwnode/common/patterns/__init__.py +26 -0
- exonware/xwnode/{strategies → common/patterns}/advisor.py +1 -1
- exonware/xwnode/{strategies → common/patterns}/flyweight.py +4 -4
- exonware/xwnode/{strategies → common/patterns}/registry.py +109 -112
- exonware/xwnode/common/utils/__init__.py +26 -0
- exonware/xwnode/{strategies/edges → edges/strategies}/__init__.py +1 -1
- exonware/xwnode/{strategies/edges → edges/strategies}/base.py +3 -3
- exonware/xwnode/facade.py +4 -3
- exonware/xwnode/{strategies/nodes → nodes/strategies}/__init__.py +1 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/adjacency_list.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/aho_corasick.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/array_list.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/base.py +24 -4
- exonware/xwnode/nodes/strategies/contracts.py +116 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/deque.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/hash_map.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/heap.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/linked_list.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_aho_corasick.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_array_list.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_avl_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_b_plus_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_bitmap.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_bitset_dynamic.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_bloom_filter.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_btree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_count_min_sketch.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_cow_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_fenwick_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_hash_map.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_heap.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_hyperloglog.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_linked_list.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_lsm_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_ordered_map.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_ordered_map_balanced.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_patricia.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_persistent_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_radix_trie.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_red_black_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_roaring_bitmap.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_segment_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_set_hash.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_set_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_skip_list.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_splay_tree.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_suffix_array.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_treap.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_tree_graph_hybrid.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_trie.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_union_find.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/node_xdata_optimized.py +4 -0
- exonware/xwnode/{strategies/nodes → nodes/strategies}/priority_queue.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/queue.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/sparse_matrix.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/stack.py +7 -2
- exonware/xwnode/{strategies/nodes → nodes/strategies}/trie.py +6 -1
- exonware/xwnode/{strategies/nodes → nodes/strategies}/union_find.py +6 -1
- exonware/xwnode/queries/executors/__init__.py +47 -0
- exonware/xwnode/queries/executors/advanced/__init__.py +37 -0
- exonware/xwnode/queries/executors/advanced/aggregate_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/ask_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/construct_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/describe_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/for_loop_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/foreach_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/join_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/let_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/mutation_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/options_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/pipe_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/subscribe_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/subscription_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/union_executor.py +50 -0
- exonware/xwnode/queries/executors/advanced/window_executor.py +51 -0
- exonware/xwnode/queries/executors/advanced/with_cte_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/__init__.py +21 -0
- exonware/xwnode/queries/executors/aggregation/avg_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/count_executor.py +38 -0
- exonware/xwnode/queries/executors/aggregation/distinct_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/group_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/having_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/max_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/min_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/sum_executor.py +50 -0
- exonware/xwnode/queries/executors/aggregation/summarize_executor.py +50 -0
- exonware/xwnode/queries/executors/array/__init__.py +9 -0
- exonware/xwnode/queries/executors/array/indexing_executor.py +51 -0
- exonware/xwnode/queries/executors/array/slicing_executor.py +51 -0
- exonware/xwnode/queries/executors/base.py +257 -0
- exonware/xwnode/queries/executors/capability_checker.py +204 -0
- exonware/xwnode/queries/executors/contracts.py +166 -0
- exonware/xwnode/queries/executors/core/__init__.py +17 -0
- exonware/xwnode/queries/executors/core/create_executor.py +96 -0
- exonware/xwnode/queries/executors/core/delete_executor.py +99 -0
- exonware/xwnode/queries/executors/core/drop_executor.py +100 -0
- exonware/xwnode/queries/executors/core/insert_executor.py +39 -0
- exonware/xwnode/queries/executors/core/select_executor.py +152 -0
- exonware/xwnode/queries/executors/core/update_executor.py +102 -0
- exonware/xwnode/queries/executors/data/__init__.py +13 -0
- exonware/xwnode/queries/executors/data/alter_executor.py +50 -0
- exonware/xwnode/queries/executors/data/load_executor.py +50 -0
- exonware/xwnode/queries/executors/data/merge_executor.py +50 -0
- exonware/xwnode/queries/executors/data/store_executor.py +50 -0
- exonware/xwnode/queries/executors/engine.py +221 -0
- exonware/xwnode/queries/executors/errors.py +68 -0
- exonware/xwnode/queries/executors/filtering/__init__.py +25 -0
- exonware/xwnode/queries/executors/filtering/between_executor.py +80 -0
- exonware/xwnode/queries/executors/filtering/filter_executor.py +79 -0
- exonware/xwnode/queries/executors/filtering/has_executor.py +70 -0
- exonware/xwnode/queries/executors/filtering/in_executor.py +70 -0
- exonware/xwnode/queries/executors/filtering/like_executor.py +76 -0
- exonware/xwnode/queries/executors/filtering/optional_executor.py +76 -0
- exonware/xwnode/queries/executors/filtering/range_executor.py +80 -0
- exonware/xwnode/queries/executors/filtering/term_executor.py +77 -0
- exonware/xwnode/queries/executors/filtering/values_executor.py +71 -0
- exonware/xwnode/queries/executors/filtering/where_executor.py +44 -0
- exonware/xwnode/queries/executors/graph/__init__.py +15 -0
- exonware/xwnode/queries/executors/graph/in_traverse_executor.py +51 -0
- exonware/xwnode/queries/executors/graph/match_executor.py +51 -0
- exonware/xwnode/queries/executors/graph/out_executor.py +51 -0
- exonware/xwnode/queries/executors/graph/path_executor.py +51 -0
- exonware/xwnode/queries/executors/graph/return_executor.py +51 -0
- exonware/xwnode/queries/executors/ordering/__init__.py +9 -0
- exonware/xwnode/queries/executors/ordering/by_executor.py +50 -0
- exonware/xwnode/queries/executors/ordering/order_executor.py +51 -0
- exonware/xwnode/queries/executors/projection/__init__.py +9 -0
- exonware/xwnode/queries/executors/projection/extend_executor.py +50 -0
- exonware/xwnode/queries/executors/projection/project_executor.py +50 -0
- exonware/xwnode/queries/executors/registry.py +173 -0
- exonware/xwnode/queries/executors/types.py +93 -0
- exonware/xwnode/{strategies/queries → queries/strategies}/__init__.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/base.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/cql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/cypher.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/datalog.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/elastic_dsl.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/eql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/flux.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/gql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/graphql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/gremlin.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/hiveql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/hql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/jmespath.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/jq.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/json_query.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/jsoniq.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/kql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/linq.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/logql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/mql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/n1ql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/partiql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/pig.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/promql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/sparql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/sql.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/xml_query.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/xpath.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/xquery.py +1 -1
- exonware/xwnode/{strategies/queries → queries/strategies}/xwnode_executor.py +1 -1
- exonware/xwnode/{strategies/queries/xwquery_strategy.py → queries/strategies/xwquery.py} +1 -1
- exonware/xwnode/strategies/__init__.py +8 -8
- exonware/xwnode/version.py +3 -3
- {exonware_xwnode-0.0.1.12.dist-info → exonware_xwnode-0.0.1.14.dist-info}/METADATA +2 -2
- exonware_xwnode-0.0.1.14.dist-info/RECORD +209 -0
- exonware/xwnode/strategies/impls/__init__.py +0 -13
- exonware/xwnode/strategies/nodes/_base_node.py +0 -307
- exonware_xwnode-0.0.1.12.dist-info/RECORD +0 -132
- /exonware/xwnode/{strategies → common/management}/migration.py +0 -0
- /exonware/xwnode/{strategies → common/utils}/simple.py +0 -0
- /exonware/xwnode/{strategies → common/utils}/utils.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/_base_edge.py +0 -0
- /exonware/xwnode/{strategies/edges → edges/strategies}/adj_list.py +0 -0
- /exonware/xwnode/{strategies/edges → edges/strategies}/adj_matrix.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_adj_list.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_adj_matrix.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_bidir_wrapper.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_block_adj_matrix.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_coo.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_csc.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_csr.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_dynamic_adj_list.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_flow_network.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_hyperedge_set.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_neural_graph.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_octree.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_property_store.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_quadtree.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_rtree.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_temporal_edgeset.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_tree_graph_basic.py +0 -0
- /exonware/xwnode/{strategies/impls → edges/strategies}/edge_weighted_graph.py +0 -0
- /exonware/xwnode/{strategies/impls → nodes/strategies}/_base_node.py +0 -0
- /exonware/xwnode/{strategies/nodes → nodes/strategies}/node_cuckoo_hash.py +0 -0
- {exonware_xwnode-0.0.1.12.dist-info → exonware_xwnode-0.0.1.14.dist-info}/WHEEL +0 -0
- {exonware_xwnode-0.0.1.12.dist-info → exonware_xwnode-0.0.1.14.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,51 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,51 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,50 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,51 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,50 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,50 @@
|
|
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.14
|
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 ..types 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}
|
@@ -0,0 +1,173 @@
|
|
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.14
|
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
|
+
]
|
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
#exonware/xwnode/src/exonware/xwnode/queries/executors/types.py
|
4
|
+
|
5
|
+
Executor Types and Enums
|
6
|
+
|
7
|
+
Module-specific types for query operation executors.
|
8
|
+
Imports shared types from root types.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.14
|
14
|
+
Generation Date: 08-Oct-2025
|
15
|
+
"""
|
16
|
+
|
17
|
+
from enum import Enum, Flag, auto
|
18
|
+
|
19
|
+
# Import shared types from root
|
20
|
+
from ...types 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
|
+
]
|