Page MenuHomePhabricator

Clarification on Interface/Wikibase-SortedProperties to improve documentation
Open, Needs TriagePublic

Description

As I am willing to use mw.wikibase.getPropertyOrder method in a Module on my local WikiBase instance, I ended up on the manual page for Interface/Wikibase-SortedProperties .
There are a few things regarding this page that IMHO are unclear and its use is not properly explain. I would like to improve documentation, but I need input from an expert to clarify things.

1) First of all, is this setting a "Client" or a "Repository" one?
On the manual page, the example is:

$wgWBRepoSettings['propertyOrderUrl'] = $wgServer . '/w/index.php?title=MediaWiki:Wikibase-SortedProperties&action=raw&sp_ver=1';

while in the WikiData own configuration (found here on Gerrit after reading T149540), the string is written as:

$wgWBClientSettings['propertyOrderUrl'] = 'https://www.wikidata.org/w/index.php?title=MediaWiki:Wikibase-SortedProperties&action=raw&sp_ver=1';

So it is unclear if this configuration has to set once in the Repository installation, being valid for all the Clients connected, or if it needs to be set on each of the Clients.

2) Second question: is there limitation on where the MediaWiki:Wikibase-SortedProperties can be placed?
Can it be either on Repository or Client MediaWiki?

3) Third question: in the manual it is written

For best results, simply follow the conventions present in Wikidata's Wikibase-SortedProperties page.

I would better specify what these conventions are.
My induction is that the parsing work this way

  • each row not starting by * is ignored
  • if a row start with *P… or * P…, the property is extracted, ignoring everything following the first space after P…

Am I correct in these assumptions?

I would kindly ask anybody with a deep understanding of this mechanism to contribute here, so documentation can be improved for the sake of all the users.

Event Timeline

Restricted Application added a project: Wikidata. · View Herald TranscriptApr 19 2020, 10:09 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Bugreporter added a subscriber: Bugreporter.EditedApr 19 2020, 10:33 PM
$wgWBClientSettings['propertyOrderUrl'] = 'https://www.wikidata.org/w/index.php?title=MediaWiki:Wikibase-SortedProperties&action=raw&sp_ver=1';

This means the MediaWiki:Wikibase-SortedProperties in Wikidata is used in all Wikibase clients. clients do not have Wikibase Repository installed, so they do not use wgWBRepoSettings.

Second question: is there limitation on where the MediaWiki:Wikibase-SortedProperties can be placed? Can it be either on Repository or Client MediaWiki?

You can place it in any place (page name) in any wiki. The only thing is make sure the setting is pointed to that page. Note if the page is publicly editable, this may be a target of vandalism.

I would better specify what these conventions are.

See https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/52e59d940192da6cf0e3ac90b65e57918cdcd6ff/lib/includes/Store/WikiTextPropertyOrderProvider.php

The actual regex is ^\*\h*(?:\[\[(?:d:)?Property:)?(P\d+\b) which matches a string (case-insensitive):

  • starts with *
  • followed by zero or more whitespace characters, which are spaces or tabs
  • optionally, followed by one of [[Property: or [[d:Property:
  • followed by letter P
  • followed by a sequence of digits
  • followed by any character which is not one of A-Z, a-z, 0-9, or _
  • end of match, any following characters will be ignored

Any lines not matching are treated as comments and ignored. Note all things in <!-- and --> is removed before matching, so *<!--abc-->P<!--xyz-->3<!--123-->4 is also OK.

lucamauri added a comment.EditedApr 20 2020, 7:27 AM

This means the MediaWiki:Wikibase-SortedProperties in Wikidata is used in all Wikibase clients. clients do not have Wikibase Repository installed, so they do not use wgWBRepoSettings.

Pardon me, this is still not completely clear to me.
You are saying that this wgWBClientSettings is to be placed into Repository's configuration file and then inherited by the clients?
Or that a separate wgWBClientSettings needs to be placed on each Clients' configuration?

One more thing: can you also explain what sp_ver=1 means? I cannot find details on this parameter in the manual page.

You can place it in any place (page name) in any wiki. The only thing is make sure the setting is pointed to that page. Note if the page is publicly editable, this may be a target of vandalism.

Understood, thanks.

See https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/52e59d940192da6cf0e3ac90b65e57918cdcd6ff/lib/includes/Store/WikiTextPropertyOrderProvider.php
The actual regex is ^\*\h*(?:\[\[(?:d:)?Property:)?(P\d+\b) which matches a string (case-insensitive):

Crystal clear, now, Thanks

Dear @Bugreporter may I kindly ask you if you can still help with the other questions above? Or can you mention someone that can help?
So I can finish the work on the instruction page and close this task

Thanks!