Page MenuHomePhabricator

Automatically map wikibase-item to the correct namespace on the target wiki
Open, LowestPublic

Description

As an alternative to T143687: Allow setting target namespace in importDump.php , wikibase items can only be placed in one namespace on the target wiki.

The scenario is that is very common for wikibase installations to place items in a namespace named Item: that isnt namespace 0. It is described in the Extension page.

Importing Property pages from Wikidata into a wikibase installation occurs without problem, provided the target namespace name is Property. The namespace number can differ.

However, importing from source namespace 0 has no namespace name, so that doesnt provide the importer any way to 'guess' the correct target namespace is the Item: namespace.

However, there is typically/only one target namespace which can hold wikibase-item pages, so that could be used as a way to automatically map the pages from the source namespace 0 to the target namespace Item:.

This mapping is contained in $wgNamespaceContentModels.

I see Flow also uses $wgNamespaceContentModels and could benefit from this import feature.
There may be other extensions using this, but I cant find them in MediaWiki.org

Event Timeline

Restricted Application added subscribers: TTO, Aklapper. · View Herald Transcript

Only the default 2600 is supported for Flow NS_TOPIC (where the topics themselves live), and hopefully people have no reason to try to override that.

As for boards, they can be anywhere (any namespace can be default-Flow, it doesn't even have to be a talk namespace), so there is no way to infer this.

@Mattflaschen-WMF , is it not possible to create a wiki in which only one namespace can contain flow boards?

@Mattflaschen-WMF , is it not possible to create a wiki in which only one namespace can contain flow boards?

It is possible.

However, automatically importing all Flow boards to that namespace (assuming there is indeed only one) regardless of their original namespace seems potentially confusing. Also, you would have to handle collisions (where originally you had e.g. User_talk:Foo and Project_talk:Foo and now they're both mapped to Talk:Foo).

thiemowmde triaged this task as Lowest priority.Aug 31 2016, 8:19 AM
thiemowmde added a subscriber: Lydia_Pintscher.

@Mattflaschen-WMF , is it not possible to create a wiki in which only one namespace can contain flow boards?

It is possible.

However, automatically importing all Flow boards to that namespace (assuming there is indeed only one) regardless of their original namespace seems potentially confusing. Also, you would have to handle collisions (where originally you had e.g. User_talk:Foo and Project_talk:Foo and now they're both mapped to Talk:Foo).

The namespace data says whether there are more than one namespace with that content type in the source dump, and the namespaces of the target wiki are known to importDump.php.
I think it would be reasonable to implement this with a constraint that it refuses to work if there are more than one namespace for the content type on each of source and target wiki.

Are there any other problems to consider?

Are there any other problems to consider?

It still just seems semantically weird to me.

Even with that constraint, assume the dump has a Flow page Talk:Earth (the discussion page about the Earth encyclopedia/whatever the wiki is article).

The target wiki has only User_talk as Flow. We'll assume there is no User_talk:Earth yet ("what if there is?" is another question). It seems confusing to import Talk:Earth to User_talk:Earth. It makes no sense in the new context, even (especially) if there is a User:Earth.