Skip to content

Clean up metrics: remove dead code, fix maxDepth for flat ontologies, remove CSV fallback from class_count #276

@alexskr

Description

@alexskr

Summary

The metrics code has accumulated drift from an incomplete prior refactoring. This issue tracks three related fixes:

  1. Dead code in metrics/metrics.rbmetrics_for_submission was moved to SubmissionMetricsCalculator but the original copy was left behind. require 'csv' and recursive_depth are also unused in this file.

  2. maxDepth incorrect for flat ontologiesmax_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.

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions