Skip to content

EntityReference typedef: docs & validation inconsistent #512

@joeflack4

Description

@joeflack4

Overview

I'm running sssom validate and was getting an error that my creator_id was invalid. The docs for creator_id show that it is of type EntityReference, typeof: uriorcurie.

However, when I have a URI, creator_id: https://orcid.org/0000-0002-2906-7319, validation fails with:

  File "/Users/joeflack4/virtualenvs/icd11/lib/python3.10/site-packages/sssom/util.py", line 1319, in get_all_prefixes
    raise ValidationError(
jsonschema.exceptions.ValidationError: Slot 'creator_id' has an incorrect value: ['https://orcid.org/0000-0002-2906-7319']

If I change it to a CURIE, validation passes.

Suggested solution

a. Update the docs for EntityReference: typeof: curie.
b. Update get_all_prefixes() so that it ignores metadata slots where the typedef is not simply 'curie'. Or, if it's UriOrCurie, check to make sure at least one is valid.

Additional info

Example files

FYI: docstring issue

The docstring for get_all_prefixes() shows :raises ValidationError: If slot is wrong. twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions