Page MenuHomePhabricator

Enable Primo.js translator for Zotero
Closed, ResolvedPublic

Description

Merhav is a catalogue system used by the National Library of Israel (NLI) with very rich data on various books. It is supported by Zotero using Primo scrapper which gives it correctly itemType: book. However Citoid gives it wrong itemType of webpage which prevents us from using its rich data.

For example:
http://merhav.nli.org.il/primo_library/libweb/action/display.do?tabs=detailsTab&ct=display&fn=search&doc=ULI_Main007372993&indx=6&recIds=ULI_Main007372993&recIdxs=5&elementId=5&renderMode=poppedOut&displayMode=full&frbrVersion=&dscnt=0&scp.scps=scope%3A%28ULI_Main%29

And the result of citoid:
citoid.wikimedia.org/api?format=mediawiki&search=http://merhav.nli.org.il/primo_library/libweb/action/display.do?tabs=detailsTab&ct=display&fn=search&doc=ULI_Main007372993&indx=6&recIds=ULI_Main007372993&recIdxs=5&elementId=5&renderMode=poppedOut&displayMode=full&frbrVersion=&dscnt=0&scp.scps=scope%3A%28ULI_Main%29

Expected result (using Primo with Zotero plugin for firefox):

[
	{
		"type": "book",
		"title": "Harry Potter and the deathly hallows / by J. K. Rowling ; ill. by Mary Grandpre.",
		"publisher": "Arthur ALevine Books",
		"publisher-place": "New York, NY",
		"edition": "1st ed.",
		"source": "Primo",
		"event-place": "New York, NY",
		"ISBN": "978-0-545-01022-1",
		"language": "eng",
		"author": [
			{
				"family": "Rowling",
				"given": "J. K."
			}
		],
		"issued": {
			"date-parts": [
				[
					"2007"
				]
			]
		}
	}
]

Event Timeline

eranroz raised the priority of this task from to Needs Triage.
eranroz updated the task description. (Show Details)
eranroz added a project: Citoid.
eranroz added subscribers: eranroz, Amire80, Alleycat80, Mvolz.
eranroz set Security to None.

This is due to the Primo library translator only being enabled for browser, not translation-server:

https://github.com/zotero/translators/blob/master/Primo.js (missing 'v' flag in browserSupport)

I tried enabling it on localhost and it works so we'll go ahead and enable it given that it doesn't have any issues in production.

@mobrovac, this is happening enough (that disabled translators actually work with translation-server after all despite not being enabled, and that we don't fix it until a problem is reported,) that maybe we should enable all the translators?

Alternatively we can systematically go through and enable ones based on the tests, or test by hand... tests are down though online and I don't know where the code lives to run them though- http://zotero-translator-tests.s3-website-us-east-1.amazonaws.com/

Mvolz renamed this task from Citoid gives wrong itemType for Merhav ULI to Enable Primo.js translator for Zotero.Aug 16 2015, 8:57 PM

Change 231969 had a related patch set uploaded (by Mvolz):
Enable Primo translator

https://gerrit.wikimedia.org/r/231969

Change 231969 abandoned by Mvolz:
Enable Primo translator

Reason:
Duplicate

https://gerrit.wikimedia.org/r/231969

@mobrovac, this is happening enough (that disabled translators actually work with translation-server after all despite not being enabled, and that we don't fix it until a problem is reported,) that maybe we should enable all the translators?

Alternatively we can systematically go through and enable ones based on the tests, or test by hand...

Yup. I don't think enabling them without tests is a wise choice.

tests are down though online and I don't know where the code lives to run them though- http://zotero-translator-tests.s3-website-us-east-1.amazonaws.com/

The tests haven't been available for a while now, perhaps they are not maintained any longer?

https://groups.google.com/forum/#!topic/zotero-dev/gS-ox9OBLCE

I think they just went down without anyone noticing for a little while.

Mvolz triaged this task as Medium priority.Aug 18 2015, 9:56 AM

Change 231970 merged by Mobrovac:
Enable Primo translator

https://gerrit.wikimedia.org/r/231970

Deployed in production, resolving. If the issue persists, please reopen the ticket.