Page MenuHomePhabricator

Add support for url data type (top-level statements and qualifiers)
Closed, ResolvedPublic


Add support for the data type 'URL' for statements and qualifiers on commons

A url data type is essentially a string with constraints - on wikidata it's entered as a string, but it's validated against the property's constraints (it seems - under constraints)

Users need to be able to add a url for any property that takes urls as a value, in the File page and in UploadWizard

Use cases

The most common use case on Commons is to support listing the URL of a media file’s author/creator. A URL can be a creator’s official website, blog, or user page; a link to the full work; an archive URL; an import URL, or other (see full list of Wikidata properties that use the URL data type).

User story

As a Commons editor, I want to add one or more URLs to a media file’s metadata, so that anyone using that file can access those external resources.

Acceptance criteria:

  • can select a property with data type 'URL' and enter a value for it, on File page and UploadWizard
    • on File page
    • in UploadWizard
  • incorrect values return an error
  • URL is linked

Event Timeline

Support for URL property types is added in this patch: But we're going to need to do a little UI work to improve the user experience before this is really ready for production.

We have the ability to display these properties in a very basic way right now, but we have not enabled yet because we are working on updating the UI. Most of the team's energy has been focused on getting the machine vision tool out, but that work is mostly complete now so I'm hoping we can improve the situation here shortly.

Current status: wbsetclaim fails silently, and (silently) restore the UI to the state it loaded with, in read mode.
IMO, when a change fails to submit, the widget should probably remain in edit mode, with (invalid) input untouched, and an error message.

Change 553754 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Fix error handling when failing to submit statements

Change 553755 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] [WIP] Enable support for URL data types

I opened a new subtask for the specific issue of updating the FormatValue element and related logic. I have a WIP patch for it as well (still trying to figure out how to implement the changes on the PHP side):

Change 553755 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Enable support for URL data types

Ramsey-WMF added a subscriber: Ramsey-WMF.

Input for this type is working on production. However, previously added URL qualifiers for statements with "somevalue" won't show up until phase 1 of T239172 is taken care of.