OpenTreeOfLife / phylografter

web2py app for tree store and grafting
Other
6 stars 4 forks source link

invalid export of nexson: tree's edge referring to a non-existent node ID #97

Closed mtholder closed 10 years ago

mtholder commented 10 years ago

Getting the NeXSON for study using the study/export_gzipNexSON.json web service call results in:

[snip] "@id": "tree274", "edge": [ { "@id": "edge190736", "@source": "node3", "@target": "node190736" }, [snip]

but the source node for this edge (node3) is not an ID that I can find in the file.

pmidford commented 10 years ago

I'll have a look at this. -Peter

On Jan 9, 2014, at 11:12 AM, "Mark T. Holder" notifications@github.com wrote:

Getting the NeXSON for study using the study/export_gzipNexSON.json web service call results in: ####################### [snip] "@id": "tree274", "edge": [ { "@id": "edge190736", "@source": "node3", "@target": "node190736" }, [snip] ###################### but the source node for this edge (node3) is not an ID that I can find in the file.

— Reply to this email directly or view it on GitHub.

pmidford commented 10 years ago

There seems to be something broken in the database:

mysql> select parent from snode where id = 190736; +--------+ | parent | +--------+ | 3 | +--------+ 1 row in set (0.00 sec)

but mysql> select tree from snode where id = 3; +------+ | tree | +------+ | 1 | +------+ 1 row in set (0.00 sec)

Rick - what's the best way to proceed here?

-Peter

On Jan 9, 2014, at 11:13 AM, Peter Midford peter.midford@gmail.com wrote:

I'll have a look at this. -Peter

On Jan 9, 2014, at 11:12 AM, "Mark T. Holder" notifications@github.com wrote:

Getting the NeXSON for study using the study/export_gzipNexSON.json web service call results in: ####################### [snip] "@id": "tree274", "edge": [ { "@id": "edge190736", "@source": "node3", "@target": "node190736" }, [snip] ###################### but the source node for this edge (node3) is not an ID that I can find in the file.

— Reply to this email directly or view it on GitHub.

rhr commented 10 years ago

Strange - snode 190736 is the root node of stree 274 and its parent should be NULL. There seems to be 11 cases like this. I'll fix them manually in the db and hope that it doesn't happen again...

On Thu, Jan 9, 2014 at 10:25 AM, Peter Midford notifications@github.comwrote:

There seems to be something broken in the database:

mysql> select parent from snode where id = 190736; +--------+ | parent | +--------+ | 3 | +--------+ 1 row in set (0.00 sec)

but mysql> select tree from snode where id = 3; +------+ | tree | +------+ | 1 | +------+ 1 row in set (0.00 sec)

Rick - what's the best way to proceed here?

-Peter

On Jan 9, 2014, at 11:13 AM, Peter Midford peter.midford@gmail.com wrote:

I'll have a look at this. -Peter

On Jan 9, 2014, at 11:12 AM, "Mark T. Holder" notifications@github.com wrote:

Getting the NeXSON for study using the study/export_gzipNexSON.json web service call results in: ####################### [snip] "@id": "tree274", "edge": [ { "@id": "edge190736", "@source": "node3", "@target": "node190736" }, [snip] ###################### but the source node for this edge (node3) is not an ID that I can find in the file.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/OpenTreeOfLife/phylografter/issues/97#issuecomment-31949018 .

rhr commented 10 years ago

Database is updated now and new sql dump being generated. To update a local mysql instance, do

update snode set parent = NULL where next = 1 and parent IS NOT NULL;