curl "https://api.omophub.com/v1/relationships/types?page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
url = "https://api.omophub.com/v1/relationships/types"
params = {"page_size": 50}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationship types: {data['meta']['pagination']['total_items']}")
for rel_type in data['data']['relationship_types']:
hierarchical = "Yes" if rel_type['is_hierarchical'] == '1' else "No"
print(f" {rel_type['relationship_id']} -> {rel_type['reverse_relationship_id']} (Hierarchical: {hierarchical})")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.types({ pageSize: 50 });
console.log(`Found ${meta?.pagination?.total_items} relationship types`);
data?.relationship_types.forEach(type => {
console.log(`${type.relationship_id} <-> ${type.reverse_relationship_id}`);
});
{
"success": true,
"data": {
"relationship_types": [
{
"relationship_id": "Is a",
"relationship_name": "Is a",
"is_hierarchical": "1",
"defines_ancestry": "1",
"reverse_relationship_id": "Subsumes",
"relationship_concept_id": 44818821
},
{
"relationship_id": "Maps to",
"relationship_name": "Maps to",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Mapped from",
"relationship_concept_id": 44818981
},
{
"relationship_id": "Has finding site",
"relationship_name": "Has finding site",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Finding site of",
"relationship_concept_id": 44818788
}
]
},
"meta": {
"request_id": "req_abc123",
"vocab_release": "2025.1",
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 642,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
}
}
Get Relationship Types
Retrieve all available OMOP relationship types - Maps to, Is a, Subsumes, and the complete set of OHDSI-defined links between medical concepts.
curl "https://api.omophub.com/v1/relationships/types?page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
url = "https://api.omophub.com/v1/relationships/types"
params = {"page_size": 50}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationship types: {data['meta']['pagination']['total_items']}")
for rel_type in data['data']['relationship_types']:
hierarchical = "Yes" if rel_type['is_hierarchical'] == '1' else "No"
print(f" {rel_type['relationship_id']} -> {rel_type['reverse_relationship_id']} (Hierarchical: {hierarchical})")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.types({ pageSize: 50 });
console.log(`Found ${meta?.pagination?.total_items} relationship types`);
data?.relationship_types.forEach(type => {
console.log(`${type.relationship_id} <-> ${type.reverse_relationship_id}`);
});
{
"success": true,
"data": {
"relationship_types": [
{
"relationship_id": "Is a",
"relationship_name": "Is a",
"is_hierarchical": "1",
"defines_ancestry": "1",
"reverse_relationship_id": "Subsumes",
"relationship_concept_id": 44818821
},
{
"relationship_id": "Maps to",
"relationship_name": "Maps to",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Mapped from",
"relationship_concept_id": 44818981
},
{
"relationship_id": "Has finding site",
"relationship_name": "Has finding site",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Finding site of",
"relationship_concept_id": 44818788
}
]
},
"meta": {
"request_id": "req_abc123",
"vocab_release": "2025.1",
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 642,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
}
}
This endpoint returns all relationship types from the OMOP CDM RELATIONSHIP table, which defines the types of connections that can exist between concepts.
Query Parameters
Number of relationship types to return per page. Values above 200 are clamped
to 200.
Response
Array of relationship type objects from the OMOP CDM RELATIONSHIP table
Show Relationship Type Object
Show Relationship Type Object
Response metadata including pagination
curl "https://api.omophub.com/v1/relationships/types?page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
url = "https://api.omophub.com/v1/relationships/types"
params = {"page_size": 50}
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, params=params, headers=headers)
data = response.json()
print(f"Total relationship types: {data['meta']['pagination']['total_items']}")
for rel_type in data['data']['relationship_types']:
hierarchical = "Yes" if rel_type['is_hierarchical'] == '1' else "No"
print(f" {rel_type['relationship_id']} -> {rel_type['reverse_relationship_id']} (Hierarchical: {hierarchical})")
import { OMOPHub } from '@omophub/omophub-node';
const client = new OMOPHub();
const { data, meta } = await client.relationships.types({ pageSize: 50 });
console.log(`Found ${meta?.pagination?.total_items} relationship types`);
data?.relationship_types.forEach(type => {
console.log(`${type.relationship_id} <-> ${type.reverse_relationship_id}`);
});
{
"success": true,
"data": {
"relationship_types": [
{
"relationship_id": "Is a",
"relationship_name": "Is a",
"is_hierarchical": "1",
"defines_ancestry": "1",
"reverse_relationship_id": "Subsumes",
"relationship_concept_id": 44818821
},
{
"relationship_id": "Maps to",
"relationship_name": "Maps to",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Mapped from",
"relationship_concept_id": 44818981
},
{
"relationship_id": "Has finding site",
"relationship_name": "Has finding site",
"is_hierarchical": "0",
"defines_ancestry": "0",
"reverse_relationship_id": "Finding site of",
"relationship_concept_id": 44818788
}
]
},
"meta": {
"request_id": "req_abc123",
"vocab_release": "2025.1",
"pagination": {
"page": 1,
"page_size": 100,
"total_items": 642,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
}
}
Usage Examples
All Relationship Types
Get all available relationship types:curl "https://api.omophub.com/v1/relationships/types" \
-H "Authorization: Bearer YOUR_API_KEY"
Paginated Results
Navigate through pages of relationship types:curl "https://api.omophub.com/v1/relationships/types?page=2&page_size=50" \
-H "Authorization: Bearer YOUR_API_KEY"
Related Endpoints
- Get Concept Relationships - Relationships for specific concepts
- Get Concept Mappings - Cross-vocabulary mappings
- Get Vocabularies - Available vocabularies
Notes
- Relationship types come from the OMOP CDM RELATIONSHIP table
- All relationships exist symmetrically (both directions)
- Hierarchical relationships (like “Is a”) are used to build the CONCEPT_ANCESTOR table
- The
defines_ancestryfield indicates which relationships contribute to ancestor computation - Each relationship type has a corresponding concept in the CONCEPT table
Was this page helpful?