(self, command: GraphCommand)
| 398 | self._cache = {} |
| 399 | |
| 400 | def process(self, command: GraphCommand) -> Any: |
| 401 | if isinstance(command, TraversalCommand): |
| 402 | if command.command_type == GraphCommandType.TRAVERSAL_PATTERN_MATCHING: |
| 403 | return self.path_matching( |
| 404 | sp_expr=command._sp_expr, |
| 405 | rp_expr=command._rp_expr, |
| 406 | ep_expr=command._ep_expr, |
| 407 | direction=command._direction) |
| 408 | else: |
| 409 | return self.opset_matching( |
| 410 | sp_expr=command._sp_expr, |
| 411 | rp_expr=command._rp_expr, |
| 412 | ep_expr=command._ep_expr, |
| 413 | direction=command._direction) |
| 414 | else: |
| 415 | raise TypeError( |
| 416 | 'To execute a traversal-based pattern matching, a TraversalCommand is required here.\n' |
| 417 | 'Initialize your own TraversalCommand instance for invoking ' |
| 418 | 'this function rather than using plain GraphCommand Please.') |
| 419 | |
| 420 | def _acceptable_command_types(self) -> List[GraphCommandType]: |
| 421 | return [ |
no test coverage detected