def METHOD_NAME(path):
    """Resolve CAP JSON schemas."""
    try:
        options, type_, name, major, minor, patch = parse_path(path)
        schema = Schema.query \
            .filter_by(name=name,
                       major=major,
                       minor=minor,
                       patch=patch)\
            .one()
    except (NoResultFound, AttributeError, TypeError):
        raise JSONSchemaNotFound(schema=path)
    if type_ == current_app.config['SCHEMAS_DEPOSIT_PREFIX']:
        jsonschema = schema.deposit_options if options \
            else schema.deposit_schema
    else:
        jsonschema = schema.record_options if options \
            else schema.record_schema
    return jsonschema