Skip to content

OpenOntology package loading fails on Windows paths #115

Description

@rissrice2105-agent

Problem

loadOntologyPackage() derives the package directory with manifestPath.slice(0, manifestPath.lastIndexOf("/")). Windows paths use backslashes, so lastIndexOf("/") returns -1 and the code removes only the last character from openontology.yaml.

The loader then looks for declared files below a non-existent path such as openontology.yam\schema\namespaces.yaml, making every directory-backed OpenOntology package fail to load on Windows.

Reproduction

On Windows, scaffold a package with initOntologyPackage(dir, ...), then call loadOntologyPackage(dir) or pass the explicit openontology.yaml path. Both throw that the declared schema file is missing even though it exists.

Expected

Manifest-relative schema and data files should resolve from the manifest's parent directory on every supported platform.

Proposed fix

Use Node's platform-aware path.dirname() and cover explicit manifest-path loading in the validation suite.

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