Page MenuHomePhabricator

Add a new Wikidata datatype for linking to Commons pages or expand ''Commons media file'' type
Open, LowestPublic

Description

Many properties store links to pages on Commons and with exception of links to images all other links are stored as ''strings'' type. I would like to propose to create new ''Commons page'' property type which would store links to Commons pages. Alternative solution would be to expand ''Commons media file'' property type . This new property type would have internal Wikibase support similar to support of ''Commons media file'' type properties or sitelinks:

  • page name stored in some uniform format (categories starting with capital letter, spaces instead of underscores, etc.) which can be easily compared to sitelinks in SPARQL
  • do not allow links to non-existing pages
  • automatically handle pages which are deleted, redirected or moved.
  • page names would be displayed as links not through some javascript postprocessing (which often does not work or requires several page purges), but through wikibase software

Current list of properties which would be than converted to the new type:

Event Timeline

thiemowmde triaged this task as Lowest priority.Nov 20 2017, 4:04 PM
thiemowmde added a subscriber: thiemowmde.

A datatype for something like this already exists: we call it "external identifier". Internally it's still a string, but appears as a link in the user interface as well as in exports.

Propagation of page deletions and such is not going to happen, at least not on the level of statements. Other datatypes also don't do this, e.g. the URL datatype, or the currently existing Commons media file type. Deletions, renames and such are tracked on sitelinks. So if this functionality is needed, the links to Commons should be modeled as sitelinks, not as statements.

I was looking for a datatype which has many properties of sitelinks and Commons media file datatype, like including tracking of deletions and renames, automatic and robust link display and with some internal conversion to a common format (underscores changed into spaces, etc.). "External identifier" type is not a good match for storing links to Wikipages, because it only does automatic link display. Sitelinks are not good options either because you can only have one sitelink per project. That is why I was thinking about a new datatype or extension of Commons media file datatype.

I aWould be a big fan of allowing sitelinks from a single item to multiple pages on a single project, each page in a different namespace. That would also solve a mess with items which are instances of Wikimedia permanent duplicated pages , where one would like to link to multiple pages written in different scripts of the same language that reside on a single project (T165882). That would also partially solve an issue T99899, by allowing a commons page to look-up wikidata item that link to it. So preferred solution would be to relax one-project-one-sitelink restriction, and if that is not possible than creation of new statement datatype that share many properties of sitelinks.

The final side-point is about propagation of page deletions to the currently existing Commons media file datatype. I do not know how it works but if an image is deleted on Commons than it is removed from image (P18) statements, see this example, I would lave to have the same functionality for other properties linking to wikipages.