Jump to navigation Jump to search

About this board

Previous archives are at /Archive 1

Pigsonthewing (talkcontribs)

The ability to fetch metadata from Wikidata by specifying only a QID is great, but please can we also have this in the wikicode editor?

Mvolz (WMF) (talkcontribs)

You can currently do this in refToolBar as well by putting the QID or the full wikidata url in the url field and pressing the "search" eyeglass button.

Unfortunately in terms of having a dedicated QID field in refToolBar, this first requires the citation templates on en wiki to add a QID parameter.

Pigsonthewing (talkcontribs)

Thank you. Yes, that works - but is undocumented, and counter-intuitive.

Jdforrester (WMF) (talkcontribs)

It's been available rom the start in the 2017 wikitext editor. If you mean the 2010 wikitext editor, that's generally not getting new features, including not getting the automatic citations ("citoid") tool. There are locally hacky gadgets on a few wikis that try to replicate that; if you're using one of those, you should ask whoever is supporting that gadget to extend their tool if it doesn't Just Work™ already.

Pigsonthewing (talkcontribs)

I mean the 2010 editor, on en.Wikipedia. I have no idea who maintains it.

Jdforrester (WMF) (talkcontribs)
Pigsonthewing (talkcontribs)
Reply to "QID in Wikitext editor"

Bugs: pmc, redundant urls, and ref tags

Boghog (talkcontribs)

Not sure where the best place to post this. But here goes:

I never use this tool myself, but I frequently am cleaning up after others that do. Three problems that I have noticed:

(1) in the PMC parameter, the value should be a integer and not prefixed with "PMC":

incorrect:|pmc=PMCxxxxxx (where xxxxx = integer)

correct: |pmc=xxxxx

The incorrect form throws an error that must be manually fixed.

(2) urls are sometimes added that are indentical to that already produced by |doi=, |pmid=, or |pmc=. In this case, the url should be suppressed since it is redundant.

(3) Ref tags that take the form of ":0", ":1", ":2". While they are unique, they are not very informative. Better to create a Harvard style ref tag, the form of first authors last name + year of publication (i.e., "Smith_2017" is much more readable that ":0"). (talkcontribs)
Boghog (talkcontribs)

Thanks for the links, however is important to distinguish between a template imbedded in wiki markup and how that template is rendered. The NIH recommendations only concern how the citations are rendered, not how they are entered in a {{cite journal}} template. The NIH has no recommendation on the syntax of templates.

The {{cite journal}} template renders the citation very close to the NIH recommendations (PMCxxxxx). The only difference is that {{cite journal}} adds a space between PMC and xxxxx. PMC in turn contains a wikilink to a Wikipedia article that explains what PMC stands for.

It is completely unnecessary prepend the parameter value with "PMC". This is redundant. The template itself produces the correct rendering. Hence the problem is with Citoid, not {{cite journal}}. (talkcontribs)

Well, that's a double edged sword. It is true that template markup differs from rendering, that means that it doesn't make any difference to a template if it receives a pmc = pmc XXXX or pmc = XXXX since it can be removed by parser functions or lua. So it comes down to aesthetics or personal preferences of some users because the template can be changed to accept both if there's consensus to do so.

The WMF developer's point in the phabricator task seems to be the same as the one in the publisher's site. The id is "PMC XXXXX", and the site also recommends "PMCID : PMC XXXX". Pages like Cancer AND Cholera don't seem to follow that recommendation anyway. While wikimedia users may prefer to use only integers to identify it, citoid and many wikimedia tools are also used by third parties, and such exemptions may not be wanted by them. There's also no guarantee that all wikipedias use the same format as english wikipedia, so it is possible that other wikis were doing the exact opposite, e.g. adding PMC where it only had an integer. The only alternatives are to change the code only for the wikis that prefer it that way, or leave it as is.

They stripped it previously ( without doing the research to understand the "official" preferred value, this time they decided against it after doing the research.

Anyway, I'm not WMF developer, nor associated with wikimedia, you'll have to convince them :).

Boghog (talkcontribs)

Can you cite a single example of another Wikipedia including "PMC" in the parameter value? Most other Wikipedias don't support pmc to begin with, and the ones that do have generally have followed the English Wikipedia's lead.

Citation Style 1 templates were created before Citoid. Hence it is reasonable that Citoid be compatible with Citation Style 1 templates, not the other way around. Furthermore, none of the other citation generation tools include "PMC" in the parameter value. I suppose that Citation Style 1 templates could be modified to optionally accept PMC in the parameter value, but this unnecessarily clutters citation templates with redundant characters. The parameter name is pmc, why does the parameter value also need to include pmc?

I have reopened the case on wikimedia. (talkcontribs)
Can you cite a single example of another Wikipedia including "PMC" in the parameter value?

You sparked my curiosity, and here's one example:

Citation Style 1 templates were created before Citoid

True, but that would be over fitting. There are more than a hundred encyclopedias, and the tool should be neutral and not cater to a single one. That's what it does, it returns the id as requested. Stripping it means that it just returns a number.

The parameter name is pmc, why does the parameter value also need to include pmc?

Knowing the full PMC means that users can quickly verify if citoid actually gave them the right data, instead of guessing. This is particularly important because a number can mean just about any random thing (e.g. a PMID number instead of a PMC). Just because it adds it as a parameter doesn't mean it is necessarily correct.

Boghog (talkcontribs)

In the Greek Wikipedia, using a pmc parameter value where PMC is prepended is optional. However the rendering with when PMC is included in the parameter value looks strange (PMC is displayed twice and PMCID is not displayed). This should be fixed.

The whole purpose of Citoid is to automate citation generation process so the editor doesn't have to worry about the accuracy of the parameter values. Since the data is downloaded from PubMed, the parameter values with a high degree of confidence are correct.

Numbers are not any less random if PMC is prepended to the parameter value. The best test to verify that the the parameter value is correct is to follow the rendered PMC link.

Whatamidoing (WMF) (talkcontribs)

Boghog, I tend to think that the IP is correct: it would be good for {{cite journal}} to accept the "formally correct" id number. This has been discussed for a couple of months now, and I've not yet heard any technical reason for the template to choke when it's given the "official" id number. I don't see a need to require the official id number, but it should be able to cope with it.

Whatamidoing (WMF) (talkcontribs)
Reply to "Bugs: pmc, redundant urls, and ref tags"
Summary by Mvolz (WMF)

Fixed outdated links in page.

Smith609 (talkcontribs)

I note that under `install from scratch`, step 2 instructs users to perform

`git checkout 8d6eae22`

This command, however, returns the error

`error: pathspec '8d6eae22' did not match any file(s) known to git.`

and indeed, perusal of establishes that no such commit exists. Presumably the repository history was wiped on 24 May 2018.

As such I am not able to install a version of translation-server that is compatible with nodejs v6, as the current versions require v8 or above.

Mvolz (WMF) (talkcontribs)

It looks like they moved the repository that used to live there to You should be able to follow the directions using that URL instead.

We are planning to use the new version fairly soon but it is not yet compatible.

Tinss (talkcontribs)

When setting $wgCitoidServiceUrl to!/Citation/getCitation, I get an XMLHttpRequest error in my browser when adding a citation and it seems citoid is querying this url with the old API. I'm using REL1_31 of the Citoid extension. Citoid/API, indicates that the API has changed. Is this change only available through restbase and not $wgCitoidServiceUrl?

We run a small wiki and figured we'd piggy back off Wikipedia's citoid service instead of hosting our own.

Thanks for any help!

Mvolz (WMF) (talkcontribs)

Yes, the "old" API is actually citoid's native API, and that's what wgCitoidServiceURL expects, but we deprecated the public version of that a few years back, and now we're only running the one behind restbase. If mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl exists, then it Citoid uses the restbase one, but I'm pretty sure if you set that in the VE config it will mess up the rest of your VE installation :).

Feel free to file a bug and/or submit a PR:

In the meantime you could also just manually set fullRestbaseUrl here instead of getting it from the VE config:

Reply to "Use of public API"
Ghybu (talkcontribs)

Hello, I would like to activate it on ku.wikipedia. Apart from creating this page, is there anything else to do?

Mvolz (WMF) (talkcontribs)
Whatamidoing (WMF) (talkcontribs)

@Ghybu, are you making progress? Do you need help?

I noticed that no citation templates are visible under the "Manual" tab. Do you want to add some, or does prefer non-templates?

Ghybu (talkcontribs)

Indeed, I don't understand why it is empty. I also tested TemplateData and it works correctly. I missed something or I have to report a bug on Phabricator?

Mvolz (WMF) (talkcontribs)

Hi, for the citations templates to be visible under the "Manual" tab, that is actually a separate configuration message called the citation tool: VisualEditor/Citation tool

Ghybu (talkcontribs)

@Mvolz (WMF): Thank you for your help, it works now :)

Whatamidoing (WMF) (talkcontribs)

Yay! Thanks for the update. I'm glad that you got it all sorted out.

2604:2000:DD4D:3A00:B9DF:24AD:C67C:9115 (talkcontribs)

Is there a way for Citoid to work with a local database so that it doesn't need to go through Zoltero.

Whatamidoing (WMF) (talkcontribs)

I think the correct answer is: "Yes – theoretically". I think you would have to re-write parts of the software (so it could find and understand your local database).

Mvolz (WMF) (talkcontribs)

So, there is no database with citoid OR Zotero's translation-server. Both Zotero and citoid generate citations on the fly, by querying APIs (like crossref) and scraping metadata from websites.

You CAN use citoid locally without setting up a local Zotero translation-server instance. However, it won't work as well. Configuration options to use or not use zotero are in config.yaml

Reply to "Local database"
Summary by Sasuke Sarutobi

FDMS4 provided link to troubleshooter, which contained the information required to build support.

Sasuke Sarutobi (talkcontribs)

Citoid is currently unable to automatically fetch citation information from URLs for the London Gazette, which is the UK newspaper of record. Looking at a sample article, I suspect that it may be that a lot of the metadata for the article itself is in the body of the page, rather than the head, but it is tagged as metadata.

For example, contains the metadata section of:

<dl class="metadata" id="pdf-description">
                                 <dt>Publication date:</dt>
                                    <time datetime="1942-06-05">5 June 1942</time>
                                 <dd id="issue-number">35586</dd>
                                 <dt class="page-number">Page:</dt>
                                 <dd id="page-number">2475</dd>

Publication date, issue number, and page number are pretty much the only details needed; the publication (The London Gazette) can be trivially inferred from the URL, and there are no author details to fill. These can be passed either to cite news / cite magazine, or there is a London Gazette template on en-wiki (which is an implementation of cite magazine).

Would adding support for London Gazette articles be technically possible?

FDMS4 (talkcontribs)
Sasuke Sarutobi (talkcontribs)

Thank you! I hadn't spotted that section when scanning through the page, so I'll give Citoid/Creating Zotero translators a go at the weekend and see if I can set up a translator for it.

Summary by Gryllida

Mvolz clarified why older versions of node or translation-server were used for installing citoid - for the tests to pass.

Gryllida (talkcontribs)

The install instructions are confusing. There is

"sudo apt-get install nodejs npm

nodejs --version # should now print v0.10.x Note: not on Ubuntu Server 12.04 LTS, you end up with v0.6.x" at [[Citoid#Installation]]. On my Debian I get v4.8.4 ...

I would be ok with this, maybe it works but then I read the next part which says "Checkout the older version: cd translation-server git checkout 8d6eae22"

Is this relevant today?

Mvolz (WMF) (talkcontribs)

Nodejs --version - yes, definitely outdated, I'll fix that.

As for translation-server, unfortunately, yes that is the equivalent to what we're running in production. For most purposes though, you can just use the most recent version. (It's just that the citoid tests are run with this older version, so you might get some failing tests so if you're trying to run them.) You can use the official translation-server installation directions from Zotero otherwise:

Gryllida (talkcontribs)

Thanks that's great.

Boghog (talkcontribs)

Hi. I posted this 9 months ago under Bugs: pmc, redundant urls, and ref tags. The only topic that was discussed when I posted this previously was the pmc accession number prefix (issue #1) and Redundant URLs (isssue #2) got lost in the discussion. Therefore I would like to raise the second undiscussed issue again, this time with more background.

Redundant url parameters are often added when there is another more appropriate and compact parameter that produces exactly the same link. Examples include:

IMHO, Citoid should check the url, and if it matches any of the above patterns, then the more specialized parameter should be populated and the url parameter should be left blank. As it stands now, Citoid is adding both the specialized parameter and the redundant url parameter.

PerfektesChaos (talkcontribs)

Basically you are right.

The German template for printed material w:de:Template:Literatur does support DOI= as well as PMID= and PMC=.

Furthermore, German templates detect URL as above and will issue error messages and urge to use plain ID rather than URL.

Note that recently changed to in new usages.

Whatamidoing (WMF) (talkcontribs)

I understand that most readers don't know that the clicking the PMID/doi/etc. numbers will take them to a useful page, but they do understand that clicking an article title that looks like an external link is going to take them to the article. From the POV of a non-technical reader, having the "redundant" link is very helpful.

Boghog (talkcontribs)

I think you are underestimating the intelligence and curiosity of the average reader. Readers understand that blue text contains a hyperlink and links generally lead to useful information. At the very least, if a reader is interested in a source and sees a link in the source, they are liable to clinic on it to see where it leads.

Furthermore the pmc parameter will also link the article title. Therefore |url= is completely redundant with |pmc=5615317.

Reply to "Redundant URLs"

JSTOR is sometimes a journal and sometimes a website

AManWithNoPlan (talkcontribs)
AManWithNoPlan (talkcontribs)

More information. Once citoid goes bad, it stays bad for a while, and then suddenly works again. I have tried coming in from other IP address ranges and with other jstor IDs just to make sure that I was not personally being blocked. Thoughts: jstor some how blocks you, but you still get title with “ - on JSTOR” appended. There are multiple and different citoid severs running, but then I would think it would be more random and not last for a time period.

Reply to "JSTOR is sometimes a journal and sometimes a website"