User talk:Soulkeeper/statementSort.js

From Wikidata
Jump to navigation Jump to search
An updated and exhaustive version of this script can be found at MediaWiki:Gadget-statementSort.js
See also: MediaWiki:Wikibase-SortedProperties.

This page is for reporting issues or request for changes to StatementSort script.

Issue with script (Oct 2013)[edit]

Hi, your script doesn't work with me since today, I don't know why. Some ideas ? Leag ⠇⠑⠁⠛ 08:14, 29 October 2013 (UTC)[reply]

No, I'm in the same boat. Something must have changed. I'll have a look at it. - Soulkeeper (talk) 16:09, 29 October 2013 (UTC)[reply]
Now it's working again. For how long, I have no idea. :) - Soulkeeper (talk) 16:31, 29 October 2013 (UTC)[reply]
Thanks. Leag ⠇⠑⠁⠛ 10:08, 30 October 2013 (UTC)[reply]

Possible sorting improvements[edit]

Hi Soulkeeper, thanks for your great tool. Looking at the showcase item ethanol (Q153), I found that most statements fall in the "unsorted" central section... a couple of improvements could be made to the current sorting, for example:

Your call, of course... thanks - LaddΩ chat ;) 04:03, 10 December 2013 (UTC)[reply]

Thanks for the suggestions, I've added them now. - Soulkeeper (talk) 23:27, 11 December 2013 (UTC)[reply]
Great, thanks! LaddΩ chat ;) 23:52, 11 December 2013 (UTC)[reply]

Suggestion[edit]

You should detect the user page's address with

mw.util.getUrl(mw.config.get('wgFormattedNamespaces')['2'] + mw.config.get('wgUserName'))

rather than trying to scrape it from the GUI, which can potentially break things (e.g. in mobile version). Or you can point directly to Special:MyPage/common.js. If you'd like, I can do the change for you :-) --Ricordisamoa 02:54, 11 December 2013 (UTC)[reply]

Thanks for the tip, though I've removed the whole message now. - Soulkeeper (talk) 23:29, 11 December 2013 (UTC)[reply]

Hiding ObsoleteMessage[edit]

Is there a way to hide this message? The new native statement sorting functionality is way too complicated to use, and it doesn't sort statements in the same order on all items. So, I think that this script is all but obsolete and I hope you will continue to maintain it. Thanks for your work by the way! — Ayack (talk) 09:18, 11 December 2013 (UTC)[reply]

I know of no easy way of hiding it, and I don't want to start messing with cookies just to do that, so I removed the whole thing instead. - Soulkeeper (talk) 23:31, 11 December 2013 (UTC)[reply]

Grouping dates[edit]

@Soulkeeper: Hi, since I still believe that your tool is essential, I would appreciate if you could add those lines under section "// Organization", simply to group matching statements:

toTop.push(571); // foundation
toTop.push(576); // dissolution
toTop.push(580); // start date
toTop.push(582); // end date
toTop.push(729); // service entry
toTop.push(730); // service retirement

Thanks! LaddΩ chat ;) 15:30, 27 April 2014 (UTC)[reply]

LaddΩ: ✓ Done. — Ayack (talk) 18:48, 12 October 2014 (UTC)[reply]

Sorting recent items[edit]

Hi Soulkeeper, in case you still maintain that gadget, I would appreciate if you could add these two, say, immediately after 910 - topic's main category:

toTop.push(1464); // category for Births here
toTop.push(1465); // category for Deaths here

Thanks - LaddΩ chat ;) 12:55, 12 October 2014 (UTC)[reply]

LaddΩ: ✓ Done. — Ayack (talk) 18:49, 12 October 2014 (UTC)[reply]

Add "replaces" and "replaced by"[edit]

{{Editprotected}} Can an admin please add replaces (P1365) and replaced by (P1366), as follows:

// Navigation - lateral
toTop.push(155); // preceded by
toTop.push(156); // succeeded by
toTop.push(1365); // replaces
toTop.push(1366); // replaced by

thanks -- LaddΩ chat ;) 02:32, 30 October 2014 (UTC)[reply]

@Laddo: ✓ Done  Hazard SJ  10:30, 28 November 2014 (UTC)[reply]

Add ship class[edit]

{{Editprotected}} Please make the following changes to User:Soulkeeper/statementSort.js.

Property vessel class (P289) needs to be systematically higher in the list. Can an admin please add, immediately after

toTop.push(279); // subclass of

the following line:

toTop.push(289); // ship class

Also I believe that the subtitle comment

// Navigation - bottom-up

should be rephrased as

// Classification properties

Thanks - -- LaddΩ chat ;) 01:44, 16 March 2015 (UTC)[reply]

✓ DoneAyack (talk) 08:52, 16 March 2015 (UTC)[reply]

Add Birth name[edit]

{{Editprotected}} I would appreciate if an admin could make the following change to User:Soulkeeper/statementSort.js:

Please insert property birth name (P1477) as follows:

...
// Terms/Person
toTop.push(1477); // birth name
toTop.push(735); // given name
...

Thanks - -- LaddΩ chat ;) 20:08, 12 April 2015 (UTC)[reply]

✓ Done --Pasleim (talk) 20:58, 12 April 2015 (UTC)[reply]

Add category of associated people and locator map image[edit]

{{Editprotected}} Please make the following changes to User:Soulkeeper/statementSort.js.

Can an admin please add, immediately after

toTop.push(1465); // category for Deaths here

the following line:

toTop.push(1792); // category of associated people

immediately after

toTop.push(47); // shares border with

the following line:

toTop.push(242); // locator map image

--Gbeckmann (talk) 21:44, 18 April 2015 (UTC)[reply]

✓ Done --Pasleim (talk) 13:10, 22 April 2015 (UTC)[reply]

Add P366: use[edit]

{{Editprotected}} User:Soulkeeper/statementSort.js is missing property has use (P366), which is often essential to understand the nature of an item (see examples at Property talk:P366). I suggest that StatementSort handles it, sorted at the end of section // Classification properties,

immediately after

toTop.push(360); // is a list of

please insert line:

toTop.push(366); // main use of the subject

Thanks -- LaddΩ chat ;) 13:54, 19 April 2015 (UTC)[reply]

✓ Done --Pasleim (talk) 13:07, 22 April 2015 (UTC)[reply]

P1476[edit]

{{Editprotected}} Please, can you add also the new P1476 (title) for works (books, movies, ...). Thank you in advance. --FRacco (talk) 21:52, 4 May 2015 (UTC)[reply]

I support this suggestion. To make it more concrete: Can an admin please add in section Works/Generic, immediately before

toTop.push(144); // based on

the following line:

toTop.push(1476); // title of a work

Thanks --Gbeckmann (talk) 07:41, 5 June 2015 (UTC)[reply]

Still needed today. -- LaddΩ chat ;) 00:29, 3 December 2015 (UTC)[reply]
✓ Done  Hazard SJ  05:15, 3 December 2015 (UTC)[reply]

Suggestion[edit]

{{Editprotected}} Can an admin please add, immediately after

toTop.push(242); // locator map image

the following line:

toTop.push(1621); // detail map

immediately after

toTop.push(131); // is in the administrative unit

the following line:

toTop.push(1001); // applies to jurisdiction

--Gbeckmann (talk) 21:34, 5 June 2015 (UTC)[reply]

✓ Done Sorry fo the delay --Pasleim (talk) 14:10, 7 January 2016 (UTC)[reply]

Group media accounts[edit]

{{Editprotected}} Hi, some website account informations get wrongly repeated between website account on (P553) and a combination of specialised properties like Twitter (X) username (P2002). To minimize this, I would appreciate if these items could be grouped by StatementSort.

Can an admin please add, near the bottom, right before line :

	// Move statements to bottom

those lines (so that they fall just above unsorted properties):

	// Website account IDs
	toTop.push(553);  // Generic website account
	toTop.push(2013); // Facebook
	toTop.push(2002); // Twitter
	toTop.push(2003); // Instagram
	toTop.push(2035); // LinkedIn
	toTop.push(2037); // GitHub
	toTop.push(2038); // ResearchGate

Thanks ---- LaddΩ chat ;) 01:47, 9 December 2015 (UTC)[reply]

done --Pasleim (talk) 12:52, 14 December 2015 (UTC)[reply]

Better sort operators and subsidiaries[edit]

{{Editprotected}} Hi, some key info does not get sorted. Could an admin please add the following lines of code ?

  • Right after this line (section "Terms/Generic - bottom-up") :
	toTop.push(127); // owned by

...add these ones:

	toTop.push(749); // parent company
	toTop.push(137); // operator
  • Right after this line (section "Organization"):
	toTop.push(576); // dissolution

...add these ones:

	toTop.push(126); // maintained by
	toTop.push(355); // subsidiary
	toTop.push(121); // item operated

  • Right after this line :
	// Move statements to bottom

...add this one:

	toBottom.push(1687); // Wikidata property

Thanks -- LaddΩ chat ;) 13:45, 7 January 2016 (UTC)[reply]

✓ Done --Pasleim (talk) 14:10, 7 January 2016 (UTC)[reply]

Cleaned up code[edit]

First of all, thanks for updating the page while I wasn't paying attention. I recently cleaned up the code some, making it smaller and hopefully more efficient. As a consequence, what was previously formatted like this:

toBottom.push(1687); // Wikidata property

... is now formatted like this:

1687, // Wikidata property

This should also make the property lists easier to manage. - Soulkeeper (talk) 11:36, 18 January 2016 (UTC)[reply]

Great, thanks for keeping it alive! — Ayack (talk) 20:23, 18 January 2016 (UTC)[reply]

Group symbols of entities[edit]

{{Editprotected}} Please

  • Right after this line (section "Terms/Generic - bottom-up") :
		41, // flag image 

...add these ones:

		163, // flag description 
		158, // seal image 
		418, // seal description 
		94, // coat of arms image 
		237, // coat of arms description 
		154, // logo image
		1451, // motto text
		1546, // motto description

Thanks -- LaddΩ chat ;) 20:39, 12 June 2016 (UTC)[reply]

✓ Done --Pasleim (talk) 08:20, 19 June 2016 (UTC)[reply]


Ordering of event-related properties[edit]

{{Editprotected}} Please, right before line "// Website account IDs" (after Works), please start a new section to insert the following:

		// Event
		585, // point in time
		533, // target
		710, // participant
		1120, // number of deaths
		1339, // number of injured
		1446, // number of missing
		1590, // number of casualties
		1840, // investigated by

Muchas gracias! -- LaddΩ chat ;) 22:43, 20 June 2016 (UTC)[reply]

done --Pasleim (talk) 11:37, 27 June 2016 (UTC)[reply]

More "lateral" navigation[edit]

{{Editprotected}} Could an admin please:

1) move "18, // image" to the top of its section, "// Navigation - lateral"
2) in its place, right after "935, // Commons gallery", please insert:
1151, // topic's main Wikimedia portal
1204, // Wikimedia portal's main topic
1424, // topic's main template
1423, // template's main topic
2354, // has list

Thanks again -- LaddΩ chat ;) 20:51, 1 July 2016 (UTC)[reply]

done --Pasleim (talk) 20:54, 1 July 2016 (UTC)[reply]

Higher priority for "Point in time" P585[edit]

{{Editprotected}} 1. Could an admin please move point in time (P585) (currently in // Events) up to section // Navigation - lateral?

Please relocate it between 18, // image and 155, // preceded by, so that the associated date/year can be seen before the preceding/succeeding items.

2. Independent change: please add , immediately after 1792, // category of associated people :

1791, // category of people buried here

Cheers -- LaddΩ chat ;) 16:35, 7 July 2016 (UTC)[reply]

not done. Sorting is meanwhile done on MediaWiki:Wikibase-SortedProperties and the structure has quite heavily changed during the last year. --Pasleim (talk) 14:47, 21 August 2017 (UTC)[reply]

How do I use this?[edit]

I copied the code and the boxes turned green. What do I do next? MechQuester (talk) 15:30, 9 August 2016 (UTC)[reply]

@MechQuester: Nothing else to do... The order of statements is imposed for all boxes that became green. The other statements remain in the order that they were defined. -- LaddΩ chat ;) 20:15, 9 August 2016 (UTC)[reply]
@Laddo:, Do the items in the boxes get re-arranged in order? MechQuester (talk) 02:44, 10 August 2016 (UTC)[reply]
@MechQuester: StatementSort reorders item properties only; it does not reorder values within each property (see this diagram), nor properties within composite sources such as this one. Its primary purpose is to ensure that key information about each item gets listed in appropriate & systematic order, the most informative properties at the top of the list for each item page. LaddΩ chat ;) 11:05, 10 August 2016 (UTC)[reply]
@Laddo:, thank you. MechQuester (talk) 13:42, 10 August 2016 (UTC)[reply]

government-related items[edit]

{{Editprotected}} Could you please group the government-related items together? I suggest they go beside the "Organization" group and be in this order:

122, // basic form of government
1906, // office held by head of state
35, // head of state
1313, // office held by head of government
6, // head of government
208, // executive body
194, // legislative body
209 // highest judicial authority
1304 // central bank
530 // diplomatic relation

Also, the first three items in the "Organization" group should probably have these inserted:

112, // founder
2388, // office held by head of the organisation
169, // chief executive officer
488, // chairperson
1789, // chief operating officer
1037, // manager
2828, // corporate officer
2124, // membership
2813, // mouthpiece
2389, // organisation directed from the office

Thanks! --Arctic.gnome (talk) 16:11, 10 August 2016 (UTC)[reply]

done on MediaWiki:Wikibase-SortedProperties --Pasleim (talk) 12:38, 26 May 2017 (UTC)[reply]