Skip to content

API Reference

Fatunmbi Daniel edited this page Jul 19, 2026 · 1 revision

API Reference

Every exported symbol, grouped. For usage, see Guides. For meaning, see Concepts.

Error codes and classes

import { ErrorCode, HolonError, ValidationError } from "@ontomorph/holon-types";

ErrorCode

The enum every HOLON error and error response uses (CONCEPT_NOT_FOUND, NO_MAPPING_FOUND, INTERACTION_CHECK_FAILED, UNAUTHORIZED, RATE_LIMIT_EXCEEDED, VALIDATION_ERROR, and more).

HolonError

The base error class. Carries .code: ErrorCode and .details?: unknown.

InvalidEclError

Subclass thrown by the query layer for a malformed ECL query.

InvalidCqlError

Subclass thrown by the query layer for a malformed CQL query.

ValidationError

Subclass thrown by the validation layer when input fails validation.

TransactionError

Subclass thrown when a transaction fails.

ServiceResult

import { ok, err, type ServiceResult } from "@ontomorph/holon-types";

ServiceResult

A lightweight discriminated-union result type used across the HOLON services. Callers branch on .success.

ok

Constructor for a success result: ok(data).

err

Constructor for a failure result: err(message, code).

Vocabulary and domain enums

import { VocabularyId, DomainId, StandardConcept, MappingEquivalence, MappingOrigin } from "@ontomorph/holon-types";

VocabularyId

The supported source vocabularies (SNOMED-CT, RxNorm, LOINC, ICD11, HPO, FMA, and others). VocabularyId.SNOMED_CT === "SNOMED-CT", VocabularyId.RXNORM === "RxNorm", VocabularyId.LOINC === "LOINC".

DomainId

The concept domains, naming what kind of thing a concept is (a Drug, a Measurement, a Condition).

StandardConcept

The standard-concept flags.

MappingEquivalence

A classifier for how two mapped concepts relate.

MappingOrigin

A classifier for where a mapping came from.

HOLON URI helpers

import { HOLON_URI_SCHEME, type HolonUriParts, MIME_TURTLE } from "@ontomorph/holon-types";

HOLON_URI_SCHEME

The URI scheme, equal to "holon".

HolonUriParts

The parsed pieces of a holon: concept URI.

MIME_TURTLE

The text/turtle MIME type, for serializing concepts as Turtle.

Entity and response shapes

Interfaces mirroring exactly what the API returns, so client and server share one definition.

Concepts

Concept

A single clinical idea with a stable id.

ConceptProjection

A projected view of a concept.

IndexableConcept

The concept shape used for indexing.

ConceptAncestor

An ancestor relationship for a concept.

ConceptMapping

A mapping from one concept to another.

ConceptId

A concept identifier.

Clinical

DrugInteractionSeverity

The severity of a drug interaction.

EvidenceGrade

The grade of supporting evidence.

ConceptMapEquivalence

The equivalence of a concept map entry.

ConceptRelationshipType

The type of a concept relationship.

API

ConceptResponse

The response shape for a single concept.

AncestryResponse

The response shape for a concept's ancestry.

DescendantsResponse

The response shape for a concept's descendants.

TranslationResponse

The response shape for a translation between vocabularies.

HealthResponse

The response shape for a health check.

Curation

CurationStatus

The status of a curation item.

ConsumerRole

A consumer role.

VocabularyReleaseStatus

The release status of a vocabulary.

UnmappedConcept

A concept with no mapping.

UnmappedPage

A page of unmapped concepts.