JBJS - The Journal of Bone & Joint Surgery - missing translator

Hi,

after that JBJS updated their site the site translator doesn't seem to work anymore. For instance this article: http://www.jbjs.org/article.aspx?articleid=35803 gives a folder reference save but doesn't contain the actual article. The overview completely fails: http://www.jbjs.org/issue.aspx
  • I don't know how Zotero supported JBJS in the past, but it is currently using the DOI translator, one of the fallback translators that Zotero uses to get useful data from webpages.

    It would work passably for JBJS, except for the fact that some of the JBJS articles don't have data in the CrossRef DOI registry. This is presumably a mistake on the part of the publishers of JBJS, or the affected articles are too new and the data hasn't yet been submitted.

    Zotero looks here for the data -- and the record isn't yet populated.

    You may want to contact the publisher and report this.
  • They provide meta tags:
    <meta name="citation_journal_title" content="The Journal of Bone and Joint Surgery (American)" /><meta name="citation_journal_abbrev" content="JBJS" /><meta name="citation_title" content="Lumbar Plexus Anatomy within the Psoas Muscle: Implications for the Transpsoas Lateral Approach to the L4-L5 Disc" /><meta name="citation_author" content="Timothy T., Davis" />

    I guess writing some way of collecting this can't be to hard... Can you recommend some translator to use for sandbox?
  • look at this:
    http://www.zotero.org/support/dev/translators/framework
    and do work with Scaffold as mentioned in those instructions.
  • Install Scaffold: http://www.zotero.org/support/dev/translators/scaffold

    Then take a look at the Wiley Online Library translator, which has the logic for all those tags already. If you're a bit comfortable with JavaScript, you should be able to tweak it quickly.

    Otherwise, you can do the same using the framework, which can make the process a bit easier: http://www.zotero.org/support/dev/translators/framework
  • Thank you! Here's the translator: https://gist.github.com/1170782

    Should I post the code somewhere else where it gets picked up?

    I skipped getting the abstract, pdf etc but they use javascript to fetch the pdf and I figured that it's probably more bug-prone with the pdf/fulltext url detection...
  • Take a look at http://github.com/ajlyon/zotero-bits/raw/master/JBJS Am.js and see if it works for you. I did a little cleanup, added abstracts, and added a license. Since it's based on AGPL-licensed code (the Wiley code that I wrote), it needs to be AGPL-licensed, but please confirm that that's OK with you. I'll add this to the repository when you give the word.
  • I'm OK with the AGPL-license. Perhaps a thanks to the other Wiley Online Library creators might be nice?

    Thanks for the help! I'm still new to xpath - watching the code for the abstract is a little like magic :)
  • I didn't include them since I actually completely rewrote the Wiley translator some time back, so that code is all by me. I'll add a note regardless, though.

    And XPath can certainly seem like magic before you get used to it. If you're interested in learning, writing Zotero translators is a great way.
  • Hello,

    I've noticed similar problems with JBJS Br (as of next year known as Bone & Joint) and created a translator: https://gist.github.com/3794237

    I'm a little uncertain of how to handle online & print ISSN, right now I have a ISSNL for the second ISSN meta tag. Is this OK?

    The test for the TOC also complains, I'm not certain to why. Do you have any suggestions?
  • what's the problem with the existing translator?
    Also, there is now a translator called "Silverchair" that covers all journals using the CMS that JBJS (and many others) use - you can see the results in firefox by right-clicking on the translator icon and selecting "Save to Zotero using Silverchair" - how does that look in comparison?
  • The DOI wasn't working for JBJS Br (note, not the Am that this thread previously was about). I think because the article was too recent.

    Didn't know about Silverchair, sounds like a great option. It would still be interesting to know what part of the code is causing issues and how to handle different ISSN numbers correctly.

    Thanks!
  • sorry, the difference between BR and AM didn't register. That site is actually Highwire 2.0 which works very nicely here, but it needs a fix for the target regex (which doesn't accept letters and hyphens in the volume part of the URL).
    I'll push that asap.
    Obviously we prefer to keep the number of translators as small as possible to facilitate maintenance, so I'll not accept this one - though many thanks for contributing.

    There is no clear rule for ISSNs - the Highwire2.0 translator imports both into the ISSN field with a comma. Since there is no ISSNL field, that seems like as good a choice as there is at the moment.

    I don't see why a test would fail for the TOC - what's the error you're getting?
  • just pushed Highwire 2.0
    Your copy of Zotero will auto-update within 24hs or you can update immediately from the General tab of the Zotero preferences.
    Any problems, please let us know.
  • Thanks!

    That there is an Am & Br version is a little funny but thankfully they'll change the name to just Bone & Joint next year.

    The error I got was, though I don't know if it matters now that it's fixed:

    10:58:27 TranslatorTester: Running 1 test for Bone & Joint
    10:58:27
    TranslatorTester: Running Bone & Joint Test 1
    10:58:29 TranslatorTester: Translating http://www.bjj.boneandjoint.org.uk/content/94-B/1.toc
    10:58:29 Translation using Bone & Joint failed:
    fileName => chrome://zotero/content/xpcom/translation/translate.js
    lineNumber => 436
    string => Error: Translator called select items with no items
    stack => @chrome://zotero/content/xpcom/translation/translate.js:436
    doWeb@Bone & Joint:52
    @chrome://zotero/content/xpcom/translation/translate.js:1055
    @chrome://zotero/content/xpcom/translation/translate.js:1562
    @chrome://zotero/content/xpcom/translation/translate.js:1022
    @chrome://zotero/content/xpcom/translation/translate.js:1310
    @chrome://zotero/content/xpcom/translation/translate.js:1022
    @chrome://zotero/content/xpcom/translation/translate.js:1553
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:463
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:399
    @chrome://zotero/content/xpcom/translation/translate.js:868
    @chrome://zotero/content/xpcom/translation/translate.js:1278
    @chrome://zotero/content/xpcom/translation/translate.js:1136
    @chrome://zotero/content/xpcom/translation/translate.js:1684
    @chrome://zotero/content/xpcom/translation/translate.js:839
    @chrome://zotero/content/xpcom/translation/translate.js:1269
    @chrome://zotero/content/xpcom/translation/translate.js:1250
    @chrome://zotero/content/xpcom/translation/translate.js:1310
    @chrome://zotero/content/xpcom/translation/translate.js:1250
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:445
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:354
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:367
    @chrome://zotero/content/xpcom/http.js:548

    url => http://www.bjj.boneandjoint.org.uk/content/94-B/1.toc
    downloadAssociatedFiles => true
    automaticSnapshots => true
    10:58:29 TranslatorTester: Bone & Joint Test 1: failed (Translation failed: Error: Translator called select items with no items
    fileName => chrome://zotero/content/xpcom/translation/translate.js
    lineNumber => 436
    stack => @chrome://zotero/content/xpcom/translation/translate.js:436
    doWeb@Bone & Joint:52
    @chrome://zotero/content/xpcom/translation/translate.js:1055
    @chrome://zotero/content/xpcom/translation/translate.js:1562
    @chrome://zotero/content/xpcom/translation/translate.js:1022
    @chrome://zotero/content/xpcom/translation/translate.js:1310
    @chrome://zotero/content/xpcom/translation/translate.js:1022
    @chrome://zotero/content/xpcom/translation/translate.js:1553
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:463
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:399
    @chrome://zotero/content/xpcom/translation/translate.js:868
    @chrome://zotero/content/xpcom/translation/translate.js:1278
    @chrome://zotero/content/xpcom/translation/translate.js:1136
    @chrome://zotero/content/xpcom/translation/translate.js:1684
    @chrome://zotero/content/xpcom/translation/translate.js:839
    @chrome://zotero/content/xpcom/translation/translate.js:1269
    @chrome://zotero/content/xpcom/translation/translate.js:1250
    @chrome://zotero/content/xpcom/translation/translate.js:1310
    @chrome://zotero/content/xpcom/translation/translate.js:1250
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:445
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:354
    @chrome://zotero/content/tools/testTranslators/translatorTester.js:367
    @chrome://zotero/content/xpcom/http.js:548
    )
  • Assuming that testing the page manually with your translator works
    that usually happens when the test tries to translate before the site is fully loaded. It's sometimes possible to fix this by adding
    "defer": true,
    to the test as in:
    "type": "web",
    "defer": true,
    "url": "http://www.bjj.boneandjoint.org.uk/content/94-B/1.toc",
    "items": "multiple"

    maybe that works. If it doesn't it's no big deal - for a translator that makes it to the repository, just add an issue with the exact translator name first describing that and it will come up as a comment on the automatic testing page:
    http://zotero-translator-tests.s3-website-us-east-1.amazonaws.com/testTranslators.html#date=2012-09-28&browser=g&version=3.0.SOURCE.bd75d95

    see e.g. this on APA Psycnet:
    https://github.com/zotero/translators/issues/462
  • Thank you, I figured it was something like that.

    Thanks again for awesome work :-)
Sign In or Register to comment.