# HierarchyLinkExtractor

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/graph_vectorstores/extractors/hierarchy_link_extractor/HierarchyLinkExtractor)

## Signature

```python
HierarchyLinkExtractor(
    self,
    *,
    kind: str = 'hierarchy',
    parent_links: bool = True,
    child_links: bool = False,
    sibling_links: bool = False,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `kind` | `str` | No | Kind of links to produce with this extractor. (default: `'hierarchy'`) |
| `parent_links` | `bool` | No | Link from a section to its parent. (default: `True`) |
| `child_links` | `bool` | No | Link from a section to its children. (default: `False`) |
| `sibling_links` | `bool` | No | Link from a section to other sections with the same parent. (default: `False`) |

## Extends

- `LinkExtractor[HierarchyInput]`

## Constructors

```python
__init__(
    self,
    *,
    kind: str = 'hierarchy',
    parent_links: bool = True,
    child_links: bool = False,
    sibling_links: bool = False,
)
```

| Name | Type |
|------|------|
| `kind` | `str` |
| `parent_links` | `bool` |
| `child_links` | `bool` |
| `sibling_links` | `bool` |


## Methods

- [`as_document_extractor()`](https://reference.langchain.com/python/langchain-community/graph_vectorstores/extractors/hierarchy_link_extractor/HierarchyLinkExtractor/as_document_extractor)
- [`extract_one()`](https://reference.langchain.com/python/langchain-community/graph_vectorstores/extractors/hierarchy_link_extractor/HierarchyLinkExtractor/extract_one)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/graph_vectorstores/extractors/hierarchy_link_extractor.py#L22)