ISWC-Reproducibility-Track / Paper_608

0 stars 0 forks source link

Example3 - Reachability #4

Open angelosalatino opened 4 years ago

angelosalatino commented 4 years ago

Hi,

I am running this notebook from docker. In particular when running the cell:

%%bash
kgtk reachable_nodes --subj 1 --pred 2 --obj 3 --props P106,P279 --root "Q8023,Q483203,Q1426" cat.tsv > reachable.tsv

I get:

/opt/conda/lib/python3.7/site-packages/kgtk-0.4.0-py3.7.egg/kgtk/exceptions.py:60: UserWarning: Please raise KGTKException instead of <class 'KeyError'>
  warnings.warn('Please raise KGTKException instead of {}'.format(type_))
KGTKException found

I can't figure out why it is launching this exception. I checked the file reachable.tsv, it get created but is empty. @dgarijo

dgarijo commented 4 years ago

Thanks @angelosalatino, it may be an exception with the new reader (we tested all notebooks before the ISWC submission, but we have been pushing more updates since). I think we need a version of the notebooks that are lighter, because for testing purposes it's quite tricky to operate on the full Wikidata

Let me discuss with the team and get back to you.

dgarijo commented 4 years ago

@angelosalatino can you please try:

kgtk reachable_nodes --props P106,P279 --root "Q8023,Q483203,Q1426" cat.tsv > reachable.tsv

I am trying to reproduce the error locally, but it's taking a while to produce results. Please try this solution and let me know if it helps

dgarijo commented 4 years ago

Sorry, I just tried it myself and it still does not work. I am looking for another solution

dgarijo commented 4 years ago

@angelosalatino, I have tested this out and we have fixed this problem on our latest dev branch, which is not yet merged into the main one. If you try this docker image, everything will work fine: uscisii2/kgtk:latest-dev. You will have to change the command slightly to be kgtk reachable-nodes --props P106,P279 --root "Q8023,Q483203,Q1426" -i cat.tsv > reachable.tsv

If you want to avoid re-running all the notebook, I suggest copying the results you obtained into your local machine and then running only the reachable nodes command.

To copy the files of a started container to your local machine, you can do: docker cp 499cb3354b54:/test/subclass.tsv ., where 499cb3354b54 is the id of the container you have running and /test/cat.tsv is the file in the container.

Alternatively, I also put online the results after my execution (except the reachable nodes, so you can test yourself), here: https://data.mint.isi.edu/files/Notebook3/

angelosalatino commented 4 years ago

Perfect. This solution worked. Thank you Daniel