Page MenuHomePhabricator

Allow for conditional field mapping in Citoid
Closed, DeclinedPublic

Description

On the German-language Wikipedia, the Literatur template issues a warning if both OCLC and ISBN are given. In cases where both of them exist, only ISBN should be given. However, since Citoid is not aware of this, lots of articles show up in maintenance categories (local bug report).

As far as I can see in the TemplateData documentation, there is no way to specify that Citoid's oclc should only be mapped to Literatur's OCLC if Citoid's ISBN is empty. If we had a simple if-condition similar to how it is available for MediaWiki templates, we could configure the template correctly in this and many other cases.

For the case mentioned above, it would look similar to this:

"oclc": "{{#if: "ISBN" | None  | "OCLC" }}",
"DOI": "DOI",
"ISBN": ["ISBN"],

Event Timeline

Cirdan created this task.Mar 27 2018, 4:07 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptMar 27 2018, 4:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Cirdan updated the task description. (Show Details)Mar 27 2018, 4:09 PM
Mvolz moved this task from Backlog to Extension on the Citoid board.Jun 2 2018, 9:57 AM
Mvolz added a subscriber: Mvolz.Jun 4 2018, 10:37 AM

If we have OCLC, we always have the ISBN, so I think probably the simplest thing to do for your case is simply to remove the OCLC mapping from the citoid map. That way only the ISBN will be inserted. I can't think of a situation where we'd have the OCLC but no ISBN since almost all worldcat responses come from requesting an ISBN to begin with.

Template Data is pure JSON. I think it's very unlikely that we'll see the ability to write code or pseudocode inside a template data block ever. It's just too messy and would break a lot of stuff, so I'm going to mark this declined.

Let me know if you have any trouble editing the template data to fix this.

Mvolz closed this task as Declined.Jun 4 2018, 10:38 AM
Mvolz triaged this task as Normal priority.
Aschmidt reopened this task as Open.EditedMar 5 2019, 10:11 AM
Aschmidt added a subscriber: Crazy1880.

I am sorry to say that the issue has come up again on Geman Wikipedia, so I have reopened the task for re-evaluation. @Cirdan has made a good point in describing the issue and the solution for dewiki above. In the meanwhile @Crazy1880 pointed out to an entry in OCLC that of course does contain the OCLC number, but not an ISBN. In German-speaking countries we rarely refer to OCLC ids. Also, we rarely use WorldCat, we prefer the catalogues maintained by our national libraries that issue ISBN and ISSN for German-language publications. So, I subscribe to Cirdan's description and I would be grateful if you please could change configuration accordingly.

The reason for preferring ISBN over OCLC is that ISBN gives access to both Worldcat and any other, like national libraries and book sellers and local library catalogue and research archives.

Once we know an ISBN (which is available since late 1960s only) any OCLC and LCCN and whatever is redundant.

If no ISBN known or the book has been printed earlier, then OCLC is second choice and gives also access to some national libraries, hopefully LoC linked as well.

Mvolz added a comment.EditedMar 6 2019, 10:08 AM

I am sorry to say that the issue has come up again on Geman Wikipedia, so I have reopened the task for re-evaluation. @Cirdan has made a good point in describing the issue and the solution for dewiki above. In the meanwhile @Crazy1880 pointed out to an entry in OCLC that of course does contain the OCLC number, but not an ISBN. In German-speaking countries we rarely refer to OCLC ids. Also, we rarely use WorldCat, we prefer the catalogues maintained by our national libraries that issue ISBN and ISSN for German-language publications. So, I subscribe to Cirdan's description and I would be grateful if you please could change configuration accordingly.

The reason the task was closed was because the request (conditional mapping in template data) was too complex a solution to this problem.

Configuration is something that ideally should be done by the community but I know it's fairly technical so I have deleted the line for you. The edit is pending.

https://de.wikipedia.org/w/index.php?title=Vorlage%3ALiteratur%2FDoku&type=revision&diff=186306218&oldid=184930800

Mvolz closed this task as Declined.Mar 6 2019, 10:08 AM