Skip to content

Domain plugin http contract

Domain Plugin HTTP Contract

The domain service implements five endpoints. The identity server calls these endpoints; the domain service fulfills them.

POST /resolve-authority

Request:

{
  "mention": "desmopressin",
  "entity_type": "drug"
}

Response (match found):

{
  "canonical_id": "RxNorm:3251",
  "authority": "RxNorm",
  "confidence": 1.0
}

Response (no match):

{
  "canonical_id": null,
  "authority": null,
  "confidence": null
}

POST /select-survivor

Request:

{
  "entity_a": { ... EntityRecord ... },
  "entity_b": { ... EntityRecord ... }
}

Response:

{
  "survivor_id": "RxNorm:3251"
}

POST /compute-confidence

Request:

{
  "provenance_records": [
    {
      "paper_id": "PMC1234567",
      "section_type": "results",
      "paragraph_idx": 3,
      "extraction_method": "claude-sonnet-4-6/v2",
      "confidence": 0.92,
      "study_type": "rct"
    }
  ]
}

Response:

{
  "confidence": 0.87
}

GET /synonym-criteria

Response:

{
  "fuzzy_threshold": 0.85,
  "embedding_threshold": 0.92,
  "entity_type_overrides": {
    "gene": {
      "fuzzy_threshold": 0.95
    }
  }
}

GET /schema

No request body. Returns the complete domain spec: the closed set of entity types and the full predicate vocabulary with domain, range, and constraint declarations. The identity server fetches this at startup and re-fetches it when the schema version changes.

Response:

{
  "version": "2.3.0",
  "entity_types": ["drug", "gene", "disease", "biological_process"],
  "predicates": [
    {
      "name": "treats",
      "domain": ["drug"],
      "range": ["disease"],
      "description": "Drug is used therapeutically to manage the disease.",
      "is_functional": false,
      "negation_of": null
    },
    {
      "name": "inhibits",
      "domain": ["drug", "gene"],
      "range": ["gene", "biological_process"],
      "description": "Subject suppresses the activity of the object.",
      "is_functional": false,
      "negation_of": "activates"
    }
  ]
}