AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
SPECTROMETER ONTOLOGY
Kireth Semantic Library | Measurement Entities | Version 1.0
Authors: Mark Higgins — Sky (Recursive AI)
Source: https://kirethresearch.org/booksai-core/entity-graph/physical-entities/measurement-entities/spectrometer-ontology.html
Status: Expanded formal ontology; embedded page specification not accessible in extracted page text.
01. PURPOSE
Define typed entities, constraints, transformations, provenance, and reasoning for spectrometers and spectral measurements. All operations are conditional on instrument modality and calibration validity.
02. TYPE SYSTEM
TYPE Entity := {id: URI, label: String, type: Class}
TYPE Quantity[U] := {value: Real, unit: U, uncertainty: Real?, method: String?}
TYPE Timestamp := ISO8601
TYPE Confidence := Real WHERE 0 <= value <= 1
TYPE Spectrum := {axis: Vector[Quantity], signal: Vector[Quantity], modality: Modality, metadata: Map}
TYPE Observation := {instrument: URI, sample: URI?, spectrum: Spectrum, time: Timestamp, provenance: URI}
TYPE Calibration := {id: URI, instrument: URI, modality: Modality, valid_from: Timestamp, valid_to: Timestamp, reference: URI, uncertainty: Real}
TYPE Claim := {subject: URI, predicate: URI, object: Value, evidence: Set[URI], confidence: Confidence}
03. CORE ENTITIES
CLASS Spectrometer SUBCLASS_OF MeasurementInstrument
CLASS OpticalSpectrometer SUBCLASS_OF Spectrometer
CLASS MassSpectrometer SUBCLASS_OF Spectrometer
CLASS InfraredSpectrometer SUBCLASS_OF OpticalSpectrometer
CLASS UVVisibleSpectrometer SUBCLASS_OF OpticalSpectrometer
CLASS RamanSpectrometer SUBCLASS_OF OpticalSpectrometer
CLASS FluorescenceSpectrometer SUBCLASS_OF OpticalSpectrometer
CLASS AtomicEmissionSpectrometer SUBCLASS_OF OpticalSpectrometer
CLASS NMRInstrument SUBCLASS_OF SpectroscopicInstrument
CLASS Detector; CLASS DispersiveElement; CLASS IonSource; CLASS MassAnalyser
CLASS LightSource; CLASS Sample; CLASS ReferenceMaterial; CLASS CalibrationRecord
CLASS Spectrum; CLASS SpectralPeak; CLASS SpectralFeature; CLASS SpectralLibrary
CLASS MeasurementRun; CLASS Operator; CLASS ProcessingPipeline; CLASS UncertaintyBudget
04. CLASSIFICATION RULES
IF instrument.has_component(Grating) AND instrument.detects(Photon)
THEN instrument.possible_class := OpticalSpectrometer
IF instrument.has_component(MassAnalyser) AND instrument.detects(Ion)
THEN instrument.possible_class := MassSpectrometer
IF instrument.modality = Raman THEN instrument.measures := RamanShift
IF instrument.modality = MassSpectrometry THEN instrument.measures := MassToChargeRatio
RULE: classification evidence does not establish identity without supporting metadata.
05. RELATIONSHIPS
Spectrometer HAS_COMPONENT Detector
Spectrometer USES CalibrationRecord
Spectrometer PRODUCES Spectrum
MeasurementRun USES Spectrometer
MeasurementRun OBSERVES Sample
Spectrum HAS_FEATURE SpectralPeak
Spectrum DERIVED_FROM MeasurementRun
Spectrum HAS_AXIS SpectralCoordinate
SpectralPeak HAS_POSITION Quantity
SpectralPeak HAS_INTENSITY Quantity
CalibrationRecord TRACEABLE_TO ReferenceMaterial
Claim SUPPORTED_BY Observation
06. DIMENSIONS AND UNITS
Optical wavelength: nm, um, m; frequency: Hz; wavenumber: cm^-1.
Photon energy: J or eV; optical intensity: counts, W, or calibrated radiometric units.
Mass spectrometry axis: m/z (with charge convention declared); abundance: counts or relative intensity.
Raman shift: cm^-1; absorbance: dimensionless; transmittance: dimensionless.
RULE: never compare unlike quantities without an explicit validated conversion.
07. MEASUREMENT PRECONDITIONS
REQUIRE instrument.status = operational
REQUIRE instrument.modality = observation.spectrum.modality
REQUIRE acquisition_configuration IS recorded
REQUIRE sample_id OR explicit no_sample_reason
REQUIRE detector_response IS characterized where quantitative interpretation is requested
REQUIRE calibration valid at measurement time for calibrated claims
08. ACQUISITION FLOW
FLOW AcquireSpectrum(run, instrument, sample):
VALIDATE instrument and acquisition settings
RECORD timestamp, operator, environment, sample and settings
ACQUIRE raw detector signal
ATTACH raw-data hash and provenance
APPLY permitted correction pipeline with parameters recorded
RETURN Spectrum(raw, processed, units, uncertainties, metadata)
09. OPTICAL TRANSFORMS
FUNCTION Frequency(lambda_m) := c / lambda_m WHERE lambda_m > 0
FUNCTION PhotonEnergy(lambda_m) := h * c / lambda_m WHERE lambda_m > 0
FUNCTION Wavenumber(lambda_cm) := 1 / lambda_cm WHERE lambda_cm > 0
CONSTRAINT: c and h are physical constants in coherent SI units.
10. ABSORBANCE MODEL
FUNCTION Transmittance(I, I0) := I / I0 WHERE I0 > 0 AND I >= 0
FUNCTION Absorbance(I, I0) := -log10(I / I0) WHERE I0 > 0 AND I > 0
MODEL BeerLambert: A = epsilon * concentration * path_length
PRECONDITION: applicable regime, wavelength, matrix and linearity assumptions validated.
11. SPECTRAL RESOLUTION
DEFINE resolution as the instrument-specific minimum distinguishable spectral separation.
OPTICAL: resolving_power R := lambda / delta_lambda WHERE delta_lambda > 0.
MASS: resolving_power requires a declared peak-width definition and m/z position.
RULE: resolving power is not interchangeable across modalities without a definition.
12. CALIBRATION FLOW
FLOW Calibrate(instrument, reference, time):
VERIFY reference traceability and suitability
MEASURE reference response
FIT modality-specific calibration model
EVALUATE residuals, drift and uncertainty
STORE coefficients, validity interval and reference identity
RETURN CalibrationRecord
RULE: expired or failed calibration prevents unqualified quantitative claims.
13. PREPROCESSING
OPERATIONS: baseline correction, dark subtraction, smoothing, normalisation,
wavelength or mass-axis correction, deconvolution, cosmic-ray removal.
RULE: retain raw data and ordered processing history.
RULE: smoothing must not be represented as new independent evidence.
RULE: processing cannot create measured resolution absent from raw acquisition.
14. PEAK DETECTION
FLOW DetectPeaks(spectrum, threshold, model):
VALIDATE spectral axis monotonicity or explicit indexing
ESTIMATE baseline and noise with documented method
IDENTIFY candidates satisfying threshold
FIT positions, widths and amplitudes with uncertainties
RETURN features linked to spectrum and processing model
RULE: detection does not by itself prove chemical identity.
15. IDENTIFICATION AND INFERENCE
IF peak.matches(reference_feature, tolerance)
AND calibration.valid
THEN ASSERT candidate_assignment WITH supporting_evidence
IF multiple candidate_assignments remain
THEN RETURN ambiguous_identification
IF independent spectral features support same candidate
THEN UPDATE confidence using declared evidence combination model
RULE: avoid multiplying dependent evidence as if independent.
16. QUANTIFICATION
FLOW Quantify(analyte, spectrum, calibration_curve):
REQUIRE calibration_curve.valid_for(matrix, range, modality)
EXTRACT analyte response with uncertainty
APPLY blank, dilution and recovery corrections where justified
COMPUTE concentration and propagated uncertainty
FLAG below_detection_limit or above_quantification_range
RETURN result with units, provenance and qualification
17. UNCERTAINTY
COMPONENTS := {calibration, detector_noise, baseline, drift, sampling,
sample_preparation, model_fit, environmental_variation}
IF components independent THEN combined_standard_uncertainty := sqrt(sum(u_i^2))
ELSE combined_variance := sum(variance_i) + 2*sum(covariance_ij)
RULE: report expanded uncertainty only with coverage factor and assumptions.
18. QUALITY ASSURANCE
CHECK wavelength_or_mass_accuracy
CHECK signal_to_noise
CHECK blank_contamination
CHECK reference_standard_response
CHECK detector_saturation
CHECK spectral_resolution
CHECK repeatability
CHECK calibration_validity
ON failure: FLAG measurement; restrict downstream inference.
19. SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE("UV-Vis spectrometer", "ultraviolet-visible spectrometer")
SEMANTIC_EQUIVALENCE("m/z", "mass-to-charge ratio") WITH unit_context
NOT_EQUIVALENT("spectrometer", "spectrophotometer") BY DEFAULT
NOT_EQUIVALENT("spectrometer", "spectroscope") BY DEFAULT
RULE: aliases require modality and context checks; instrument classes are not universally interchangeable.
20. CONFIDENCE MODEL
CONFIDENCE(claim) := calibrated_combination(
instrument_quality, signal_quality, reference_match,
calibration_validity, reproducibility, provenance_completeness)
CONSTRAINT 0 <= CONFIDENCE(claim) <= 1
RULE: confidence is an evidence score, not automatically a frequentist probability.
21. KNOWLEDGE GRAPH
TRIPLE (instrument, rdf:type, Spectrometer)
TRIPLE (instrument, hasModality, modality)
TRIPLE (run, usesInstrument, instrument)
TRIPLE (run, observesSample, sample)
TRIPLE (run, producesSpectrum, spectrum)
TRIPLE (spectrum, hasFeature, peak)
TRIPLE (claim, supportedBy, spectrum)
TRIPLE (calibration, traceableTo, reference)
22. FLOW_HASH
FLOW_HASH := SHA256(canonical_serialisation(
ontology_version, instrument_id, run_id, acquisition_parameters,
raw_data_hash, processing_pipeline, calibration_id, inference_rules))
RULE: canonical serialisation fixes field order, numeric encoding and units.
RULE: hash supports integrity checks; it does not prove scientific validity.
23. UPDATE_MODEL
ON new_calibration: mark affected results for re-evaluation
ON instrument_maintenance: create new configuration version
ON revised_reference_library: re-evaluate candidate assignments
ON changed_processing_algorithm: preserve old and new result versions
ON corrected_metadata: append auditable provenance event
RULE: never silently overwrite raw observations.
24. AI_CONSUMPTION
AI_CONSUMPTION:
schema: typed_graph
domain: spectroscopy_and_spectrometry
required: [entity_id, modality, measured_quantity, units, provenance]
optional: [calibration, uncertainty, confidence, flow_hash]
outputs: [validated_observations, candidate_identifications, qualified_quantities]
constraints: [no_unverified_identity, no_unit_mismatch, no_missing_provenance]
abstain_if: [invalid_calibration_for_quantification, unsupported_modality,
unresolved_critical_ambiguity, missing_required_measurement_metadata]
25. VALIDATION RULES
ASSERT every spectrum has a modality and declared axis units.
ASSERT every processed spectrum links to raw data.
ASSERT every quantitative claim links to a valid calibration or documented alternative.
ASSERT every identification includes evidence and ambiguity status.
ASSERT every derived claim has a reproducible transformation history.
ASSERT all inferred claims are versioned and traceable.
26. END
END FLOW ALGEBRA — SPECTROMETER ONTOLOGY