aude added a comment.

my changes for the timing issue probably do help, but I looked at the gadget 
further during the weekend.

It works by going through all statements on an item page, finds the main snak 
property, adds it to an array containing a list of property ids.  Then it does 
a batch api request to wbgetentities with all these property ids.  If the 
Property has a "formatterURL" statement then it is added to another 
"properties" array and the links are added.

There are a few issues:

1. If a particular property is only used in a reference or qualifier (e.g. not 
in a main snak), then the value does not get linked
2. If there are more than 50 properties in the wbgetentities request, then only 
the first 50 are returned, due to api limits. (possibly this could be chunked 
into multiple requests)
3. There is a performance cost to doing an api request (for all page views, 
since this is a default gadget).

Best solution in my opinion is to have the PROPERTIES array (all properties 
that have formatterURL) maintained by a bot on wiki, on a js / json page. The 
bot could address issue 1 and 2, and avoid the api request.

There also may be issues with initialization timing of the gadget, per above, 
that the above change helps fix.


TASK DETAIL
  https://phabricator.wikimedia.org/T89259

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: aude
Cc: Lydia_Pintscher, JanZerebecki, Aklapper, aude, Ebekebe, Wikidata-bugs, 
Jdouglas



_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to