With recording-rels you are including relationships to other recording. For the additional ones you listed you must also include artist-rels and instrument-rels.
Thanks again, still few missing or under tags or attributes that are not the same as on the page.
“producer” - all good <relation type="producer" type-id="5c0ceac3-feb4-41f0-868d-dc06f6e27fc0">
“orchestra” - under different attribute, not what I want, need just “orchestra” <relation type="performing orchestra" type-id="3b6616c5-88ba-4341-b4ee-81ce1e6d7ebb">
“recording engineer” - under diff attribute, does not match the page <disambiguation>classical producer/engineer</disambiguation>
“recorded at” all good <relation type="recorded at" type-id="ad462279-14b0-4180-9b58-571d0eef7c51">
“editor” - all good <relation type="editor" type-id="40dff87a-e475-4aa6-b615-9935b564d756">
Am I’m expecting too much ? This pages are created from all kind of queries and subqueries, but still would like to have ws returning all the Relationships with attributes as on the page.
For example, where does “orchestra” comes from for Brecon Baroque - MusicBrainz. There are no aliases, no tags. How did the “orchesta” ended up on the page ?
These are exactly the relationships you see on the website for the recording, there are not other hidden ones. The type and type-id are the internal name and identifier to identify those relationships, you use them in your code to find the proper relationship. Those also do not change.
The display name used to present those relationships on the website are independent of those. What you see on the website are translatable labels meant for humans to read.
That’s done by the recording to artist relationship. When you edit that recording you can link it to an artist which represents the performing orchestra.
Thanks again for detail explanation, what I was missing was the concept of labels, I thought they could be returned by the webservice. Since relationship types should not change, I can easily add my own labels, probably more consistent also.
To get the composer you need to have both work-level-rels and artist-rels as inc parameters.
By default only relationships for the entity you are querying are included, so in your case only relationships defined for the recording. But composer is defined for the work. The work-level-rels parameter makes the query also return relationships defined for the work.
But again it will only return the relationships to entities you define as inc parameters. A composer is an artist, so you need artist-rels.
All of this is less than intuitive, takes time getting used to. There is a json structure on the page source that has majority of the data that I need, labelled as you see it on page, tempting to just scrap the page…
I really appreciate your support. I’m obviously new to ws calls here and without your help would probably give up.
So to get the composer you search the recording for <relation-list target-type="work">, and there you look for a work linked to the recording with the relation type “performance”. This will give you the work, which again will have relationships. Target type “artist” with relation type “composer” is what you are looking for.
If you prefer to work with JSON you can make the WS also return JSON data by appending the fmt=json parameter, e.g.
XML is fine, I find it easier than JSON to navigate and see the tree. I’ve picked Perl XML::LibXML along the way and have no issues extracting data, very well formatted.
When I mentioned scrapping the page for the included JSON, I was after the labels that are used on the page, likes of
composer
violin
conductor
as it appears on a page , nicely organised. I understand all of this can be retrieved with ws, so I will forget about scrapping for now, its like cheating anyway