chrismheiser / lipdnet

All things related to Lipd.net and the LiPD Playground
http://www.lipd.net
1 stars 1 forks source link

JSON-LD parsing error #45

Closed nickmckay closed 6 years ago

nickmckay commented 6 years ago

This file loads fine into R or Matlab, but fails on loading onto the playground. Looking at the JSON-LD, my hunch is that it might be related to some weird characters in the calibration equation section.

chrismheiser commented 6 years ago
screen shot 2018-08-17 at 9 20 33 am

Yes, JSON lint says that is not valid JSON. Removing those characters and repacking the file works fine on the playground

chrismheiser commented 6 years ago

MS07RCNA.zip

nickmckay commented 6 years ago

So how should we handle this? I like the behaviour of R and Matlab, that it will still load. How hard would it be to remove weird characters on loading?

chrismheiser commented 6 years ago

It already attempts to remove weird characters on load through common characters that have shown up so far, but it doesn't account for everything. There seem to be more weird characters popping up as time goes on. I don't know of a proactive way to handle it.

nickmckay commented 6 years ago

OK. Could we expand that error message to mention that strange characters might be a problem? I'm trying to think about how the regular user might handle this.

What might be ideal (but maybe more work than it's worth) would be for the playground to popup an editable text window that shows the JSON-LD, and the user can search for, and edit out weird characters, then pass that on.

Is that a possibility?

chrismheiser commented 6 years ago

That's a very interesting idea. Or at least show the JSON-LD, tell them the verify it on JSON lint since it'll highlight the issue right away, and copy the valid JSON-LD back into the window.

nickmckay commented 6 years ago

Yeah. In general, I can imagine a button that shows the JSON-LD as being a useful tool for expert users.

Thanks for looking into this.

nickmckay commented 6 years ago

And allows editing, I mean. I know we can see it already.