# CypherQueryCorrector

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector)

Used to correct relationship direction in generated Cypher statements.
This code is copied from the winner's submission to the Cypher competition:
https://github.com/sakusaku-rich/cypher-direction-competition

## Signature

```python
CypherQueryCorrector(
    self,
    schemas: List[Schema],
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `schemas` | `List[Schema]` | Yes | list of schemas |

## Constructors

```python
__init__(
    self,
    schemas: List[Schema],
)
```

| Name | Type |
|------|------|
| `schemas` | `List[Schema]` |


## Properties

- `property_pattern`
- `node_pattern`
- `path_pattern`
- `node_relation_node_pattern`
- `relation_type_pattern`
- `schemas`

## Methods

- [`clean_node()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/clean_node)
- [`detect_node_variables()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/detect_node_variables)
- [`extract_paths()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/extract_paths)
- [`judge_direction()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/judge_direction)
- [`extract_node_variable()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/extract_node_variable)
- [`detect_labels()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/detect_labels)
- [`verify_schema()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/verify_schema)
- [`detect_relation_types()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/detect_relation_types)
- [`correct_query()`](https://reference.langchain.com/python/langchain-community/chains/graph_qa/cypher_utils/CypherQueryCorrector/correct_query)

## ⚠️ Deprecated

Deprecated since version 0.3.8.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/chains/graph_qa/cypher_utils.py#L10)