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

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

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 triaged this task as Medium 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.

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