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:

--
Lucas Werkmeister
Software Developer (Intern)

Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
https://wikimedia.de

Imagine a world, in which every single human being can freely share in the sum of all knowledge. That‘s our commitment.

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/029/42207.