ModellingWebLab / WebLab

Django-based front-end for the modelling Web Lab v2
Other
3 stars 2 forks source link

Annotation editor adds newlines in RDF meta data #364

Open MichaelClerx opened 3 years ago

MichaelClerx commented 3 years ago

jafri_rice_winslow_1998_a.zip

Annotating the above file reformats

<rdf:value xml:lang="en">The reversal potential for the background sodium channel.</rdf:value>

as

<rdf:value xml:lang="en">The reversal potential for the background sodium channel.
</rdf:value>

Annotating the new file again results in

<rdf:value xml:lang="en">The reversal potential for the background sodium channel.

</rdf:value>

And annotating a third time:

<rdf:value xml:lang="en">The reversal potential for the background sodium channel.

</rdf:value>
MichaelClerx commented 3 years ago

In a real life case I also found

            <rdf:value xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">The reversal potential for the background sodium channel.&#xd;
&#xd;
&#xd;
</rdf:value>

So that's either a separate issue, or some WL issue I can't recreate (I tried using the annotating tool under windows, but that didn't do it)

which suggests some problem with line ending conversion (&#xd; apparently means d = 13 = Return in ascii?) But also suggests some OpenCOR interaction, since the RDF is formatted nicely (which opencor does but WL does not)

MauriceHendrix commented 3 years ago

Does the edit atually strip out the closing </rdf:Description> if so than that should be a showstopping bug.

The extra carriage returns could indeed be a case of line enging conversion. If you keep getting more every time you edit than it may be something else, either it actually adds a new line, or the library used does and it needs stripping before saving.

MichaelClerx commented 3 years ago

Does the edit atually strip out the closing </rdf:Description> if so than that should be a showstopping bug.

Thanks! That was a copy-pasting mistake. I've updated the post above to remove it

MichaelClerx commented 3 years ago

I'm not sure how the annotation editor even works. Is it javascript that edits the files?

I haven't really looked at it but given the UI I strongly suspect that that's probably the case.