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

Problem with adding ORCIDs as data_list_vars #418

Closed
rays22 opened this issue Jun 27, 2022 · 14 comments
Closed

Problem with adding ORCIDs as data_list_vars #418

rays22 opened this issue Jun 27, 2022 · 14 comments
Assignees

Comments

@rays22
Copy link

rays22 commented Jun 27, 2022

I am trying to add a list of ORCIDs 'data_list_vars' without success.

It seems to me that only the DOS-DP OBO fields work with data_list_vars. Adding a list of contributors using data_list_vars did not work for me.

files to reproduce the problem: issue418-test-files.zip

  1. test_data_list_vars.yaml
    • validation: PASS
dosdp validate -i test_data_list_vars.yaml
INFO:root:Checking test_data_list_vars.yaml
INFO:root:Validation completed without any issues to report.
  1. test_data_list_vars.tsv

When I check definitions.owl after turning the template table into OWL axioms, I do not find any of the dcterms:contributor ORCID data, or the synonyms from the tsv table that I am trying to add under annotations.
Please, note that I can add synonyms as data_list_vars in another way ( see syns2 and the comments in 'test_data_list_vars.yaml').

@dosumis
Copy link

dosumis commented Jun 27, 2022 via email

@rays22
Copy link
Author

rays22 commented Jun 27, 2022

Test DOS-DP pattern files:

  1. test_data_vars.yaml:

Adding data_list_vars

exact_synonym:
  value: syns

works all right.

dosdp validate -i test_data_vars.yaml        
INFO:root:Checking test_data_vars.yaml
INFO:root:Validation completed without any issues to report.
  1. test_data_list_vars.yaml

Adding another annotation type does not seem to work.

dosdp validate -i test_data_list_vars.yaml
INFO:root:Checking test_data_list_vars.yaml
/Users/ray/py_tools/venv/lib/python3.9/site-packages/dosdp/validator.py:30: UserWarning:deque(['additionalProperties']) => Additional properties are not allowed ('contributor' was unexpected) => []
INFO:root:Validation completed with issues to be fixed.

@hkir-dev hkir-dev self-assigned this Jun 27, 2022
@rays22
Copy link
Author

rays22 commented Jun 27, 2022

I have updated the test files to help reproduce the problem and tried to clarify the issue in the description above.

@balhoff
Copy link
Member

balhoff commented Jun 27, 2022

@rays22 are you defining the prefix dcterms: when running your command?

@rays22
Copy link
Author

rays22 commented Jun 27, 2022

@rays22 are you defining the prefix dcterms: when running your command?

I am not sure if I understand your question @balhoff .
No, I am not defining it explicitly dcterms: or other prefixes when I am running my make command:

sh run.sh make ../patterns/definitions.owl -B IMP=false

Here is the relevant part of my yaml:

annotationProperties:
  exact_synonym: oio:hasExactSynonym
  contributor: dcterms:contributor

vars:
  chemical: "'chemical entity'"

data_list_vars:
  syns: xsd:string   # placeholder for synonym list
  syns2: xsd:string   # placeholder for synonym list
  orcid: xsd:string  # ORCID of contributor

name:
  text: "trait in response to %s"
  vars:
    - chemical

annotations:
  - annotationProperty: exact_synonym
    text: "response to %s trait"
    vars:
      - chemical

  - annotationProperty: contributor
    value: orcid

  - annotationProperty: exact_synonym  # this does not work 
    value: syns  # this does not work

exact_synonym:  # this works
  value: syns2   # this works

@balhoff
Copy link
Member

balhoff commented Jun 27, 2022

If you look for the command line that is executed when dosdp-tools is run by your makefile, you can see if it has some options like dosdp-tools --prefixes=prefixes.yaml or dosdp-tools --obo-prefixes=true. obo-prefixes turns on some standard prefixes, but dcterms is not one of them. If your command is using --obo-prefixes, you could change your pattern to use dct instead; that one is defined. Or pass your prefixes to the command. If this turns out to be the problem, let me know and leave this issue open, and I will try to improve the error reporting.

@dosumis
Copy link

dosumis commented Jun 27, 2022

Sorry for my quick reply by email earlier. Screenshot fix didn't make it into the comment.

This fail is due to the fact there is not contributor key in the spec:

dosdp validate -i test_data_list_vars.yaml
INFO:root:Checking test_data_list_vars.yaml
/Users/ray/py_tools/venv/lib/python3.9/site-packages/dosdp/validator.py:30: UserWarning:deque(['additionalProperties']) => Additional properties are not allowed ('contributor' was unexpected) => []
INFO:root:Validation completed with issues to be fixed.

Looks like you fixed that subsequently and are now correctly using they value key under annotations.

  - annotationProperty: contributor
    value: orcid

This should work, but as Jim pointed out, you need to define a prefix for dcterms so that this can be read:

annotationProperties:
  exact_synonym: oio:hasExactSynonym
  contributor: dcterms:contributor

IIRC, you don't need one for oio because its defined in the default prefix set for OBO.

@rays22
Copy link
Author

rays22 commented Jun 27, 2022

Thanks for the explanation @balhoff .
The Makefile has the obo-prefixes=true options.
I should note that oio:hasExactSynonym also fails under the annotations.
I am also able to add single dcterms:contributor annotations as data_vars without any problem.

@balhoff
Copy link
Member

balhoff commented Jun 27, 2022

@rays22 thanks, I ran your test file and I now see that this is a bug that was fixed a while back in #405. It seems to work fine in the current release. Put some pressure on @matentzn to make an ODK release including this PR: INCATools/ontology-development-kit#575 😛

@balhoff
Copy link
Member

balhoff commented Jun 27, 2022

@rays22 oh by the way the prefix issue still stands; if you don't provide it you will get incorrect expansions for contributor as seen here:

AnnotationAssertion(<http://purl.obolibrary.org/obo/dcterms_contributor> <http://purl.obolibrary.org/obo/OBA_9999990> "https://orcid.org/0000-0001-8314-2140"^^xsd:string)

dosdp-tools should keep a list of OBO prefixes instead of defaulting to that when you pass that option.

@rays22
Copy link
Author

rays22 commented Jun 27, 2022

Thanks @balhoff and @dosumis .
I will change the prefix.

@rays22
Copy link
Author

rays22 commented Jun 27, 2022

@rays22 rays22 closed this as completed Jun 27, 2022
@balhoff
Copy link
Member

balhoff commented Jun 27, 2022

@rays22 I forgot, there WAS an ODK release recently: https://github.com/INCATools/ontology-development-kit/releases/tag/v1.3.1

So you just need to update to the latest version (sorry @matentzn)

@rays22
Copy link
Author

rays22 commented Jun 28, 2022

I can confirm that my data_list_vars issues are fixed after updating obolibrary/odkfull to the latest version.
Thanks @balhoff .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants