Page MenuHomePhabricator

Handle multiple values for a property
Open, MediumPublic

Description

Currently if there are multiple values for a property we end up harvesting none of them.

An example is nl-wd where P131 normally has two values (municipality and province). As a result adm1 is always empty after the harvest.

Event Timeline

One way of doing it is by allowing multiple values (valid if a monument goes over two admin areas, think historical railroad) this requires reworking assumptions everywhere about always having single values.

Another (complimentary) solution is to allow extra config parameters which, when present, also requires the P131 to be of a certain instance/subclass.

No longer sure this is what actually happens.

When an item is encountered where one of the selected for values has multiple values the sparql query actually returns multiple results of the whole item.
The script is blissfully unaware of this so it processes each one independently.
These are then inserted into the database one at a time. BUT since the two items share the same id value the second result simply overwrites the first and in the end only the last encountered result is left.

It's unlikely that the order of the results is guaranteed so the resulting data will probably switch around between the values between the harvests.