Extension:CoAuthor

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
CoAuthor
Release status: beta
Implementation Special page
Description Calculates and displays degree of coauthorship for MediaWiki users
Author(s) University of Macau (Libby Tang, Robert P. Biuk-Aghai, José Lopes, Peter Fong) (umdacctalk)
Latest version 1.0 (2011-05-16)
MediaWiki 1.16
PHP 5.0
License Educational Community License 2.0
Download see Download section
Hooks used
LanguageGetSpecialPageAliases
PageHistoryLineEnding
Translate the CoAuthor extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

The CoAuthor extension provides a tool for finding the co-authors for a given wiki user. More precisely, this extension calculates the degree of co-authorship for a given user with all other users who have contributed to one (or more) wiki page(s) that this user has also contributed to.

The degree of co-authorship between a given user a and a co-author b is calculated for each page p which they have co-authored using following pieces of information:

  • number of non-minor revisions by user a in page p
  • number of minor revisions by user a in page p
  • number of non-minor revisions by user b in page p
  • number of non-minor revisions by user b in page p
  • total number of all non-minor revisions in page p
  • total number of all minor revisions in page p
  • editing period of user a for page p
  • editing period of user b for page p

Here the editing period is the interval from the first edited revision to the last edited revision of the page. Details of the calculation method can be found in our published paper (see See also section).

Usage[edit]

The CoAuthor extension is a MediaWiki Special Page. There are three ways to invoke this special page and search for a user's co-authors:

  1. Directly navigate to the page 'Special:CoAuthor'. Then enter a user name to initiate the search for this user's co-authors. See the screenshot below.
  2. Enter the 'Special Pages' page and click on the CoAuthor special page. Then enter a user name to initiate the search for this user's co-authors. See the screenshot below.
  3. Enter the history page of any article which the given user has contributed to. Each entry in the history list shows one revision, including the contributing user name. In parentheses following the user name is a link 'co-authors'. Clicking this link directly initiates a search for this user's co-authors.

The following shows the co-author page with the search box to enter a user name:

CoAuthor-WelcomePage.png

The following is an example of the co-author link in the history page:

CoAuthor-HistoryPageLink.png

The generated output sorts the co-authors by their degree of co-authorship, presented both as an absolute value and also as a percentage. The following shows an example of a co-authorship output:

CoAuthor-ResultPage.png

The current version of the CoAuthor extension calculates the coauthorship degree on the fly. As this needs to fetch all revision meta-data of all pages which the selected user has ever contributed to, and then analyze this data, the calculation could require quite some time. On small wikis results are produced within a reasonable time (< 2 seconds), however for larger wikis response time can measure minutes (as in the example pictured above where it took over 6 minutes). It would be desirable to pre-calculate and store co-authorship values in the database, but this is a todo item and not currently implemented.

Download instructions[edit]

Download the CoAuthor extension archive file.

Installation[edit]

Requirements[edit]

The CoAuthor extension has the following requirements (besides the MediaWiki and PHP versions specified in the extension box):

  • MySQL or PostgreSQL database servers are required; SQLite is not supported.
  • MediaWiki database administrator access (or other database role that has privileges for creating SQL functions).

Step by Step Instruction[edit]

Step 1: Download the archive file from the link above.

Step 2: Extract the downloaded archive to the extensions directory of your MediaWiki installation. For example (replace with the actual path to your MediaWiki installation):

tar -xzf CoAuthor-1.0.tar.gz -C /path/to/mediawiki/extensions

Step 3: Update MediaWiki database. Currently supported databases are MySQL and PostgreSQL. Choose the appropriate command, as well as the path to your MediaWiki installation.

  • Update MySQL database
mysql -h 'host' -u 'admin' -p'pass' 'wikidb' < /path/to/mediawiki/extensions/CoAuthor/CoAuthor.mysql
echo grant execute on function calculate_degree to 'wikiuser' | mysql -u 'admin' -p'pass' 'wikidb'

Notes:

  1. Replace 'host' with database server name.
  2. Replace 'pass' with MySQL administrator password.
  3. Replace 'admin' with MySQL administrator username.
  4. Replace 'wikidb' with the MediaWiki database name.
  5. Replace 'wikiuser' with the MediaWiki database username.
  • Update PostgreSQL database
psql -h 'host' 'wikidb' -U 'admin' < /var/www/mediawiki/extensions/CoAuthor/CoAuthor.mysql
echo grant execute on function calculate_degree to 'wikiuser' | psql -h 'host' 'wikidb' -U 'admin'

Notes:

  1. Replace 'host' with database server name.
  2. Replace 'admin' with MySQL administrator username.
  3. Replace 'wikidb' with the MediaWiki database name.
  4. Replace 'wikiuser' with the MediaWiki database username.

Step 4: Add a new index (rev_user, rev_page) into the revision table of the MediaWiki database. If such an index already exists this step can be ignored. Depending on the size of the revision table, this step could be time consuming. Choose the appropriate command for your installation.

  • MySQL database
echo alter table revision add index user_page \(rev_user, rev_page\) | mysql -u 'admin' -p'pass' 'wikidb'
  • PostgreSQL database
echo create index user_page on revision \(rev_user, rev_page\) | psql -h 'host' 'wikidb' -U 'admin'

Step 5: Add the following line to the bottom of LocalSettings.php (before trailing ?>, if it is present):

require_once("$IP/extensions/CoAuthor/CoAuthor.php");

Step 6: Visit the page 'Special:CoAuthor' in your MediaWiki installation. If everything went fine you should see the CoAuthor special page.

See also[edit]