# Relationships across merge

**URL:** <https://community.metabrainz.org/t/relationships-across-merge/397260>\
**Category:** MusicBrainz\
**Tags:** merging\
**Created:** [September 9, 2018, 9:02am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260 "2018-09-09T09:02:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![highstrung](https://community.metabrainz.org/user_avatar/community.metabrainz.org/highstrung/32/15259_2.png) [@highstrung](https://community.metabrainz.org/u/highstrung)\
**Post date:** [September 9, 2018, 9:02am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/1 "2018-09-09T09:02:49Z")

</div>

In the notes to a proposed [recording merge](https://musicbrainz.org/edit/55818520) I said that, to my understanding, relationships from a source recording are moved to the target as part of the merge. However I don’t have a definitive source for that statement. Can anyone confirm or deny?

I think the following are _not_ copied in a merge:

- name, artist credit, and length (target’s values are preserved)
- disambiguation comment
- annotation? (just a guess, but it seems similar to disambiguation)

And, as I understand it, any edit history from the source that’s before the creation date of the target is also lost, which is why merging into the older MBID is preferred.

---

<div class="post-metadata">

**Author:** ![alf](https://community.metabrainz.org/user_avatar/community.metabrainz.org/alf/32/43078_2.png) [@alf](https://community.metabrainz.org/u/alf)\
**Post date:** [September 9, 2018, 9:13am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/2 "2018-09-09T09:13:04Z")

</div>

The Documentation says that the following informations are carried to the target recording:  
[https://musicbrainz.org/doc/How\_To\_Merge\_Recordi…](https://musicbrainz.org/doc/How_To_Merge_Recordings)

“Basic information like name, artist and length are carried over from the selected recording (this one you merge into) and every other information like identifiers (AcoustID) or releases are added from the other recordings.”  
What about the relationships to Artists (the musicians of the recording)?

---

<div class="post-metadata">

**Author:** ![joiletjake](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/j/a5b964/32.png) [@joiletjake](https://community.metabrainz.org/u/joiletjake)\
**Post date:** [September 9, 2018, 10:24am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/3 "2018-09-09T10:24:11Z")

</div>

You are almost correct. Unique relationships are moved over from the source to the target recording. The relationships are however merged if identical relationships already exists on the target recording. I.e. the same relationship (“artist performed electric guitar” or similar) will not be merged if the source relationship has a date and the target relationship doesn’t have a date.

- The target’s recording name, artist AC and disambiguation is preserved.
- The recording length is automatically calculated but I’m not sure which length that is preserved if there only are two releases.
- Annotation - not sure, they are merged in release merges so that might also be the case here.

---

<div class="post-metadata">

**Author:** ![reosarevok](https://community.metabrainz.org/user_avatar/community.metabrainz.org/reosarevok/32/69228_2.png) [@reosarevok](https://community.metabrainz.org/u/reosarevok)\
**Post date:** [September 9, 2018, 10:24am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/4 "2018-09-09T10:24:22Z")

</div>

Annotations should be combined, I think, if both have one, with some separator.

---

<div class="post-metadata">

**Author:** ![Billy\_Yank](https://community.metabrainz.org/user_avatar/community.metabrainz.org/billy_yank/32/1585_2.png) [@Billy\_Yank](https://community.metabrainz.org/u/Billy_Yank)\
**Post date:** [September 9, 2018, 11:02pm UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/5 "2018-09-09T23:02:18Z")

</div>

I believe recording length is averaged from all linked releases.

---

<div class="post-metadata">

**Author:** ![highstrung](https://community.metabrainz.org/user_avatar/community.metabrainz.org/highstrung/32/15259_2.png) [@highstrung](https://community.metabrainz.org/u/highstrung)\
**Post date:** [September 10, 2018, 12:12am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/6 "2018-09-10T00:12:58Z")

</div>

> [@joiletjake](#):
>
> the same relationship (“artist performed electric guitar” or similar) will not be merged if the source relationship has a date and the target relationship doesn’t have a date.

So if both source and target have a credit for “Jimi Hendrix performed electric guitar”, but only the source has a date, will the merged recording have only the credit with no date? Or it will have both dated and no-date credits because they’re not identical?

---

<div class="post-metadata">

**Author:** ![highstrung](https://community.metabrainz.org/user_avatar/community.metabrainz.org/highstrung/32/15259_2.png) [@highstrung](https://community.metabrainz.org/u/highstrung)\
**Post date:** [September 10, 2018, 1:06am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/7 "2018-09-10T01:06:28Z")

</div>

I just remembered there’s a [test server](https://test.musicbrainz.org) for just this kind of thing.

**Annotations** are combined, as reosarevok thought. The annotation from the target release comes first, followed by a horizontal line and then the source annotation.

**Artist credits** that are identical except for one having a date and the other no date, are merged into a single credit that includes the date.

Artist credits that differ by instrument “credited as” are _not_ merged. So if one release had “guitar: Jimi Hendrix” and the other had “guitar [lead guitar]: Jimi Hendrix”, both will appear as separate relationships on the merged recording.

Artist credits _are_ merged when one has the artist “credited as” specified and one does not. So credits for “guitar: Jimi Hendrix” and “guitar: James “Jimi” Hendrix” would result in a single credit with the as-credited name. If both source and target have ‘credited as’, the as-credited name from the target is used.

---

<div class="post-metadata">

**Author:** ![highstrung](https://community.metabrainz.org/user_avatar/community.metabrainz.org/highstrung/32/15259_2.png) [@highstrung](https://community.metabrainz.org/u/highstrung)\
**Post date:** [January 22, 2019, 12:19am UTC](https://community.metabrainz.org/t/relationships-across-merge/397260/8 "2019-01-22T00:19:18Z")

</div>

> [@highstrung](#):
>
> And, as I understand it, any edit history from the source that’s before the creation date of the target is also lost, which is why merging into the older MBID is preferred.

In case anyone reads this old(ish) thread, the above is NOT correct. Edit history from the source is preserved even if it’s older than the creation of the target.

The major reason for preferring the older MBID as the target is simply to accommodate any consumers of MB data who don’t properly handle the redirects created by a merge. The assumption is that such consumers are more likely to have a reference to an older MBID than a newer.
