Last modified: 2014-09-05 17:04:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59744, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57744 - Implement Redirects in ItemContent
Implement Redirects in ItemContent
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=20 s=2014-06-17
:
Depends on: 38962 61264 62493 65594 66024 66026 66028 66030 66831
Blocks: 57745 66067
  Show dependency treegraph
 
Reported: 2013-11-29 15:10 UTC by Daniel Kinzler
Modified: 2014-09-05 17:04 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2013-11-29 15:10:06 UTC
EntityContent should be able to represent redirects (while Entity and the rest of the Wikibase datamodel should not know about redirects).
Comment 1 Gerrit Notification Bot 2013-11-29 15:11:24 UTC
Change 89810 had a related patch set uploaded by Daniel Kinzler:
Allow ItemContent to represent a redirect.

https://gerrit.wikimedia.org/r/89810
Comment 2 Bene* 2013-11-30 15:40:52 UTC
Should this really be implemented in EntityContent, or might we use the standard redirect feature of MediaWiki?
Comment 3 Daniel Kinzler 2013-12-02 09:47:14 UTC
@Bene: in order to use MediaWiki's standard redirect feature, EntityContent must implement that feature for, well, entities. The Content interface defines the appropriate methods, EntityContent currently doesn't do anything with them though.

However, I'm no longer convinced that this is the best approach to implementing redirects for Wikibase (though the redirect interface in Content must be used in *some* way), see my my mail to wikidata-tech: http://lists.wikimedia.org/pipermail/wikidata-tech/2013-December/000347.html
Comment 4 Daniel Kinzler 2014-03-11 13:24:46 UTC
As per discussion on the mailing list, redirects are to be implemented as a mode of EntityContent. See https://meta.wikimedia.org/wiki/Wikidata/Development/Entity_redirect_after_merge for a summary
Comment 5 Daniel Kinzler 2014-03-13 17:27:04 UTC
We have discussed the expected behavior of entity redirects internally. Here are the key points:

* An Entity object cannot represent a redirect
* An EntityContent object may represent a redirect. In that case, calling getEntity() will fail.

* Redirects should only be possible within one kind of entity, redirects from one kind of entity to another are not supported.
* For now, only Items can redirect to other Items. Redirects for Properties will not be supported initially, if ever.
* The only way to create a redirect should be by merging two entities. Ideally, the merge would involve two edits to the redirected item: one to "empty" it, and a separate one to turn it into a redirect. This allows for better diffs, for easier undo/revert, and a clearer edit history.
* Redirects can be turned back into normal entities by undoing/reverting the edit that turned them into a redirect (if that is possible without conflicts).
* On the RDF level, redirects a re modeled as an owl:sameAs relationship between concept URIs. This also means that the redirected document URL is considered to be "about" the target's concept URI.

* Viewing a page of an entity that is a redirect shall show the content of the redirect target, as usual. This can be disabled withing the redirect=no parameter, as usual.
* When viewing an entity page that references redirected entity IDs, it would be nice to mark these somehow. We will probably not support this initially.
* When accessing an entity explicitly via ID from a client wiki, any redirects should be automatically resolved.
* When trying to edit an entity that is a redirect (via the API od a special page), the edit will fail.
* When fetching entities via the API, redirects should NOT be automatically resolved, unless this is requested using redirects=resolve.
* When requesting entity data using a canonical data URL or concept URI, redirects should be resolved automatically. The resulting data does not need to indicate that a redirect was resolved.
* For RDF data, the relevant owl:sameAs triples should be included, no matter whether what URL the document was accessed with.
* All redirects should be present in the full RDF dump, as owl:sameAs triples.
* Redirects are not present in JSON dumps of entities, but there would be a separate JSON dump for redirects.

* Redirects from wikitext pages to entities will work as usual, and do not concern us.
* We should make sure the "redirected from" line is shown correctly in entity pages.
* Revert/Restore needs to work as expected
* Diffs between the redirect and non-redirect versions of an entity need to work

* EntityRevisionLookup will not resolve redirects and will fail when used with a redirected entity ID. This could be relaxed if no specific revision is requested.
* EntityLookup will resolve redirects if explicitly asked to do so.
* The EntityPerPage table will maintain the link between a redirected entity ID and the wiki page that contains the redirect. We will add a column (or an extra table) that holds the redirect targets.
Comment 6 Gerrit Notification Bot 2014-06-27 15:35:36 UTC
Change 134379 merged by jenkins-bot:
Implement redirects in ItemContent

https://gerrit.wikimedia.org/r/134379

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links