Skip to content
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

Add new translator: BBC genome #1367

Merged
merged 4 commits into from Sep 4, 2017

Conversation

Projects
None yet
4 participants
@zuphilip
Copy link
Collaborator

zuphilip commented Jul 12, 2017

The original request in the forum was from @pigsonthewing.

Actually, I tried to create two items for each entry: one for the magazinArticle and one for the radio or tvBroadcast and connect them together. @adam3smith What do you think about this? Some code looks fragile, but actually I haven't found any example which will break it.

I used the new function text and attr here and they are quite handy (also I am very much used to think about a xpath rather than csspath).

@pigsonthewing

This comment has been minimized.

Copy link

pigsonthewing commented Jul 12, 2017

Thank you, Philipp.

Original discussion, for the record: https://forums.zotero.org/discussion/60629/bbc-genome-radio-times

@pigsonthewing

This comment has been minimized.

Copy link

pigsonthewing commented Jul 12, 2017

Philipp and I have been discussing, cordially, how best to use "abstract" and/ or "note(s)" (tagged as "quote") for the programme description (e.g. "BBC One London, 19 March 1972 13.25") and synopsis.

Anyone else got a view?

@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Jul 12, 2017

what's the gist of the discussion? If there is a decent synopsis, I'd think that's a good fit for an abstract field. The other info seems good in a note. As always, I'd consider merging multiple notes.

@zuphilip

This comment has been minimized.

Copy link
Collaborator Author

zuphilip commented Jul 12, 2017

The line as "BBC One London, 21 July 1969 6.00" is quite important but I don't know where to save it best. I tried i) abstractNote, ii) note, iii) an additionalItem with relation.

Each websites correspond to a magazineArticle with title, date and some information. The same information was also part of the corresponding radioBroadcast or tvBroadcast which was aired a little later. And this line is giving us the information about this broadcast.

We could also add a tag (e.g. "synopsis" or "quote") to a note for better, structured metadata and possible parsing afterwards. However, this might be more an option to do individually, but I guess any such tag would not be standardized overall.

Personally, I like the two items which are connected at the moment. But I am unsure if this is ideal for any reuse...

@pigsonthewing

This comment has been minimized.

Copy link

pigsonthewing commented Jul 12, 2017

what's the gist of the discussion?

Philipp has answered this, but I'd add that it's probably best understood by looking at some genome pages. Please visit the pages for the full quotes.

http://genome.ch.bbc.co.uk/fb06fde9d6b749238929041ee47221a4

text a = BBC One London, 10 August 1968 17.15
text b = by Norman Ashby starts today a new adventure in space and time [...] perhaps the most frightening enemy the Doctor has yet encountered.

http://genome.ch.bbc.co.uk/5a2e8607052c43c98a86101d8748e62e

text a = BBC Radio 4 FM, 27 June 2004 14.00
text b = Roy Lancaster , Matthew Biggs and John Cushnie are at Buckingham Palace [...] Producer Trevor Taylor [...]

http://genome.ch.bbc.co.uk/e9fbf4f8ace140d182b0f31d7ae1222b
text a = BBC Radio 4 FM, 27 August 2006 5.43
text b = The bells of St Peter's Church, Tiverton, Devon.

The question is, when describing the magazine article, do we put "text a" in "abstract", and text b in "quote", vice versa, both in "quote", or is there some other way to model this? And ditto when describing the broadcast programme.

@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Jul 22, 2017

Since I don't think we currently have any other translator that imports two items on a single item page, I want to first make sure @dstillman has no objection to that.
I think given the nature of the source it makes sense, but it's unusual behavior for Zotero nonetheless.

@dstillman

This comment has been minimized.

Copy link
Member

dstillman commented Jul 23, 2017

I'm OK with saving two items. (I think it will mean that neither of the items will be automatically selected in Zotero, the same as when using multiple selection.)

@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Jul 30, 2017

Sorry for the delay. I think the right way to do this (here & in general) is to put the summary (i.e. text b in @pigsonthewing 's summary above) into the abstract field (because the abstract is a summary of the content) and leave text a) in a note. Everything else looks good to me.

@pigsonthewing

This comment has been minimized.

Copy link

pigsonthewing commented Aug 11, 2017

Sounds OK to me.

@zuphilip Any thoughts?

@zuphilip

This comment has been minimized.

Copy link
Collaborator Author

zuphilip commented Aug 28, 2017

Okay, I changed abstract and note for the text b), but I am not sure that this is all you wanted. @adam3smith Are you fine with the two items for each step? Did I saved the abstract to the correct item? Anything else?

@adam3smith
Copy link
Collaborator

adam3smith left a comment

2 quick nits (sorry, I thought I submitted those a while ago)

var aside = text(doc, 'aside.issue p');
//e.g. Issue 2384\n 7 July 1969\n Page 16
var parts = aside.trim().split('\n');
item.issue = parts[0].replace('Issue', '').trim();

This comment has been minimized.

@adam3smith

adam3smith Sep 4, 2017

Collaborator

I'm nervous about parts[1] or parts[2] not existing and then triggering an error that breaks the whole thing. Let's test for them before running replace.

//e.g ["BBC Radio 4 FM" , "30 September 1967 6.35"]
additionalItem.programTitle = pieces[0];
var time = text(doc, '.primary-content a span.time');
var date = ZU.strToISO(pieces[1].replace(time, ''))

This comment has been minimized.

@adam3smith

adam3smith Sep 4, 2017

Collaborator

this seems less likely to be absent, but let's be conservative and test for pieces[1], too.

@zuphilip

This comment has been minimized.

Copy link
Collaborator Author

zuphilip commented Sep 4, 2017

Please have a look at the new version.

@adam3smith adam3smith merged commit ee8a61f into zotero:master Sep 4, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Sep 4, 2017

Great, thanks!

@zuphilip zuphilip deleted the zuphilip:bbc-genome branch Sep 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.