Page MenuHomePhabricator

Introduce accuracy check for dates
Closed, ResolvedPublic10 Estimated Story Points

Description

Our upload framework will upload a date with the value YYYY even if the item already has a more precise value, like YYYY-MM-DD.

Technically this is correct behavior because a claim can have multiple values. Normally, multiple values are not uploaded if they are identified as duplicates, however in this case it is not applicable because obviously those are two different values.

Thus we need an extra check specifically for datetime values to detect whether the new value is a less precise version of the old value, in which case it should be treated as a duplicate and not uploaded.

Note that if the two values are actually different, like 1988-02-02 and 1989, they should not be treated as duplicates, as they are not different versions of the same datetime.

This is very relevant to the authority upload, as Libris contains mostly only years of authors' birth/death dates.

Event Timeline

Ended up introducing a simple check in Uploader.py that gets triggered automatically on every birth/death date claim. It doesn't affect the WikidataStuff layer.

If we end up wanting to use it in the general framework, and idea is to be able to pass it as argument to WikidataItem.add_statement() or similar. In this form, it recognizes and skips the birth/death date if it's in the format YYYY but the WD item already has one as YYYY-MM-DD, same year value. If the year is different, the upload proceeds normally.

If we end up wanting to use it in the general framework, and idea is to be able to pass it as argument to WikidataItem.add_statement() or similar. In this form, it recognizes and skips the birth/death date if it's in the format YYYY but the WD item already has one as YYYY-MM-DD, same year value. If the year is different, the upload proceeds normally.

Can you break out this as a separate task?