> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Concept Relationships

> Retrieve all OMOP concept relationships - including "Maps to", "Is a", and vocabulary-specific links - to traverse concept networks in clinical data.

## Overview

Retrieve all relationships for a concept, including hierarchical relationships (parents/children), mappings to other vocabularies, and semantic relationships.

## Path Parameters

<ParamField path="conceptId" type="integer" required>
  The unique concept identifier
</ParamField>

## Query Parameters

<ParamField query="relationship_ids" type="string">
  Filter by relationship type IDs (comma-separated)

  <br />

  **Examples**: `Is a`, `Subsumes`, `Maps to`, `Is a,Subsumes`
</ParamField>

<ParamField query="vocabulary_ids" type="string">
  Filter relationships to specific target vocabularies (comma-separated)

  <br />

  **Examples**: `SNOMED`, `ICD10CM`, `SNOMED,ICD10CM`
</ParamField>

<ParamField query="domain_ids" type="string">
  Filter relationships to specific target domains (comma-separated)

  <br />

  **Examples**: `Condition`, `Drug`, `Condition,Procedure`
</ParamField>

<ParamField query="include_invalid" type="boolean" default="true">
  Include relationships to invalid concepts
</ParamField>

<ParamField query="standard_only" type="boolean" default="false">
  Only include relationships to standard concepts
</ParamField>

<ParamField query="include_reverse" type="boolean" default="false">
  Include reverse relationships (where this concept is the target)
</ParamField>

<ParamField query="vocab_release" type="string">
  Specific vocabulary release version (defaults to latest)
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.omophub.com/v1/concepts/320128/relationships",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  )
  relationships = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.omophub.com/v1/concepts/320128/relationships', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });
  const relationships = await response.json();
  ```

  ```bash cURL (filtered) theme={null}
  curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships?relationship_ids=Is%20a&vocabulary_ids=SNOMED" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python (filtered) theme={null}
  import requests

  params = {
      "relationship_ids": "Is a",
      "vocabulary_ids": "SNOMED",
      "standard_only": True
  }
  response = requests.get(
      "https://api.omophub.com/v1/concepts/320128/relationships",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      params=params
  )
  filtered_relationships = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "relationships": [
        {
          "relationship_id": "Is a",
          "concept_id_1": 320128,
          "concept_id_2": 316866,
          "concept_name": "Hypertensive disorder",
          "concept_code": "38341003",
          "vocabulary_id": "SNOMED",
          "domain_id": "Condition",
          "standard_concept": "S",
          "valid_start_date": "1970-01-01",
          "valid_end_date": "2099-12-31"
        },
        {
          "relationship_id": "Maps to",
          "concept_id_1": 320128,
          "concept_id_2": 435216,
          "concept_name": "Essential hypertension",
          "concept_code": "I10",
          "vocabulary_id": "ICD10CM",
          "domain_id": "Condition",
          "standard_concept": "S",
          "valid_start_date": "1970-01-01",
          "valid_end_date": "2099-12-31"
        },
        {
          "relationship_id": "Has finding site",
          "concept_id_1": 320128,
          "concept_id_2": 4103720,
          "concept_name": "Cardiovascular system",
          "concept_code": "113257007",
          "vocabulary_id": "SNOMED",
          "domain_id": "Spec Anatomic Site",
          "standard_concept": "S",
          "valid_start_date": "1970-01-01",
          "valid_end_date": "2099-12-31"
        }
      ]
    },
    "meta": {
      "request_id": "req_relationships_123",
      "timestamp": "2024-12-22T10:00:00Z",
      "vocab_release": "2025.2",
      "version": "2025.2",
      "duration": 45
    }
  }
  ```
</ResponseExample>

## Response Fields

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Response Data">
    <ResponseField name="relationships" type="array">
      Array of relationship objects

      <Expandable title="Relationship">
        <ResponseField name="relationship_id" type="string">
          Type of relationship (e.g., "Is a", "Maps to", "Subsumes")
        </ResponseField>

        <ResponseField name="concept_id_1" type="integer">
          Source concept ID
        </ResponseField>

        <ResponseField name="concept_id_2" type="integer">
          Target concept ID
        </ResponseField>

        <ResponseField name="concept_name" type="string">
          Target concept name
        </ResponseField>

        <ResponseField name="concept_code" type="string">
          Target concept code
        </ResponseField>

        <ResponseField name="vocabulary_id" type="string">
          Target vocabulary ID
        </ResponseField>

        <ResponseField name="domain_id" type="string">
          Target domain ID
        </ResponseField>

        <ResponseField name="standard_concept" type="string">
          Standard concept flag (S=Standard, C=Classification, null=Non-standard)
        </ResponseField>

        <ResponseField name="valid_start_date" type="string">
          Relationship validity start date
        </ResponseField>

        <ResponseField name="valid_end_date" type="string">
          Relationship validity end date
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="Metadata">
    <ResponseField name="request_id" type="string">
      Unique identifier for the request
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Request timestamp (ISO 8601 UTC format)
    </ResponseField>

    <ResponseField name="vocab_release" type="string">
      Vocabulary release version used
    </ResponseField>

    <ResponseField name="version" type="string">
      Schema version used for the query
    </ResponseField>

    <ResponseField name="duration" type="integer">
      Request duration in milliseconds
    </ResponseField>
  </Expandable>
</ResponseField>

## Usage Examples

### Get All Relationships

Retrieve all relationships for a concept:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Filter by Relationship Type

Get only hierarchical relationships:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships?relationship_ids=Is%20a,Subsumes" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Filter by Target Vocabulary

Get mappings to specific vocabularies:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships?vocabulary_ids=ICD10CM,ICD9CM" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Standard Concepts Only

Get relationships to standard concepts only:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships?standard_only=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Include Reverse Relationships

Include relationships where this concept is the target:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/320128/relationships?include_reverse=true" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Common Relationship Types

| Relationship                | Description                      |
| --------------------------- | -------------------------------- |
| `Is a`                      | Hierarchical parent relationship |
| `Subsumes`                  | Hierarchical child relationship  |
| `Maps to`                   | Mapping to another vocabulary    |
| `Mapped from`               | Reverse mapping relationship     |
| `Has finding site`          | Anatomical location              |
| `Has associated morphology` | Associated morphological finding |

## Related Endpoints

* [Get Concept](/api-reference/concepts/get-concept) - Get detailed concept information
* [Get Relationship Options](/api-reference/concepts/get-relationship-options) - Get available relationship types for a concept
* [Traverse Relationships](/api-reference/concepts/traverse-relationships) - Complex relationship traversal
