-
Notifications
You must be signed in to change notification settings - Fork 12
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
EntityReference
typedef: docs & validation inconsistent
#512
Comments
This is a confusing problem of linkml for me.. The type is really I guess this will have to be documented much much better. |
Ah, that is not what I expected. That kind of conditional type def is tricky to express, but it also comes off like a code smell. Perhaps we could make Maybe can just update the description on it in the documentation to say exactly what you said:
|
I made a PR about this: mapping-commons/sssom#358 We cant do anything else right now, so I will close this issue here, but I expect the PR to raise some eyebrows and subsequent dialogues. |
…358) Resolves mapping-commons/sssom-py#512 - [X] `docs/` have been added/updated if necessary The documentation for "entity references" is largely confusing, and leading, in its current form, to the expectation that metadata fields types with these can be _either_ a CURIE _or_ a full URI. This is not quite right: in the TSV serialistion, as well as JSON, we expect the values to be CURIE-strings. This PR documents this design decision, but, as @joeflack4 puts it rightfully, this has a bit of a "smell" to it. Not sure what the right thing is here, but this documentation here is certainly better than not having it.
Overview
I'm running
sssom validate
and was getting an error that mycreator_id
was invalid. The docs forcreator_id
show that it is of typeEntityReference
,typeof: uriorcurie
.However, when I have a URI,
creator_id: https://orcid.org/0000-0002-2906-7319
, validation fails with: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.The text was updated successfully, but these errors were encountered: