frostyfan109 / tranql

A Translator Query Language
https://researchsoftwareinstitute.github.io/data-translator/apps/tranql
MIT License
0 stars 1 forks source link

A considerable amount of nodes are being dropped from queries #91

Closed frostyfan109 closed 5 years ago

frostyfan109 commented 5 years ago

Tested specifically on

set chemical = "CHEMBL:CHEMBL1261" -- Citric acid
SELECT chemical_substance->disease->gene
    FROM "/schema"
 WHERE chemical_substance=$chemical

~1200 nodes and ~5000 edges are present in the knowledge graph. However, when rendered, this number drops down to ~400 nodes and ~700 edges. This is because nodes are being dropped at some point during the query and are no longer present in the knowledge graph. This means that all those nodes and their respective edges must be dropped from the query as well. This is probably a problem in the answer merging, but could be something else.

frostyfan109 commented 5 years ago

After testing, I've narrowed it down to the deep merging method of nodes/edges. Not sure what about the deep_merge method causes this behavior but it does.

Update: It is specifically being caused by the deep merging of nodes, not edges.

Update 2: Deep merging on nodes may have to be removed, as there is no apparent cause of the breakage but it is certainly breaking it.

Update 3: The problem has been found. Both nodes would end up with the same id post merge, I had believed that it only mutated the destination object.

frostyfan109 commented 5 years ago

Fixed. I'm still not entirely sure why it was happening but it no longer does.