Class YamlKonceptDefinitionSource

java.lang.Object
network.ike.docs.koncept.YamlKonceptDefinitionSource
All Implemented Interfaces:
KonceptDefinitionSource

public class YamlKonceptDefinitionSource extends Object implements KonceptDefinitionSource
Loads Koncept definitions from a YAML file.

Expected YAML structure:

HeartFailure:
  label: Heart Failure
  definition: >
    A clinical syndrome characterized by the heart's inability
    to pump sufficient blood to meet metabolic demands.
  axiom: "≡ ClinicalSyndrome ⊓ ∃hasPathology.(InsufficientCardiacOutput)"
  sctid: "84114007"
  iri: "http://snomed.info/id/84114007"

AorticStenosis:
  label: Aortic Stenosis
  definition: Narrowing of the aortic valve orifice.
  axiom: "≡ StenosisOfValve ⊓ ∃hasMorphology.Stenosis ⊓ ∃findingSite.AorticValve"
  sctid: "60573004"
  • Method Details

    • lookup

      public Optional<KonceptDefinition> lookup(String identifier)
      Description copied from interface: KonceptDefinitionSource
      Look up the definition for the given koncept identifier.
      Specified by:
      lookup in interface KonceptDefinitionSource
      Parameters:
      identifier - CamelCase koncept identifier (e.g., "HeartFailure")
      Returns:
      the definition if found
    • fromClasspath

      public static YamlKonceptDefinitionSource fromClasspath(String resource)
      Loads definitions from a classpath resource.
      Parameters:
      resource - the classpath resource path (e.g., /koncepts.yml)
      Returns:
      a definition source backed by the parsed YAML, or an empty source if not found
    • fromFile

      public static YamlKonceptDefinitionSource fromFile(String filePath)
      Loads definitions from a filesystem path.
      Parameters:
      filePath - the absolute or relative path to the YAML file
      Returns:
      a definition source backed by the parsed YAML, or an empty source if not found