Skip to main content
curl -X POST "https://api.omophub.com/v1/concepts/relationships/traverse" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start_concepts": [201826, 4182210],
    "traversal_rules": {
      "relationship_types": ["Is a", "Maps to"],
      "direction": "both",
      "max_depth": 4,
      "vocabulary_filters": {
        "allowed_vocabularies": ["SNOMED", "ICD10CM"]
      },
      "concept_filters": {
        "domain_ids": ["Condition"],
        "standard_concepts_only": true
      }
    }
  }'
{
  "success": true,
  "data": {
    "traversal_results": [
      {
        "start_concept_id": 201826,
        "start_concept_name": "Type 2 diabetes mellitus",
        "found_concepts": [
          {
            "concept_id": 73211009,
            "concept_name": "Diabetes mellitus",
            "vocabulary_id": "SNOMED",
            "domain_id": "Condition",
            "concept_class_id": "Clinical Finding",
            "standard_concept": "S",
            "concept_code": "73211009",
            "depth_from_start": 1,
            "relationship_chain": [
              {
                "relationship_type": "Is a",
                "from_concept_id": 201826,
                "to_concept_id": 73211009,
                "direction": "outbound",
                "relationship_id": "rel_123456"
              }
            ]
          },
          {
            "concept_id": 443767,
            "concept_name": "Type 2 diabetes mellitus with complications",
            "vocabulary_id": "SNOMED",
            "domain_id": "Condition",
            "concept_class_id": "Clinical Finding",
            "standard_concept": "S",
            "concept_code": "443767",
            "depth_from_start": 2,
            "relationship_chain": [
              {
                "relationship_type": "Subsumes",
                "from_concept_id": 201826,
                "to_concept_id": 443767,
                "direction": "inbound",
                "relationship_id": "rel_789012"
              }
            ]
          },
          {
            "concept_id": 435216,
            "concept_name": "Type 2 diabetes mellitus",
            "vocabulary_id": "ICD10CM",
            "domain_id": "Condition",
            "concept_class_id": "ICD10 code",
            "standard_concept": "S",
            "concept_code": "E11",
            "depth_from_start": 1,
            "relationship_chain": [
              {
                "relationship_type": "Maps to",
                "from_concept_id": 201826,
                "to_concept_id": 435216,
                "direction": "outbound",
                "relationship_id": "rel_345678"
              }
            ]
          }
        ],
        "paths": [
          {
            "target_concept_id": 73211009,
            "path_length": 1,
            "path_concepts": [201826, 73211009],
            "path_relationships": [
              {
                "relationship_type": "Is a",
                "relationship_id": "is_a_rel",
                "direction": "outbound"
              }
            ],
            "is_shortest_path": true
          },
          {
            "target_concept_id": 435216,
            "path_length": 1,
            "path_concepts": [201826, 435216],
            "path_relationships": [
              {
                "relationship_type": "Maps to",
                "relationship_id": "maps_to_rel",
                "direction": "outbound"
              }
            ],
            "is_shortest_path": true
          }
        ],
        "statistics": {
          "total_concepts_found": 25,
          "max_depth_reached": 4,
          "relationship_types_used": ["Is a", "Maps to", "Subsumes"],
          "vocabularies_traversed": ["SNOMED", "ICD10CM"],
          "domains_found": ["Condition"],
          "truncated": false
        }
      }
    ],
    "global_statistics": {
      "total_start_concepts": 1,
      "total_unique_concepts_found": 25,
      "successful_traversals": 1,
      "failed_traversals": 0,
      "average_concepts_per_start": 25.0,
      "processing_time_ms": 456
    }
  },
  "meta": {
    "request_id": "req_traverse_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.2"
  }
}

Overview

This advanced endpoint allows you to traverse complex relationship networks across multiple concepts, following chains of relationships with sophisticated filtering and path-finding capabilities. Essential for advanced medical terminology analysis and complex queries.

Request Body

start_concepts
array
required
Array of starting concept IDs for traversal
traversal_rules
object
required
Rules defining how to traverse relationships
target_criteria
object
Optional criteria for target concepts

Query Parameters

vocab_release
string
Specific vocabulary release version (e.g., “2024.1”)

Response

success
boolean
required
Indicates whether the request was successful
traversal_results
array
required
Results for each starting concept
global_statistics
object
required
Overall traversal statistics
meta
object
required
Request metadata and response information
curl -X POST "https://api.omophub.com/v1/concepts/relationships/traverse" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start_concepts": [201826, 4182210],
    "traversal_rules": {
      "relationship_types": ["Is a", "Maps to"],
      "direction": "both",
      "max_depth": 4,
      "vocabulary_filters": {
        "allowed_vocabularies": ["SNOMED", "ICD10CM"]
      },
      "concept_filters": {
        "domain_ids": ["Condition"],
        "standard_concepts_only": true
      }
    }
  }'
{
  "success": true,
  "data": {
    "traversal_results": [
      {
        "start_concept_id": 201826,
        "start_concept_name": "Type 2 diabetes mellitus",
        "found_concepts": [
          {
            "concept_id": 73211009,
            "concept_name": "Diabetes mellitus",
            "vocabulary_id": "SNOMED",
            "domain_id": "Condition",
            "concept_class_id": "Clinical Finding",
            "standard_concept": "S",
            "concept_code": "73211009",
            "depth_from_start": 1,
            "relationship_chain": [
              {
                "relationship_type": "Is a",
                "from_concept_id": 201826,
                "to_concept_id": 73211009,
                "direction": "outbound",
                "relationship_id": "rel_123456"
              }
            ]
          },
          {
            "concept_id": 443767,
            "concept_name": "Type 2 diabetes mellitus with complications",
            "vocabulary_id": "SNOMED",
            "domain_id": "Condition",
            "concept_class_id": "Clinical Finding",
            "standard_concept": "S",
            "concept_code": "443767",
            "depth_from_start": 2,
            "relationship_chain": [
              {
                "relationship_type": "Subsumes",
                "from_concept_id": 201826,
                "to_concept_id": 443767,
                "direction": "inbound",
                "relationship_id": "rel_789012"
              }
            ]
          },
          {
            "concept_id": 435216,
            "concept_name": "Type 2 diabetes mellitus",
            "vocabulary_id": "ICD10CM",
            "domain_id": "Condition",
            "concept_class_id": "ICD10 code",
            "standard_concept": "S",
            "concept_code": "E11",
            "depth_from_start": 1,
            "relationship_chain": [
              {
                "relationship_type": "Maps to",
                "from_concept_id": 201826,
                "to_concept_id": 435216,
                "direction": "outbound",
                "relationship_id": "rel_345678"
              }
            ]
          }
        ],
        "paths": [
          {
            "target_concept_id": 73211009,
            "path_length": 1,
            "path_concepts": [201826, 73211009],
            "path_relationships": [
              {
                "relationship_type": "Is a",
                "relationship_id": "is_a_rel",
                "direction": "outbound"
              }
            ],
            "is_shortest_path": true
          },
          {
            "target_concept_id": 435216,
            "path_length": 1,
            "path_concepts": [201826, 435216],
            "path_relationships": [
              {
                "relationship_type": "Maps to",
                "relationship_id": "maps_to_rel",
                "direction": "outbound"
              }
            ],
            "is_shortest_path": true
          }
        ],
        "statistics": {
          "total_concepts_found": 25,
          "max_depth_reached": 4,
          "relationship_types_used": ["Is a", "Maps to", "Subsumes"],
          "vocabularies_traversed": ["SNOMED", "ICD10CM"],
          "domains_found": ["Condition"],
          "truncated": false
        }
      }
    ],
    "global_statistics": {
      "total_start_concepts": 1,
      "total_unique_concepts_found": 25,
      "successful_traversals": 1,
      "failed_traversals": 0,
      "average_concepts_per_start": 25.0,
      "processing_time_ms": 456
    }
  },
  "meta": {
    "request_id": "req_traverse_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.2"
  }
}

Usage Examples

Basic Relationship Traversal

Simple traversal with default settings:
{
  "start_concepts": [201826],
  "traversal_rules": {
    "relationship_types": ["Is a", "Maps to"],
    "max_depth": 3
  }
}

Cross-Vocabulary Mapping

Find mappings between vocabularies:
{
  "start_concepts": [201826],
  "traversal_rules": {
    "relationship_types": ["Maps to"],
    "vocabulary_filters": {
      "target_vocabularies": ["ICD10CM", "ICD9CM"]
    }
  }
}

Path Finding

Find specific paths between concepts:
{
  "start_concepts": [201826],
  "target_criteria": {
    "target_concept_ids": [73211009, 4182210]
  },
  "traversal_rules": {
    "path_options": {
      "find_shortest_paths": true,
      "include_path_details": true
    }
  }
}

Important Notes

  • Complexity limits: Maximum 10 starting concepts and depth 10 to prevent performance issues
  • Result limits: Use max_results_per_concept to control response size
  • Performance: Complex traversals may take several seconds
  • Memory usage: Deep traversals with many concepts can be memory-intensive
  • Path finding: Enable path details only when needed as it increases processing time
I