Page MenuHomePhabricator

QuantityValue quantityUnit contains both Q and P value in Wikidata Query Service - P value is wrong
Closed, DuplicatePublicBUG REPORT


Steps to Reproduce:

  1. See (veteran tree), specifically the value of P2670 (has parts of the class) and its qualifier P1114 (quantity). It has no quantity unit specified.
  2. In the RDF version search for wikibase:quantityUnit <> - the quantity unit is set to Q199 - which stands for one. So far so good.
  3. In the Wikidata Query Service, run this query. It searches for the quanityUnits of this qualifier.

Actual Results:

  1. It returns wd:P199 and wd:Q199

Expected Results:

  1. It should return just wd:Q199

Event Timeline

This may happen because value nodes are not updated when data is updated (since they are supposed to be immutable). So if some bad data sneaked in when the problem was there, the bad value (and possibly reference since they behave the same way) nodes are still there. The best way to do it would be:

  1. Find all value/ref nodes having this problem
  2. Find for each node at least one item that uses them (you don't need more)
  3. Delete all triples with subject of this value/ref node (this unfortunately will have to be done manually by somebody with production access, public endpoint does not allow deletes)
  4. Update data for all items in (2) - this would fetch proper data for the nodes.

Should each server be depooled in turn during that fix, to avoid users seeing an inconsistent state (node was deleted and not yet recreated by update), or is that not worth the effort?

I don't think it's worth bothering with depooling, unless the number of affected items is very large, it should be quick enough so nobody should really notice.