<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Scott,<div>the problem is slightly different from what it appears to be. The array of media items is indeed a list of 4 images.</div><div>I could not find your example, but you can pick pretty much any of the iNaturalist observations, for example this one here:</div><div><a href="http://api.gbif.org/v0.9/occurrence/899944100">http://api.gbif.org/v0.9/occurrence/899944100</a></div><div><br></div><div>There are 2 media items, one with a url to the image, one a link to the respective webpage.</div><div>If you look at the verbatim content you can see that we simply get a list of 2 URLs concatenated into the single dwc:<span style="font-family: monospace; font-size: inherit; font-weight: bold;">associatedMedia field:</span></div><div><a href="http://api.gbif.org/v0.9/occurrence/899944100/verbatim">http://api.gbif.org/v0.9/occurrence/899944100/verbatim</a></div><div><br></div><div>Why cannot safely know that the 2 links are indeed about the same image, so these end up being to media item. Because one of them has a jpg suffix we know it is a link to the image and derive a file type.</div><div>This can be avoided by using the richer multimedia extension which allows an image and a webpage link within the same record:</div><div><a href="http://rs.gbif.org/extension/gbif/1.0/multimedia.xml">http://rs.gbif.org/extension/gbif/1.0/multimedia.xml</a></div><div><br></div><div>See also our blog post which explains this issue in more details:</div><div><a href="http://gbif.blogspot.de/2014/05/multimedia-in-gbif.html">http://gbif.blogspot.de/2014/05/multimedia-in-gbif.html</a></div><div><br></div><div>best,</div><div>Markus</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">--<br>Markus Döring</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Software Developer<br>Global Biodiversity Information Facility (GBIF)<br><div><a href="mailto:mdoering@gbif.org">mdoering@gbif.org</a></div><div><a href="http://www.gbif.org">http://www.gbif.org</a></div><div><br></div><div><br></div><div><br></div></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On 29 Jun 2014, at 07:59, Scott Chamberlain &lt;<a href="mailto:scott@ropensci.org">scott@ropensci.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>Thanks for adding media content to the occurrence endpoint output. I<br>am curious if the below is the intended behavior. It appears as though<br>the "references" field associated with an array of "type", "format",<br>and "identifier" is in the next array. &nbsp;Does it not make more sense to<br>have the "references" field within the same array so when parsed we<br>can easily tell that they go together? &nbsp;I can tell by seeing that the<br>photo ID is the same, but I wonder if that is the best approach since<br>then we need to make sure a "references" field goes with an arry of<br>type/format/identifier by e.g. regex-ing.<br><br>Sorry if I am misunderstanding why this is the way it is :)<br><br>[<br> &nbsp;&nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: "StillImage",<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format: "image/jpeg",<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;identifier:<br>"<a href="http://static.inaturalist.org/photos/696339/medium.JPG?1393473140">http://static.inaturalist.org/photos/696339/medium.JPG?1393473140</a>"<br> &nbsp;},<br> &nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;references: "<a href="http://conabio.inaturalist.org/photos/696339">http://conabio.inaturalist.org/photos/696339</a>"<br> &nbsp;},<br> &nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: "StillImage",<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format: "image/jpeg",<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;identifier:<br>"<a href="http://static.inaturalist.org/photos/696341/medium.JPG?1393473245">http://static.inaturalist.org/photos/696341/medium.JPG?1393473245</a>"<br> &nbsp;},<br> &nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;references: "<a href="http://conabio.inaturalist.org/photos/696341">http://conabio.inaturalist.org/photos/696341</a>"<br> &nbsp;}<br>]<br><br>Thanks!<br>Scott Chamberlain<br>_______________________________________________<br>API-users mailing list<br><a href="mailto:API-users@lists.gbif.org">API-users@lists.gbif.org</a><br><a href="http://lists.gbif.org/mailman/listinfo/api-users">http://lists.gbif.org/mailman/listinfo/api-users</a><br><br></blockquote></div><br></div></body></html>