security-force-monitor / sfm-cms

Platform for sharing complex information about security forces. Powers WhoWasInCommand.com
https://whowasincommand.com
10 stars 3 forks source link

incident import question - can multiple rows share the same entity ID? #820

Closed tlongers closed 1 year ago

tlongers commented 1 year ago

This is how we currently express the situation where an incident has two indentified perpetrator units. The incident is split across multiple rows sharing the same entity id:

incident:id:admin="A",incident:perpetrator_unit_id:admin="1"
incident:id:admin="A",incident:perpetrator_unit_id:admin="2"

Same pattern applies for any of the incident:perpetrator_~ options.

@hancush does the importer validate or reject input rows with this characteristic?

smcalilly commented 1 year ago

@tlongers yes, it validates the input rows with this characteristic.

here is the relevant code: https://github.com/security-force-monitor/sfm-cms/blob/master/sfm_pc/management/commands/import_country_data.py#L2240-L2339

specifically, see line 2251 where it loops over the perpetrators and connects each person to a violation, and similarly, line 2304 where it loops over perpetrator organizations.

here's an example with data on the live site: https://whowasincommand.com/en/violation/view/42c9ca05-6582-4639-ac15-d7b99e17d803/

you can see on line 16 and 17 in mexico's incident sheet where this data originates: https://docs.google.com/spreadsheets/d/168KuHwUr9565zWaQVZ5au3qtGOb-qyJx_WOwNzqt_Eo/edit#gid=1950930077

tlongers commented 1 year ago

Thanks for the thorough answer Sam; super helpful. Closing.