-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference page not correctly displaying article title. #655
Comments
@malcolmfisher103 Huh, nice catch. Let me look into that. |
It seems like it might be due to the embedded markup in the title. Digging into the JS a little: jxon = require('jxon');
str = '<PubmedArticleSet><PubmedArticle><MedlineCitation Status="MEDLINE" Owner="NLM"><PMID Version="1">30352852</PMID><DateCompleted><Year>2019</Year><Month>05</Month><Day>22</Day></DateCompleted><DateRevised><Year>2019</Year><Month>05</Month><Day>22</Day></DateRevised><Article PubModel="Print-Electronic"><Journal><ISSN IssnType="Electronic">1091-6490</ISSN><JournalIssue CitedMedium="Internet"><Volume>115</Volume><Issue>45</Issue><PubDate><Year>2018</Year><Month>11</Month><Day>06</Day></PubDate></JournalIssue><Title>Proceedings of the National Academy of Sciences of the United States of America</Title><ISOAbbreviation>Proc Natl Acad Sci U S A</ISOAbbreviation></Journal><ArticleTitle>Evolutionarily conserved <i>Tbx5</i>-<i>Wnt2/2b</i> pathway orchestrates cardiopulmonary development.</ArticleTitle></MedlineCitation></PubmedArticle></PubmedArticleSet>';
j = jxon.stringToJs(str);
j.PubmedArticleSet.PubmedArticle.MedlineCitation.Article.ArticleTitle Returns: { i: [ 'Tbx5', 'Wnt2/2b' ],
_: 'Evolutionarily conserved-pathway orchestrates cardiopulmonary development.' } from string: Either way, I suspect this is limited to titles with embedded features and if maybe just the |
@pgaudet Correct, from the examples above. They can be removed, but the JSON, as it stands, does not allow for a correct title to be extracted. We'd have to crack open the hood and have a fall-through case (or otherwise switch) to scanning the returned XML some other way. |
Randomly dove down this rabbit hole and thought I should post what I found. Pubmed's database+api looks to be a little less feature rich than Pubmed Central's and so there's some interesting data storage formats here and some response types which aren't fully supported such as a JSON response that contains the AbstractText data (which is also affected in this particular article's case). There's not necessarily a quick fix available off the shelf but there are a couple of options:
Got any opinion on one of these options or an alternative? Want assistance? |
Thank you @AlexanderNull for taking a bit of a look at this. I suspect the right answer is in the neighborhood of your "3": dig out the area around title by some method, maybe jxon still, and then convert it to a string without jxon's (frankly) incorrect method. I think the hack here was trying to do this with old in-browser libs (as jxon is rather out-of-date now). |
Even without changing the rest client we could take the raw results and instead of passing them to jxon, pass them to the built in DOMParser (the native object that caused all JXON support to be dropped from official specs). Using something like this around amigo/javascript/web/ReferenceDetails.js Line 279 in 386c405
document.querySelector has support all the way back to Chrome V1 so that shouldn't present any issues. This approach actually provides a double benefit as the document object contents can either be accessed via the What do you think about this approach? I don't have all of AmiGO running locally yet but it seems like a pretty straightforward switch and the added sanitization is nice. |
@AlexanderNull That sounds like a good strategy: bypassing the faulty jxon after the REST call. If you can give me a little more context for the code or a mock PR, I can get it in and test if NP from my end. AmiGO can be tricky to build and work with these days (although some fixes there imminent). |
The reference page http://amigo.geneontology.org/amigo/reference/PMID:30352852 displays the article title as '[object Object]' rather than 'Evolutionarily conserved Tbx5- Wnt2/2b pathway orchestrates cardiopulmonary development'.
The text was updated successfully, but these errors were encountered: