INCATools / INCATools/ontology-access-kit

`relationships`: Add warning/error when invalid predicates

Open
#680 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
198
Forks
35
Avg merge
3d 4h
Merged PRs (30d)
1

Description

## Overview
Both in the [CLI](https://github.com/INCATools/ontology-access-kit/issues/613) and in the [Python API](https://github.com/INCATools/ontology-access-kit/issues/675), I've mistakenly used `relationships` to try to access a number of edges at once which include mappings, rather than using `relationships` and `mappings` commands separately. I suggest that if invalid predicates are passed, a warning or error should occur

## Current behavior
The behavior is inconsistent. In (1), the predicate invalid predicate is not returned, and in (2) they are.

1. [CLI](https://github.com/INCATools/ontology-access-kit/issues/613): The invalid predicate I passed (`oboInOwl:hasDbXref`) is simply ignored and not returned.

2. [Python API](https://github.com/INCATools/ontology-access-kit/issues/675): The invalid predicates I passed (`skos:exactMatch`, `skos:narrowMatch`) were returned.
Additional info: They are not returned when `.relationships()` is used without passing the `predicates` flag, which is a logical inconsistency and in conflict with what the docstring says (`:param predicates: constrain search to these predicates`). That is to say, any relationship returned when passing the `predicates` flag should also be present if not passing the flag.

## Expected behavior
The command/method should show a warning or throw an error, and possibly also detect if these are mapping predicates and suggest to use that method instead.

Contributor guide

Open the contributing guide

Research direction

Compare the CLI relationships command with the Python API relationships() behavior described in issues 613 and 675. Start by examining how the predicates parameter filters results and how its docstring defines the constraint. Done means invalid predicates are handled consistently with a warning or error, with mapping predicates clearly directed to the mappings command or method.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.