bibimbap-io / bibimbap

A tool to import BibTeX entries from various sources
BSD 2-Clause "Simplified" License
10 stars 1 forks source link

"failed to parse JSON input" #3

Closed jowens closed 11 years ago

jowens commented 11 years ago

Loaded my large bibliography, searched on it. Not sure what the error message indicates; some searches spit it out, some don't. A more meaningful message would help?

bibimbap> search optix

failed to parse JSON input (line 1, column 491)
{ "result":{ "query":"optix", "status":{ "@code":"12", "text":"OK" }, "time":{ "@unit":"msecs", "text":"0.34" }, "completions":{ "@total":"1", "@computed":"1", "@sent":"1", "c":{ "@sc":"4", "@dc":"2", "@oc":"2", "@id":"12082590", "text":"optix" } }, "hits":{ "@total":"2", "@computed":"2", "@sent":"2", "@first":"0", "hit":[ { "@score":"2", "@id":"1417448", "info":{ "authors":{ "author":[ "Austin Robison"]}, "title":{ "Domain specific compilation in the NVIDIA OptiX ray tracing engine. "}, "venue":"DAMP 2011:1-2", "year":"2011", "type":"inproceedings"}, "url":"http://www.dblp.org/rec/bibtex/conf/popl/Robison11" }, { "@score":"2", "@id":"1571143", "info":{ "authors":{ "author":[ "Steven G. Parker", "James Bigler", "Andreas Dietrich", "Heiko Friedrich", "Jared Hoberock", "David P. Luebke", "David K. McAllister", "Morgan McGuire", "R. Keith Morley", "Austin Robison", "Martin Stich"]}, "title":"OptiX: a general purpose ray tracing engine. ", "venue":"ACM Trans. Graph. (TOG) 29(4) (2010)", "year":"2010", "type":"article"}, "url":"http://www.dblp.org/rec/bibtex/journals/tog/ParkerBDFHLMMMRS10" } ] } } }
[0] {NVIDIA}, "{NVIDIA}\textregistered {OptiX} Application Acceleration Engine", ?, 2009
[1] A.Robison, "Scheduling in {OptiX}: The {NVIDIA} ray tracing engine", ?, 2009
[2] S.G.Parker et al., "{OptiX}: A General Purpose Ray Tracing Engine", ACM Transactions on Graphics, 2010
psuter commented 11 years ago

The search tasks dispatches your query to all sources by default. The error comes from DBLP, which (as of recently) indeed returns invalid JSON (the { ... } around the title in some cases). I have a hard time understanding when they return malformed strings and when they don't, but have contacted them about the issue.

Note that if you want to search only in your imported file, you can disable the other sources (most likely, the Lucene cache and DBLP).

jowens commented 11 years ago

OK. Feel free to close it out, but a message that indicates this is a DBLP issue would probably be sensible.

psuter commented 11 years ago

That's a good point. I'm also writing a work-around (i.e. making the JSON parser more tolerant), because it currently makes bibimbap almost useless as a search proxy.

psuter commented 11 years ago

Commit 1eafccd introduces the fix.

psuter commented 11 years ago

By the way, any chance you could share your "large bibliography"? I'm testing proper LaTeX parsing these days and would welcome more testcases.

jowens commented 11 years ago

Permission granted, check your email.

psuter commented 11 years ago

Thanks! Large indeed!

jowens commented 11 years ago

And every entry has been battle-tested, advisor-approved. :)