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

lexicalize with entity-label-file fails without helpful message. #708

Open
yayamamo opened this issue Feb 13, 2024 · 0 comments
Open

lexicalize with entity-label-file fails without helpful message. #708

yayamamo opened this issue Feb 13, 2024 · 0 comments

Comments

@yayamamo
Copy link

Describe the bug
When using kgtk lexicalize with the option of --entity-label-file, I encountered the following unclear error.

/Users/myhome/miniconda3/envs/kgtk-env/lib/python3.9/site-packages/kgtk/exceptions.py:90: UserWarning: Please raise KGTKException instead of <class 'SyntaxError'>
  warnings.warn('Please raise KGTKException instead of {}'.format(type_))
KGTKException found

I fed CSKG tab file (cskg.tsv.gz) into kgtk along with an entity-label-file built from the cskg file by extracting node1 and node1;label values.

The entity-label-file entries are unique and no id is duplicated.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://zenodo.org/records/4331372 and obtain cskg.tsv.gz.
  2. kgtk -i cskg.tsv.gz --match "(x)-[r]->(y)" --return "distinct x, x.label"
  3. Generate the entity-label-file by the following perl script.
perl -ne 'BEGIN{print join("\t", ("id", "node1", "label", "node2")), "\n"} chomp; @vals = split /\t/; next if $vals[0] eq "node1"; next if $history{$vals[0]}; $history{$vals[0]}++; $id = $vals[0]."-label" ; print join("\t", ($id, $vals[0], "label", q(").$vals[1].q("))), "\n"'
  1. kgtk lexicalize -i cskg.tsv.gz --isa-properties "/r/IsA" --description-properties "/r/DefinedAs" --property-value "/r/Causes" "/r/UsedFor" --entity-label-file cskg_node1_labels.tsv
  2. See error

Expected behavior
If there's something wrong with my data, I'd like to know the clear reason to fix the data.

Screenshots
no

Desktop (please complete the following information):

  • OS: macOS 12.7.3
  • Python version: 3.9.16
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

1 participant