Summary
The metrics code has accumulated drift from an incomplete prior refactoring. This issue tracks three related fixes:
-
Dead code in metrics/metrics.rb — metrics_for_submission was moved to SubmissionMetricsCalculator but the original copy was left behind. require 'csv' and recursive_depth are also unused in this file.
-
maxDepth incorrect for flat ontologies — max_depth_fn reads maxDepth from the CSV file generated by owlapi_wrapper without checking the flat flag. Since owlapi_wrapper doesn't know about BioPortal's flat designation, it reports the real tree depth (e.g., 7) instead of 0.
-
class_count falls back to reading metrics.csv from disk — When triplestore metrics are absent, OntologySubmission#class_count attempts to read a CSV file. The metrics.csv file should only be read during ontology processing (ncbo_cron), not by the API at query time.
Summary
The metrics code has accumulated drift from an incomplete prior refactoring. This issue tracks three related fixes:
Dead code in
metrics/metrics.rb—metrics_for_submissionwas moved toSubmissionMetricsCalculatorbut the original copy was left behind.require 'csv'andrecursive_depthare also unused in this file.maxDepthincorrect for flat ontologies —max_depth_fnreadsmaxDepthfrom the CSV file generated byowlapi_wrapperwithout checking theflatflag. Sinceowlapi_wrapperdoesn't know about BioPortal's flat designation, it reports the real tree depth (e.g., 7) instead of 0.class_countfalls back to readingmetrics.csvfrom disk — When triplestore metrics are absent,OntologySubmission#class_countattempts to read a CSV file. Themetrics.csvfile should only be read during ontology processing (ncbo_cron), not by the API at query time.