Hi,
Just spitballing here, but can we generate those things from structured data as an incentive for the bootleggers to stop putting what should be structured data in as comment abuse?
There is a feature request already.
When viewing a list of recordings from the artist tab, there is no column for performance attributes such as event, place, area for the ‘recorded at/in’ entities. IOW, we can’t see it. If we give the editors something to see the result of them filling in the date of a recording, whether it is live, and the event, place, or area, we will get better structured data and we can finally modernize the style docs to mention the advanced attributes that came along about 9 years ago.
For fun, I made an XSL script to show what could be along with what is. What isn’t shown, is that a second query (or third to get the place from an event) is required for unwinding an area backwards for the full and proper “town,county,subdivision,country” form. No biggie for the server, but this script is just single-dimensional.
save as recordings.xsl
<?xml version="1.0"?>
<!--
Call this from the commandline something like this:
wget -O - https://musicbrainz.org/ws/2/recording?work=36df44f5-7cad-37ee-9aae-89a5c58dfb07\&inc=artist-credits+event-rels+place-rels+area-rels+work-rels\&limit=25\&offset=850 |xsltproc -o recordings.html recordings.xsl -; google-chrome recordings.html
See https://musicbrainz.org/doc/MusicBrainz_API for details
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mb="http://musicbrainz.org/ns/mmd-2.0#">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<h2>MusicBrainz recording decoder test with auto-gen by davygrvy@pobox.com</h2>
Count is <xsl:value-of select="mb:metadata/mb:recording-list/@count" /><br/>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
<th>Attributes</th>
<th>Performance</th>
<th>Auto-gen</th>
<th>Disambig</th>
</tr>
<xsl:for-each select="mb:metadata/mb:recording-list/mb:recording">
<tr>
<!-- Title -->
<td><a href="https://musicbrainz.org/recording/{@id}"><xsl:value-of select="mb:title"/></a></td>
<!-- Artist -->
<td><xsl:value-of select="mb:artist-credit/mb:name-credit/mb:artist/mb:name"/></td>
<!-- Attributes -->
<td>
<xsl:for-each select="mb:relation-list/mb:relation">
<xsl:choose>
<xsl:when test="@type-id='a3005666-a872-32c3-ad06-98af558e99b0'">
<!-- work -->
<!-- XSLT 2.0 only <xsl:value-of select="mb:release-group/mb:secondary-type-list/mb:secondary-type" separator=" + "/> -->
<xsl:for-each select="mb:attribute-list/mb:attribute">
<nobr><xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text> + </xsl:text> <!-- Add the separator if it's not the last item -->
</xsl:if>
</nobr>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</td>
<!-- Performance -->
<xsl:choose>
<!-- Any 'recorded at/in' attributes? -->
<xsl:when test="not(mb:relation-list/mb:relation[@type-id='b06e6732-2603-47d3-8a49-9f589b430483'] or
mb:relation-list/mb:relation[@type-id='ad462279-14b0-4180-9b58-571d0eef7c51'] or
mb:relation-list/mb:relation[@type-id='354043e1-bdc2-4c7f-b338-2bf9c1d56e88']
)">
<td>[no data]</td>
</xsl:when>
<xsl:otherwise>
<td>
<xsl:for-each select="mb:relation-list/mb:relation">
<xsl:choose>
<xsl:when test="@type-id='b06e6732-2603-47d3-8a49-9f589b430483'">
<!-- 'recorded at' for event, but we can't see 'held in/at', so display name with link to event -->
<nobr><a href="https://musicbrainz.org/event/{mb:event/@id}"><xsl:value-of select="mb:event/mb:name"/></a>
<!-- TODO: do range instead of just begin -->
(<xsl:value-of select="mb:event/mb:life-span/mb:begin"/>)
<xsl:if test="mb:event/mb:disambiguation">
[<xsl:value-of select="mb:event/mb:disambiguation"/>]
</xsl:if>
</nobr><br/>
</xsl:when>
<xsl:when test="@type-id='ad462279-14b0-4180-9b58-571d0eef7c51'">
<!-- 'recorded at' for place -->
<nobr>
<xsl:choose>
<xsl:when test="not(mb:target-credit)">
<xsl:value-of select="mb:place/mb:name"/>
</xsl:when>
<xsl:otherwise>
<!-- use 'credited as' when spec'd -->
<xsl:value-of select="mb:target-credit"/>
</xsl:otherwise>
</xsl:choose>
<!-- TODO: do range instead of just begin -->
<xsl:choose>
<xsl:when test="not(mb:begin)">
([no date])
</xsl:when>
<xsl:otherwise>
(<xsl:value-of select="mb:begin"/>)
</xsl:otherwise>
</xsl:choose>
</nobr><br/>
</xsl:when>
<xsl:when test="@type-id='354043e1-bdc2-4c7f-b338-2bf9c1d56e88'">
<!-- 'recorded in' for area -->
<nobr>
<xsl:choose>
<xsl:when test="not(mb:target-credit)">
<xsl:value-of select="mb:area/mb:name"/>
</xsl:when>
<xsl:otherwise>
<!-- use 'credited as' when spec'd -->
<xsl:value-of select="mb:target-credit"/>
</xsl:otherwise>
</xsl:choose>
(<xsl:value-of select="mb:begin"/>)</nobr><br/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</td>
</xsl:otherwise>
</xsl:choose>
<!-- Auto-gen -->
<td>
<!-- Are we a live work? -->
<xsl:for-each select="mb:relation-list/mb:relation">
<xsl:choose>
<xsl:when test="@type-id='a3005666-a872-32c3-ad06-98af558e99b0'">
<xsl:for-each select="mb:attribute-list/mb:attribute">
<xsl:if test="@type-id='70007db6-a8bc-46d7-a770-80e6a0bb551a'">
live,
</xsl:if>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<!-- date of work? -->
<xsl:for-each select="mb:relation-list/mb:relation">
<xsl:choose>
<xsl:when test="@type-id='a3005666-a872-32c3-ad06-98af558e99b0'">
<xsl:choose>
<xsl:when test="not(mb:begin)">
[no date],
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="mb:begin"/>,
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<!-- Where? event, place, or area (just pick the first found) -->
<xsl:choose>
<xsl:when test="mb:relation-list/mb:relation[@type-id='b06e6732-2603-47d3-8a49-9f589b430483']/mb:event/mb:name">
<xsl:value-of select="mb:relation-list/mb:relation[@type-id='b06e6732-2603-47d3-8a49-9f589b430483']/mb:event/mb:name"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="mb:relation-list/mb:relation[@type-id='ad462279-14b0-4180-9b58-571d0eef7c51']/mb:place/mb:name">
<xsl:value-of select="mb:relation-list/mb:relation[@type-id='ad462279-14b0-4180-9b58-571d0eef7c51']/mb:place/mb:name"/>
</xsl:when>
<xsl:otherwise>
<!-- area would go here, but i'm lazy -->
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</td>
<!-- Disambig -->
<td><xsl:value-of select="mb:disambiguation"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
