Jump to content

Wikipedia:Bots/Requests for approval/Bibcode Bot

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Hellknowz (talk | contribs) at 14:26, 15 April 2011 (Discussion: q). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Coders:

  • Δ (talk · contribs) coded the first chunk of this bot, and abandoned the project.
  • Snottywong (talk · contribs) took over and will do the rest of the "major" coding.
  • Headbomb (talk · contribs) [aka me] took care of the journal detection / JJJJJ assignment stuff (see below) and will keep making tweaks as needed.

Operator:

Time filed: 05:13, Friday April 15, 2011 (UTC)

Automatic or Manual: Automatic

Programming language(s): Python / Pywikipedia

Source code available: When a stable version is around.

Function overview: Finds bibcodes and dois for {{citation}} and {{cite journal}}. See also the BOTREQ.

Links to relevant discussions (where appropriate):WP Astronomy, WP Astronomical Objects, WP Physics, WP Space, WP Solar System, and the Relativity taskforce have been noticed. Response is either unanimous support, or indifference. Headbomb {talk / contribs / physics / books} 05:13, 15 April 2011 (UTC)[reply]

Edit period(s): One big run after every database dumps, with possibly a few smaller runs following logic tweaks. If it doesn't have the time to finish between dumps, then it'll essentially be continuous.

Estimated number of pages affected: The theoretical upper limit is all pages with a {{citation}} and {{cite journal}}. A more realistic scenario is every astronomy- and physics-related page on Wikipedia (~50K), plus a few odd pages which cites a astronomy/physics journal for some weird reason (~5? ~10K? ~25K?) and most {{cite doi}} templates built by User:Citation bot. The number of affected pages should go down drastically following the first few runs, since there is a ~10 year backlog of stuff to deal with at the moment. The bot would at first go through human-compiled lists mostly focus on articles related to astronomy & physics articles. Once its astronomy & physics workload is reduced drastically, it could possibly move on to all pages with {{citation}} and {{cite journal}}.

Exclusion compliant (Y/N): Not implemented yet, but should be compliant with it.

Already has a bot flag (Y/N): Nope.

Function details:

A bibcode is in the YYYYJJJJJVVVVMPPPPA format, such as Bibcode:1982PhRvL..49.1804A, where YYYY is the year, JJJJJ is a journal code, VVVV is the volume, M is a special character, PPPP are pages, and A is the first letter of the first author's last name. The bot tries to...

  • Look for |doi=foo in {{citation}}/{{cite journal}} and tries to find the associated bibcode, if it exists, by querying the ADSABS database. If it find one, it adds |bibcode=bar.
  • Look for |bibcode=foo in {{citation}}/{{cite journal}} and tries to find the associated doi, if it exists, by querying the ADSABS database. If it find one, it adds |doi=bar.
  • If a search for the bibcode comes up empty-handed, it tries to build a bibcode from |year=/|date=, |journal=/|work=, |volume=, |page=/|pages=, |last=/|last1=
    • If the bibcode is valid, it adds |bibcode=. If the bibcode has an associated doi, it also adds |doi=.
    • If not, it makes some additional guesses (varies A from A to Z, if that fails, it varies M from A-Z, then from a-z).
      • If it finds a valid bibcode, it adds |bibcode=. If the bibcode has an associated doi, it also adds |doi=.

The bot does not touch anything other than |doi= and |bibcode=. If the scope expands beyond this, there will be another BRFA. Headbomb {talk / contribs / physics / books} 05:13, 15 April 2011 (UTC)[reply]

Discussion

Could you post an example of before and after the bibcode addition and what that means for citation/user? Is there a point of reference that bibcode presence in the citation is beneficial in all cases and wanted by the community to be implemented? —  HELLKNOWZ  ▎TALK 14:26, 15 April 2011 (UTC)[reply]