Rothamsted / knetbuilder

KnetBuilder data integration platform for building knowledge graphs. Previously known as ondex.
https://knetminer.com
MIT License
12 stars 11 forks source link

Cytoscape/JSON exporter, abbreviated concept names clash with colour highlights #70

Closed marco-brandizi closed 2 years ago

marco-brandizi commented 2 years ago

I discovered this while working on Rothamsted/knetminer#673. AddConceptNodeInfo abbreviated the exported concept label to 33 characters (including the auto-added '...'), see getNodeJson() here.

This is error-prone, since the concept names might come in with highlighting markings like:

Hello, <span style="background-color: #011A0F"><b>World</b></span>!

the abbreviation could cut away relevant HTML wrappers and garble everything. A possible solution might be taking spanIdx = name.lastIndexOf ( "</span>" ) + "</span>".length() and use min ( 33, spanIdx ) as the abbreviation cutoff.

As a side note, all the rest of Knetminer abbreviates at 63.

marco-brandizi commented 2 years ago

OK, my misatke, this isn't actually an issue, since the code uses JSoup to threat the concept name as HTML and eventually extract the text only. Closing it. I'm leaving the abbreviation cutoff at 33, seems safer for graph labels.