-
New Feature
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
I've mentioned this in the comments of MBS-11377 already. It seems to happen quite often that editors mistakenly enter an artist or label's IPI number as a work identifier. For some work identifier types, these can be found through the proposed validation, but for others, the format of the agency's identifier is the same as an IPI number (e.g., ASCAP and BMI) so there would be no way to distinguish between these automatically.
Possible query:
SELECT w.id as work, law.entity0 AS artist, wat.name, wa.work_attribute_text, ai.ipi FROM work w JOIN work_attribute wa ON w.id = wa.work JOIN work_attribute_type wat ON wat.id = wa.work_attribute_type JOIN l_artist_work law ON law.entity1 = w.id JOIN artist_ipi ai ON ai.artist = law.entity0 WHERE wat.parent = 14 AND TRIM(LEADING '0' FROM wa.work_attribute_text) = TRIM(LEADING '0' FROM ai.ipi);
Returns 47 rows (31 unique works) from a recent data dump. A similar query for labels returns 4 rows.
In the meantime, I've added the works returned by that query on my replica into a collection. I'll probably be fixing those up soon-ish though. Here's the query for that one:
SELECT DISTINCT w.gid FROM work w JOIN work_attribute wa ON w.id = wa.work JOIN work_attribute_type wat ON wat.id = wa.work_attribute_type WHERE wat.parent = 14 AND TRIM(LEADING '0' FROM wa.work_attribute_text) IN ( SELECT TRIM(LEADING '0' FROM ai.ipi) FROM artist_ipi ai JOIN l_artist_work law ON law.entity0 = ai.artist WHERE law.entity1 = w.id UNION ALL SELECT TRIM(LEADING '0' FROM li.ipi) FROM label_ipi li JOIN l_label_work llw ON llw.entity0 = li.label WHERE llw.entity1 = w.id);