Why do recording and release names seem to be swapped?

Tags: #<Tag:0x00007f4d550c8970>

Hi all,

Just when I thought I was on top of the MB database tables “recording” and “release” - the following has confused me - I hope someone can explain why this is happening:-

I am using the API (JSON format) to find the Release (CD Name) from the Title and Artist. In this case the Artists are “John Farnham” and “Human Nature”, and the Title is “Every Time You Cry”, so the API request is:-

http://musicbrainz.org/ws/2/recording?query=recording:"Every Time You Cry" AND artist:"John Farnham" AND artist:"Human Nature"&limit=100&inc=tags&fmt=json

I am expecting the reply to include the release Title “Everytime You Cry” (FYI the mbid is f0db5756-2c98-4e11-9baf-fc64500077e4), however, this release is NOT included in the reply. Note the spelling difference between the recording (Every Time You Cry) and the release (Everytime You Cry).

However, if I change the spelling of the recording to that of the release as per below, I get the reply expected.

> http://musicbrainz.org/ws/2/recording?query=recording:"Everytime You Cry" AND artist:"John Farnham" AND artist:"Human Nature"&limit=100&inc=tags&fmt=json

Can someone please explain why the recording and release names seem to be swapped?

Thanks in advance

It’s because the recording you are searching is titled “Everytime You Cry” in MB:

It probably should be renamed, if the other spelling is more common. Note that there is a difference between track title (how the recording is title is labeled on a specific release) and recording title (the general title of the recording). Most often both are identical, but there are also many cases where they aren’t.

3 Likes

Thank you for your reply @outsidecontext, but I don’t understand your answer. Perhaps I didn’t make the issue clear.

The name of the CD is “Everytime You Cry”
The first track on the CD is “Every Time You Cry”
The artists are “John Farnham” and “Human Nature”

When I look at this CD details through the MB web interface - this information is correct.

I am trying to develop an algorithm that will use the API interface to provide additional information on a CD, Track, Artist(s), Genre etc when I only have the Artist Name and Track Title.

My initial understanding is that the following query would do the job:-

http://musicbrainz.org/ws/2/recording?query=recording:"Every Time You Cry" AND artist:"John Farnham" AND artist:"Human Nature"&limit=100&inc=tags&fmt=json

But clearly it does not. How do I change the query to achieve my goal? :slight_smile:

Please have a look at the recording at https://musicbrainz.org/recording/e9fe6fd8-6cf5-43a6-8767-deb480481cdd . This recording has a title of “Everytime You Cry”, hence your search for “Every Time You Cry” does not return the expected result. Probably in this case it would be correct to rename the recording in MB.

Update: Actually the recording was deliberately renamed in https://musicbrainz.org/edit/56193358 , but no reason given

3 Likes

Thank you again for your response @outsidecontext. The link you provided gives me 8 Release Titles -
6 with Title “Every Time You Cry”
2 with Title “Everytime You Cry”
(the Release Title that I’m expecting with the query below is the last one in that list - Title “Every Time You Cry”, Release Title “Everytime You Cry” and Artists “John Farnham & Human Nature”).

However, the query:-

http://musicbrainz.org/ws/2/recording?query=recording:“Every Time You Cry” AND artist:“John Farnham” AND artist:“Human Nature”&limit=100&inc=tags&fmt=json

does not return any of the above. It returns 1 release:-

https://musicbrainz.org/release/ea3a87f3-ca17-4489-8a39-fc10577e2a6e

Then, if I change the query by altering the spelling:-

http://musicbrainz.org/ws/2/recording?query=recording:“Everytime You Cry” AND artist:“John Farnham” AND artist:“Human Nature”&limit=100&inc=tags&fmt=json

It returns the Release Title that I’m expecting. So it appears that the Recording and Release names have been swapped in the MB’s interpretation of the query…

No, this has absolutely nothing to do with release titles, it is all about recording titles. Your first query finds you a recording called “Every Time You Cry”, which is this:

Your second title gives you a recording called “Everytime You Cry”, which is this:

It’s only that this second recording also appears on the single called Everytime You Cry and in this track listing is called “Every Time You Cry”.

There is nothing wrong with your query, you get exactly what you are querying for.

2 Likes

Thanks. It’s still not clear to me. How should I modify my query to get the results I’m expecting?

Actually, I think there’s a bug in either the search or its documentation. The recording parameter states “name of recording or a track associated with the recording” so track names for a given recording should also be included in the results, but apparently are not?

(Edit: Unrelatedly, but @PoQStacker you should switch to querying using HTTPS if you can. See this blog post for more information. If you’re unable to switch to HTTPS, please provide a comment on that blog post with why!)

1 Like

Maybe it is less confusing if we change the names. So you do a search query for a recording called “Foo”. But actually the recording you are looking for is called “Bar” in MusicBrainz. So if you are looking just for a query that gives you the result you will need to search for “Bar” instead.

The more complete solution probably would be to look into why that recording is called “Bar” instead “Foo” in MusicBrainz. Maybe that is a mistake, then it should be renamed to “Foo”.

So in your case: The second query for “Everytime You Cry” gives you the correct result, because the recording is called “Everytime You Cry”. But according to your comments about this album and naming it probably should be renamed to “Every Time You Cry” on MusicBrainz.

2 Likes

Indeed, this looks like a bug in this case. I think most people would expect the results to consider the track names.

1 Like

Why does my query only return 1 result when there are many?

The CD https://musicbrainz.org/release/f0db5756-2c98-4e11-9baf-fc64500077e4, It’s my understanding that this has the Release Title of “Everytime You Cry” is this correct?

This CD has 3 tracks. The first track has the Recording Tilte of “Every Time You Cry”, is this correct?

The second track has the Recording Title of “Everthing Is Out Of Season”, is this correct?

Not exactly. It has the track title “Every Time You Cry”, but the recording is currently titled “Everytime You Cry”. Maybe this screenshot makes things clearer:

grafik

Please have a look at the recording at https://musicbrainz.org/recording/e9fe6fd8-6cf5-43a6-8767-deb480481cdd

2 Likes

Thank you again @outsidecontext. It is starting to get a little clearer now.

In the image above the column “Title” - what ‘index’ and what ‘field’ in the db holds that info?

That should be the “name” column in the “track” table. The track table basically links recordings to mediums.

1 Like

I think I have found that in the graphical diagram for the db schema, but how do I reach that with my query?

I have also found that the artist portion of the query doesn’t include the aliases…

@Freso - I have changed the code from http to https.

What I would like to achieve is - from the Artist(s) and Title as they are written on the CD (or vinyl record, or cassette tape) is provide my users with additional information about the recording (mostly genre).

Following from my initial attempt of:-

https://musicbrainz.org/ws/2/recording?query=recording:“Every Time You Cry” AND artist:“John Farnham” AND artist:“Human Nature”&limit=100&inc=tags&fmt=json

I now put an additional query in for each artist in the above list eg:-

https://musicbrainz.org/ws/2/artist?query=“Human Nature”&inc=aliases&fmt=json

ignoring the response items with a score of less than 100, I can expand the artist portion of my query like:-

(artist:“Human Nature” OR artist:“4Trax”)

Can anyone tell me how I can expand the recording title portion of the query to include the MB variants of the title?

Or, does anyone have an alternate method?

Thanks in advance

I will assume by the silence that this can’t be done, and no workarounds are available…

Is there any chance that this short coming can be addressed by MB?

Well, I was hoping you or @outsidecontext would file a ticket for it, since I already established that it’s a bug. Since you didn’t, I made a ticket now:

Of course, this won’t help you here and now.

Exactly the same way should work:
(recording:"Everytime You Cry" OR recording:"Every Time You Cry")

3 Likes

@Freso thank you very much for writing up that Ticket. I must read up on how to do that myself…

The issue with this is - how do I get the variantions in spelling from MB when I only have “Every Time You Cry” to start with.

You can try a fuzzy search for the title by appending a tilde character ~ at the end of the title search:

http://musicbrainz.org/ws/2/recording?query=recording:“Every Time You Cry”~ AND artist:“John Farnham” AND artist:“Human Nature”&limit=100&inc=tags&fmt=json

This actually returns both recordings. It does not fully fix your issue with searching for the track titles as they appear on release, in some cases the difference between track and recording title might be more extreme so that a fuzzy search does not help. But it should catch minor variations like this one.

The Lucene documentation at https://lucene.apache.org/core/2_9_4/queryparsersyntax.html has some more details.

3 Likes