Hi all!
This is an announcement for a significant change to the Wikibase entity format, which went live the beginning of September. It potentially affects clients that process snaks.
Internally, Wikibase assigns a hash to each snak (which is just the hash function (Q183427) of an internal representation of the snak). Those hashes were previously emitted for snaks that appeared in qualifiers, but not for the main snak or reference snaks of a statement. With the change, the hashes are emitted for all snaks, regardless of where they appear. This means that a snak can now look like this:
{
"snaktype": "value",
"property": "P370",
"hash": "682fdb448ef68669a1b728a5076836da9ac3ffae",
"datavalue": {
"value": "some text",
"type": "string"
},
"datatype": "string"
}
The hashes are also added to the HTML output, as an additional class similar to the statement ID class on statements:
<div class="wikibase-statementview wikibase-statement-Q4115189$29acf9c6-450a-7612-d206-049f5fe58328">
<!-- … -->
<div class="wikibase-statementview-mainsnak">
<div class="wikibase-snakview wikibase-snakview-682fdb448ef68669a1b728a5076836da9ac3ffae">
<!-- … -->
</div>
</div>
</div>
The ultimate goal of this is to make any snak addressable in the DOM, which is necessary for checking constraints on qualifiers and references (T168532).
It should be noted that unlike statement IDs, snak hashes are not identifiers. They are not stable, and may change at any time with the internal format.
Please let us know if you have any comments or objections.
-- Lucas
Relevant tickets:
Relevant patches: