Page MenuHomePhabricator

Clarification on Interface/Wikibase-SortedProperties to improve documentation
Closed, ResolvedPublic

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 subscriber: Aklapper. · View Herald Transcript
$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.

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!

Hi, just tuning in on this topic. Since I recently had my hands on the documentation in connection with T280787, I will take a look at this shortly and see if I can get any open questions answered.

Manual page updated. (Spoiler: the setting is indeed a client and not a repo setting.)

As I see it the manual page now contains answers to questions 1 (client) and 2 (it can be anywhere on the internet) and the "sp_ver" question (no functional impact). If @lucamauri is content we can close this ticket.

lucamauri claimed this task.

As I see it the manual page now contains answers to questions 1 (client) and 2 (it can be anywhere on the internet) and the "sp_ver" question (no functional impact). If @lucamauri is content we can close this ticket.

Thanks @danshick-wmde for your work on the documentation: in my opinion this is much clearer now, I just added a few words and a reference to the source code to better explain how and where the page content is processed.
I can only guess all is clear to other interested users as well, but I agree we can close the ticket.

Just out of personal curiosity, can you kindly point me to the documentation regarding the sp_ver parameter? I saw your explanation in the page and I'd like to learn more.

Thanks @danshick-wmde for your work on the documentation: in my opinion this is much clearer now, I just added a few words and a reference to the source code to better explain how and where the page content is processed.

Happy to help.

Just out of personal curiosity, can you kindly point me to the documentation regarding the sp_ver parameter? I saw your explanation in the page and I'd like to learn more.

That information was based on primary research -- a conversation with the developers. The manual page is the documentation :)