Profile
Back to NewsBack
GitHub Trending 5 min
Reader Mode
zotero-cita/zotero-cita: Cita: a Wikidata addon for Zotero with citations metadata support

zotero-cita/zotero-cita: Cita: a Wikidata addon for Zotero with citations metadata support

12 hours ago

Cita: Citations metadata in Zotero

Using Zotero Plugin Template</a>

Cita is a Zotero plugin adding support for citations metadata for your Zotero items, featuring:

  • getting citations metadata from sources including Wikidata, Crossref, Semantic Scholar, and OpenAlex
  • citation syncing (back and forth) with Wikidata
  • local citation network and co-authorship network visualization
Initial development of this plugin was supported by a grant from the Wikimedia Foundation. Zotero Cita Item Pane Citations Dark Zotero Cita Item Pane Citations Light Zotero Cita Local Citation Network Zotero Cita Co-Authorship Network

Description

The plugin consists of three separate basic modules:

Citations metadata support

This module adds citations metadata support to Zotero. It provides an additional Citations tab where the user can:

  • add, edit or remove individual citations
  • run item-wide and citation specific actions, such as syncing citations with Wikidata or getting citation lists from sources including Crossref, Semantic Scholar, and OpenAlex
  • search for and store source item's identifiers, including DOI, Wikidata's QID, PubMed ID (PMID), Semantic Scholar CorpusId, and OpenAlex Key
Citations metadata are currently saved as a note attachment.

Wikidata communication

This module provides back and forth citation syncing with Wikidata, using property P2860 "cites work". This can be used to manually edit and improve Wikidata's citation data.

Username and password login is now deprecated, so to enable this feature you will need to create a OAuth 2.0 consumer token for your account by following these steps:

  1. Go to this link https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2?wpownerOnly=1
  2. Set an application name, ensure that the "This consumer is for use only by" box is checked, and tick the boxes for the following permissions: Basic rights, Edit existing pages, Create, edit, and move pages
  3. After clicking "Propose consumer", you will be shown a long token - save this somewhere safe because you won't be able to see this again
  4. Whenever syncing citations with Wikidata or creating new items, paste this token in the Wikidata password box

Local Citation Network visualization

This module allows visualizing how items in a local library connect to each other through citations and co-authorships. Full networks can be downloaded as JSON, shared, and reopened by everyone using Local Citation Network - see example.

Installation

Download the latest XPI and install it in Zotero.

Note: Cita v1.0.0 and later require at least Zotero 7. The last version of Cita supporting Zotero 6 was v0.5.5

Quickstart guide

A quickstart guide for an older version of Cita is available at Wikidata's Cita page. The interface will be slightly different but the same steps apply for newer Cita versions.

Translation

Cita is collaboratively translated at translatewiki.net. Would you like to help translate it to other languages? Join the translation project here!

Development

  1. Download a beta version of Zotero from here - these come with the debug tools already enabled so you don't need to build it from source.
  2. Install nodejs and npm if you don't already have them (Currently Node v22 and npm v10 are the minimum required versions)
  3. Clone the source code git clone https://github.com/zotero-cita/zotero-cita, and run git submodule update --init --recursive to fetch the nested submodules.
  4. Setup the plugin to run with the debug version of Zotero
1. Make a new file in the repo root called .env (you can also copy an example .env file from here) 2. Add a line in .env like ZOTERO_PLUGIN_ZOTERO_BIN_PATH = to point to the executable of the Zotero debug build you downloaded in step 1. 3. Add a line in .env pointing to the Zotero profile you will be using: ZOTERO_PLUGIN_PROFILE_PATH = (ideally, create a new Zotero profile for debugging). For me the folder is called 3vvlvf75.debug. Instructions on how to find this folder can be found here
  1. Run npm install
  2. This plugin is built using esbuild. Run npm run start to launch Zotero and rebuild the plugin automatically each time the source code is changed (thanks to zotero-plugin-scaffold). For some changes like CSS the hot reloading doesn't work and you will need to restart Zotero. Built files will be saved to build/addon/chrome/content.
1. The firefox debug tools should automatically pop up, allowing you to see console output, debug code, and edit CSS. Most code should be visible under file:// in the debugger
  1. For distribution, run npm run build, then you can find the extension at build/zotero-cita.xpi.

Publishing

  1. Decide a new version number vX.Y.Z using Semantic Versioning, and depending on whether it's a beta release or not.
  2. npm run release and choose this version number and the version will be automatically bumped in package.json and the release tagged. This will trigger github actions to build the code and make a new release at this version
  3. Until integration tests have been implemented (#30), install the new version on a fresh Zotero profile and run some manual tests.

Acknowledgements

Cita depends on:

License

Copyright (C) 2022 Diego de la Hera, Dominic Dall'Osto, Tim Woelfle, Jonas Zaugg, and contributors.

This work is released under the terms of GPL-3.0 or any later version.

Cita for Zotero 7 was based on windingwind's zotero plugin template, while previous versions were based on Will Shanks' Zutilo plugin.

Doing anything new in XUL has also been strongly recommended against, and using standard React/HTML has been suggested instead (see here, or here). For these cases, some inspiration has been borrowed from already reactified components in Zotero's source code.

Chat with me