ParasiteTracker / tpt-reporting

Terrestrial Parasite Tracking Reporting Methods
MIT License
0 stars 0 forks source link

null interactionTypeNameVerbatim mapping #14

Open seltmann opened 4 years ago

seltmann commented 4 years ago

@jhpoelen Kat and I were looking at the reports and we think null interactionType NameVerbatim is being mapped to null by default. Can we have this mapped default to interactsWith? Code: $ elton review --no-header globalbioticinteractions/ucsb-izc | cut -f15 | jq -c '.context | { in: .interactionTypeNameVerbatim, out: .interactionTypeName}' | sort | uniq -c

Resulting in: creating review [globalbioticinteractions/ucsb-izc]... done. 1221 {"in":"associated with","out":"interactsWith"} 2 {"in":"ex","out":"hasHost"} 1 {"in":"inside","out":"interactsWith"} 14 {"in":"visits","out":"visits"} 23 {"in":"visitsFlowersOf","out":"visitsFlowersOf"} 1 {"in":null,"out":"Centromadia parryi subsp. australis"} 386 {"in":null,"out":null}

jhpoelen commented 4 years ago

@seltmann thanks for sharing your question / suggestions. To help expedite this, can you include one or two examples of related record contexts?

jhpoelen commented 4 years ago

e.g.,

$ elton review --no-header globalbioticinteractions/ucsb-izc | cut -f15 | jq -c '.context | { in: .interactionTypeNameVerbatim, out: .interactionTypeName}' | grep null | head -n2
jhpoelen commented 4 years ago

Here a way to select jq objects with specific values:

elton review --no-header globalbioticinteractions/ucsb-izc | cut -f15 | jq --compact-output "select(.context.interactionTypeName == null)" | head -n1 | jq .

you can also pipe this result into an object:

elton review --no-header globalbioticinteractions/ucsb-izc | cut -f15 | jq --compact-output "select(.context.interactionTypeName == null) | { in: ... }"
seltmann commented 4 years ago

This is the review result based on above code. null-interactions.txt but I do not believe matches the result of 386 {"in":null,"out":null}.

Also, I reran the reports for ucsb-izc and the interactionTypeNameVerbatim does not appear in the report. The next file is one of the records reported in the 386 (by including sourceOccurrenceId). example.txt

jhpoelen commented 4 years ago

@seltmann Thanks for providing the example. I was able to reproduce that occurrence id ff61e265-5e5a-42ae-bda5-2f9c8539b2a8 had a "null" interactionType in the review, but was populated with default (e.g., interactedWith) in when running elton interactions globalbioticinteractions/ucsb-izc.

I've opened a separate issue at https://github.com/globalbioticinteractions/elton/issues/34 .