Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Data dictionary model allows for a continuous BIDS column to have categorical Neurobagel annotations #152

Open
1 task done
surchs opened this issue Jun 10, 2023 · 2 comments
Labels
_flag:stale [BOT ONLY] Flag issue that hasn't been updated in a while and needs to be triaged again

Comments

@surchs
Copy link
Contributor

surchs commented Jun 10, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

"sex": {
        "Annotations": {
            "IsAbout": {
                "TermURL": "nb:Sex",
                "Label": ""
            },
            "Levels": {
                "F": {
                    "TermURL": "snomed:248152002",
                    "Label": ""
                },
                "M": {
                    "TermURL": "snomed:248153007",
                    "Label": ""
                }
            }
        },
        "Description": "There should have been a description here, but there wasn't. :("
    }

is a valid data dictionary entry for a categorical column under our current data model for data dictionaries.
However, notice that this example does not have a "Levels" attribute in the BIDS part (i.e. outside of our "Annotations" key).

Here is what I believe happens:

  1. The Column type validates as continuous because there are no required attributes for continuous columns except "Description"and"Annotation"`
    class ContinuousColumn(Column):
    """A BIDS column annotation for a continuous column"""
    units: str = Field(
    None,
    description="Measurement units for the values in this column. "
    "SI units in CMIXF formatting are RECOMMENDED (see Units)",
    alias="Units",
    )

    (that might be its own issue)
  2. The portion inside the "Annotations" key gets validates as CategoricalNeurobagel because it has the levels stuff
    class CategoricalNeurobagel(Neurobagel):
    """A Neurobagel annotation for a categorical column"""
    levels: Dict[str, Identifier] = Field(
    ...,
    description="For categorical variables: "
    "An object of values (keys) in the column and the semantic"
    "term (URI and label) they are unambiguously mapped to.",
    alias="Levels",
    )
  3. Because we simply say: Annotations have to be either ContinousNeurobagel OR CategoricalNeurobagel, this is all valid:
    annotations: Union[CategoricalNeurobagel, ContinuousNeurobagel] = Field(
    ..., description="Semantic annotations", alias="Annotations"
    )

I think we have a couple of options here:

  • completely abandon the distinction of categorical and/or continuous columns for the BIDS part of the dictionary.
  • give the continuous column something that isn't optional (DONE, see [BUG] data dictionary schema let's anything with an annotation pass #151)
  • hard-link each column to the specific neurobagel column they should have and only inherit description from the Column class (probably the cleanest)

Current Behavior

No response

Error message

No response

Environment

  • OS:
  • Python/Node version:

How to reproduce

No response

Anything else?

No response

@surchs surchs added the type:bug Defects in shipped code and fixes for those defects label Jun 10, 2023
@alyssadai alyssadai moved this to Implement - Active in Neurobagel Jun 15, 2023
@alyssadai alyssadai moved this from Implement - Active to Specify - Active in Neurobagel Jun 15, 2023
@alyssadai alyssadai moved this from Specify - Active to Implement - Track in Neurobagel Jun 20, 2023
@alyssadai alyssadai moved this from Implement - Track to Backlog in Neurobagel Jun 20, 2023
@surchs surchs removed the status in Neurobagel Jun 28, 2023
@github-actions
Copy link

We want to keep our issues up to date and active. This issue hasn't seen any activity in the last 30 days.
We have applied the stale-issue label to indicate that this issue should be reviewed again and then either prioritized or closed.

@github-actions github-actions bot added the _flag:stale [BOT ONLY] Flag issue that hasn't been updated in a while and needs to be triaged again label Jul 20, 2023
@github-actions
Copy link

We want to keep our issues up to date and active. This issue hasn't seen any activity in the last 30 days.
We have applied the stale-issue label to indicate that this issue should be reviewed again and then either prioritized or closed.

@surchs surchs removed the type:bug Defects in shipped code and fixes for those defects label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
_flag:stale [BOT ONLY] Flag issue that hasn't been updated in a while and needs to be triaged again
Projects
Status: No status
Development

No branches or pull requests

1 participant