MediaWiki talk:Gadget-AuthorityControl.js/Archive/2015

Latest comment: 8 years ago by Nikki in topic Globe

Does not work on old revisions of items

@Ricordisamoa, Fomafix: The gadget does not work on old revisions of items. Can it be fixed? I only found that it fails at $( ':wikibase-statementview' ), so I replaced it with $( '.wb-statementview' ), which made the line work. However, then it fails at $.data( this, 'statementview' ) two lines lower. I have no idea where these data are coming from, so I gave up. Hope that helps, Petr Matas 05:03, 10 January 2015 (UTC)

@Petr Matas: That's phab:T85804. --Ricordisamoa 10:55, 10 January 2015 (UTC)
I implemented an automatic load of module jquery.wikibase.entityview: User:Fomafix/MediaWiki:Gadget-AuthorityControl.js (diff). The error Error: Syntax error, unrecognized expression: unsupported pseudo: wikibase-statementview does not occur anymore. The gadget still does not add the links to properties on old versions and on diff pages. I guess that some other modules are missing. --Fomafix (talk) 18:40, 10 January 2015 (UTC)

link the property of website username or ID (P554)

isn't it also possible to link the value of the website account on (P553) and website username or ID (P554) properties? For instance 9684#P553 links to facebook, youtube and twitter. these should be linked like:

Twiiter
https://twitter.com/[name]
Facebook
https://www.facebook.com/[name]
Youtube
https://www.youtube.com/user/[name]
etc.
https://…/user/[name]/profile

I think it might be useful to verify that the name has been entered correctly--Shisma (talk) 14:12, 13 January 2015 (UTC)

I can try to implement this. --Fomafix (talk) 15:05, 13 January 2015 (UTC)

I think website account on (P553) and website username or ID (P554) in The New York Times (Q9684) should be exchanged. --Fomafix (talk) 15:11, 13 January 2015 (UTC)

what do you mean? --80.153.132.36 16:01, 13 January 2015 (UTC)

The website username or ID (P554) is a property of the item not a qualifier of an other property. --Fomafix (talk) 18:34, 15 January 2015 (UTC)

the description of website username or ID (P554) is "username on a website that the person or organization has an account on (only use as qualifier of P553)" . also it is an instance of Wikidata qualifier (Q18615010). also it is, as far as i can see only used as a qualifier. did i understand you right? --Shisma (talk) 21:33, 15 January 2015 (UTC)

That usage is semantical wrong. --Fomafix (talk) 21:40, 15 January 2015 (UTC)

is it? well, it wasn't my idea 😄--Shisma (talk) 21:44, 15 January 2015 (UTC)


Properties website account on (P553)/website username or ID (P554) are looked as very strange construction. I think its are needed to be converted to something else. For example to property set: "Facebook account", "Twitter account" and etc. — Ivan A. Krestinin (talk) 16:02, 7 February 2015 (UTC)

What happened to localized links ?

So the tool now uses formatter URL (P1630) rather than a local list of links. That is all very good except that most translations have been lost, like the CELEX number (P476) link used to have the right language among all those of the European Union, but is now English only. That should be fixed. --Zolo (talk) 16:49, 2 February 2015 (UTC)

I see two possibilities to support this.
  • Adding a second parameter $2 which get replaced by wgUserLanguage.
  • Add formatter URL (P1630) several times and add qualifiers.
--Fomafix (talk) 16:55, 2 February 2015 (UTC)
Usually site supports very limited language set, 3-4 languages, not more. So the first possibility needs some additional field to specify language set. Possibility 2 is looked more natural in this situation. — Ivan A. Krestinin (talk) 15:51, 7 February 2015 (UTC)
I think we need both. The first variant for pages that support a BCP 47 language code as parameter and the second for pages which have a few different URLs for different languages. --Fomafix (talk) 16:09, 7 February 2015 (UTC)

How do we format dual-protocol links?

What's the current practice for formatter URL (P1630)? At first I added just // on the front of a URL, but then the Property talk:P1630 has a discussion in which some people disagree. Real example: P907 (P907), which references a closed website, but has a Wayback Machine URL that can be reached with http or https. --Closeapple (talk) 16:23, 23 February 2015 (UTC)

Protocol-relative is our standard in Wikimedia projects for any link to websites supporting both http and https, from the coding side. Nothing forbids to force https if there is consensus, but that's best discussed in the relevant "Property talk" page. --Nemo 11:19, 6 March 2015 (UTC)

Update for snakview css changes

{{Editrequest}}

Some of the css class names for snak view will be changing when we deploy new code soon (not tomorrow, but maybe next week).

Here are the minimal changes needed to both keep the gadget working now and when this changes:

https://www.wikidata.org/w/index.php?title=User:Aude/authority.js&oldid=200607234

Aude (talk) 10:40, 2 March 2015 (UTC)

  Done. Sjoerd de Bruin (talk) 12:44, 2 March 2015 (UTC)

New properties

{{Editrequest}}

-- Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 22:00, 6 March 2015 (UTC)

@Pigsonthewing: The property formatters are not stored in the gadget anymore, except for a few special cases; use formatter URL (P1630) instead, like this. --Ricordisamoa 23:24, 6 March 2015 (UTC)
@Ricordisamoa: Thank you. I didn't know that was now in place; it's a good move. I've updated Wikidata:Property creators accordingly, Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 23:29, 6 March 2015 (UTC)

Meta: Use a template for requests

Could we have a template for submitting requests? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 21:22, 6 March 2015 (UTC)

@Pigsonthewing: Not necessary, see above. --Ricordisamoa 23:26, 6 March 2015 (UTC)

The latest change

@Matěj Suchánek: hello, please revert this change. The gadget stops working after it. My environment: Monobook theme, browser: Opera Presto, test item: Q18407239.Ivan A. Krestinin (talk) 13:04, 22 March 2015 (UTC)

I have just noticed the same. Will revert but someone should somehow remove that code. Matěj Suchánek (talk) 13:05, 22 March 2015 (UTC)

Changes needed due to deployment of new code

{{Editrequest}} The css selector for snak view changed again :( and the javascript widget for qualifiers is no longer initialized on page view, which means the current version of the gadget will no longer be able to find and link identifiers in qualifiers. A similar change is coming, probably next deployment, to no longer initialize the javascript widget for references on page views.

https://www.wikidata.org/w/index.php?title=User%3AAude%2Fauthority.js&diff=206468429&oldid=200607234&uselang=en

I have tried these changes on test.wikidata [1] [2]. As far as I can tell, the changes work okay, but welcome anyone to make further improvements. Aude (talk) 18:37, 24 March 2015 (UTC)

PS. made a tracking bug on Phabricator [3] which links to open issues related to the gadget. Aude (talk) 18:47, 24 March 2015 (UTC)
@Aude: Thanks for the fix, actually I didn't notice your request here but I knew from Phabricator about the fixed code, so I saved it "without permission". Matěj Suchánek (talk) 21:11, 24 March 2015 (UTC)
Thanks Matěj :) If there are further issues, please let me know or add tasks in phabricator. Aude (talk) 00:49, 25 March 2015 (UTC)

Riksdagen person-ID (P1214)

A more easily read version of formatter URL (P1630) has been added to the property. Maybe it should be preferred here? -- Innocent bystander (talk) 12:30, 26 April 2015 (UTC)

MediaWiki:Gadget-AuthorityControl.js always uses the first entry of formatter URL (P1630). It does not make sense to have more than one entry. Remove the unwanted entry in Riksdagen person-ID (P1214). --Fomafix (talk) 05:36, 27 April 2015 (UTC)
I see! It makes sense in this case, since one version is machine-readable (xml), while the other is man-readable (html). -- Innocent bystander (talk) 05:58, 27 April 2015 (UTC)
Is the formatter URL (P1630) used some where else than in MediaWiki:Gadget-AuthorityControl.js? Where do you need an XML version? --Fomafix (talk) 06:26, 27 April 2015 (UTC)
Bots who collect information from that database have more use of an XML-version than an html-version. The XML-version also have a little more information than the html-version. -- Innocent bystander (talk) 06:51, 27 April 2015 (UTC)
Which bot uses formatter URL (P1630)? --Fomafix (talk) 07:10, 27 April 2015 (UTC)
Does the site also use content negotiation, such that especially "bots" would actually be better served without explicit "xml"? -- Gymel (talk) 07:25, 27 April 2015 (UTC)
@Fomafix: My bot does, even if I haven't started to use if for P1214 yet.
@Gymel: You can read more about data.riksdagen.se here. I have only installed the id in some of the items, not used the database myself yet. -- Innocent bystander (talk) 07:41, 27 April 2015 (UTC)
A HTTP content negotiation has to be supported by the external target server. When the external target server only has different URL for different content versions a local content negotiation on application layer has to be implemented. This can implemented by a qualifier at formatter URL (P1630) in Riksdagen person-ID (P1214). MediaWiki:Gadget-AuthorityControl.js has to be extended to support this qualifier. Do you have any suggestions for a qualifier? --Fomafix (talk) 07:59, 27 April 2015 (UTC)

Link 'website account on' -> A, 'website username' -> B

It would be great to also be able to link certain qualifiers, for example claims that have Property:P553 with a qualifier of Property:P554. Where the value of A is for example, Twitter Q918 then link the qualifier value to the location of the twitter account. ·addshore· talk to me! 12:09, 6 May 2015 (UTC)

It has already been discussed before... I don't personally know how to efficiently handle this. Matěj Suchánek (talk) 12:38, 6 May 2015 (UTC)

fix for P1323

{{Editprotected}} per the discussion about broken TA98 links, can we add

        case 1323: // TA98
                linkValue = value.substring( 1, 16 ); // Skip initial letter
                break;

which is the same trick used for P628? assuming this is the way to fix it. thank you. Frietjes (talk) 17:06, 4 August 2015 (UTC)

@Matěj Suchánek, Fomafix, Tobias1984, BoH:, for an example of a broken link see the TA98 link in Q9368, which requires stripping the leading A when forming the URL. Frietjes (talk) 17:10, 4 August 2015 (UTC)
  Done and linked example works now. Thanks, John F. Lewis (talk) 14:31, 5 October 2015 (UTC)

Multiple formatter URLs

Rather than use only the first URL value from the formatter URL statement, could the gadget be updated to create a link for each formatter URL value? I believe this is the part of the code that would need to be changed:

		if ( PROPERTIES.hasOwnProperty( numericPropertyId ) ) {
			var $value = $( el ).find( valueSelector ).first(),
				$link = createLinkForString( numericPropertyId, $value.text() );

			$value.html( $link );
		}

Specifically for PMCID (P932) and PubMed ID (P698), three different organizations (Europe PubMed Central, PubMed Central, and PubMed Central Canada) use the same identifiers to link to abstracts and full text articles, but those are coupled with different additional website functionality and standards interlinking depending on which of the three websites you visit. It would be good, for articles that are available on more than one of the PMC International sites, to link to all of those where the abstract or full text is available.

A qualifier could be added to each formatter URL value to differentiate between links, so for this article, rather than just "4296478" we could end up with something like:

4296478 (PubMed Central)
4296478 (Europe PubMed Central)
4296478 (PubMed Central Canada)

Where the contents of the parentheses comes from the qualifier.

Ahamelers (talk) 15:19, 4 September 2015 (UTC)


Reference link fix

The script doesn't work references, because if a statement has multiple reference "rows", a selector returns multiple hits when the subsequent code is only for one. See this change for the fix. A similar fix might be necessary for qualifiers, but I couldn't find a good test case. --Magnus Manske (talk) 12:48, 20 October 2015 (UTC)

@Ricordisamoa: Would be nice to apply the fix. Don't want to run on my fork forever ;-) --Magnus Manske (talk) 12:40, 23 October 2015 (UTC)

@Magnus Manske:   Done. — Ayack (talk) 14:35, 23 October 2015 (UTC)

Should work on property pages

So on Oxford Dictionary of National Biography ID (P1415), there is now a property Mix'n'match catalog ID (P2264), which should link to the respective URL, but doesn't. I suggest a change in the script code from

if ( mw.config.get( 'wgNamespaceNumber' ) !== 0 || !mw.config.exists( 'wbEntityId' ) ) {

to

if ( ( mw.config.get( 'wgNamespaceNumber' ) !== 0 && mw.config.get( 'wgNamespaceNumber' ) !== 120 ) || !mw.config.exists( 'wbEntityId' ) ) {

That should enable the code on Property pages as well. --Magnus Manske (talk) 11:08, 9 November 2015 (UTC)

@Magnus Manske:   Done. — Ayack (talk) 12:42, 9 November 2015 (UTC)

Globe

After reading Wikidata:Contact_the_development_team#Problem_with_moon_crates_interactive_view, I had a look at Q1134165#P625.

It seems that "globe" isn't set correctly: "globe:earth" despite Q405 being specified. --- Jura 12:46, 26 November 2015 (UTC)

Actually, it's written in the code "/* BUG: .getGlobe() returns Q2 always */" --- Jura 13:00, 26 November 2015 (UTC)
See phab:T105321. - Nikki (talk) 04:59, 30 November 2015 (UTC)
Return to "Gadget-AuthorityControl.js/Archive/2015" page.