Skip to main content
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "data": {
    "concept_id": 201826,
    "available_relationships": [
      {
        "id": "Is a",
        "name": "Is a"
      },
      {
        "id": "Maps to",
        "name": "Maps to"
      },
      {
        "id": "Mapped from",
        "name": "Mapped from"
      },
      {
        "id": "Subsumes",
        "name": "Subsumes"
      }
    ]
  },
  "meta": {
    "request_id": "req_relationship_options_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.1"
  }
}

Overview

This endpoint returns all available relationship types that exist for a specific concept. This is useful for building dynamic UI components like dropdowns and understanding what relationships are available for a concept.

Path Parameters

conceptId
integer
required
The unique OMOP concept ID to get relationship options for

Query Parameters

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

Response

success
boolean
required
Indicates whether the request was successful
data
object
required
Response data containing relationship options
meta
object
required
Response metadata
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "data": {
    "concept_id": 201826,
    "available_relationships": [
      {
        "id": "Is a",
        "name": "Is a"
      },
      {
        "id": "Maps to",
        "name": "Maps to"
      },
      {
        "id": "Mapped from",
        "name": "Mapped from"
      },
      {
        "id": "Subsumes",
        "name": "Subsumes"
      }
    ]
  },
  "meta": {
    "request_id": "req_relationship_options_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.1"
  }
}

Usage Examples

Basic Relationship Options

Get all available relationship types for a concept:
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
  -H "Authorization: Bearer YOUR_API_KEY"

With Specific Vocabulary Version

Get relationship options for a specific vocabulary release:
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options?vocab_release=2025.1" \
  -H "Authorization: Bearer YOUR_API_KEY"

UI Dropdown Integration

Use in a dropdown component:
async function loadRelationshipOptions(conceptId) {
  const response = await fetch(`/v1/concepts/${conceptId}/relationships/options`, {
    headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
  });
  const result = await response.json();

  return result.data.available_relationships.map(rel => ({
    value: rel.id,
    label: rel.name
  }));
}

// Use in UI
const options = await loadRelationshipOptions(201826);
const selectHtml = options.map(opt =>
  `<option value="${opt.value}">${opt.label}</option>`
).join('');

Important Notes

  • Dynamic options - Available relationship types vary by concept
  • Both directions - Returns relationships where the concept is either source or target
  • Valid only - Only returns relationships with valid (non-deprecated) status