Statements on Lexeme pages are identified with the HTML attribute id, whose values are the corresponding property IDs. This can lead to multiple HTML elements with the same id, since the same property can be used on the Lexeme level, in each Form and later also Sense. However, the id value must be unique within the HTML document. It also causes issues when you use it as a link fragment to link to a specific statement group.
- In L2, both L2-F1 and L2-F3 have a statement with <div class="wikibase-statementgroupview listview-item" id="P898">, which makes the HTML document invalid and the URL https://www.wikidata.org/wiki/Lexeme:L2#P898 ambiguous.
GIVEN I am on a Lexeme
AND the Form F1 has a statement using property P123
THEN the statement group for F1 has an HTML id "F1-P123"
- Statement groups in Forms have the Form ID added to their statement group ID
- Statement groups on the Lexeme level as well as on items and properties continue to have only the property ID in their statement group ID
- The use of the property id as HTML id attribute is hard-wired into the respective jquery ui widget (view/resources/jquery/wikibase/jquery.wikibase.statementgroupview.js) and the widget's value gets used (this.options.value.getKey() line 92 _updateId) - an (optional) prefix is not supported at the moment
- validate resulting html
- e.g. using selenium: add a dedicated test that creates a fleshed out lexeme with multiple statements, forms etc and asserts that the HTML ids are unique
- somehow get the diagnose data of the mw tidy