<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 12px; font-family: Verdana, sans-serif; "><div><div><div>If it is helpful, I've attached three screen shots from the VertNet IPT. The first shows what the Manage Resource page looks like with two data sources and two mappings. The second shot shows the Edit Source page for the DwC Occurrence data and the third shot shows the Edit Source page for the Simple Images data.</div><div><div><br></div><div>Laura Russell</div><div>VertNet Programmer</div><div>VertNet</div><div>KU Biodiversity Institute</div><div>1345 Jayhawk Blvd.</div><div>Dyche Hall, Room 606</div><div>Lawrence, KS 66045</div><div><br></div><div>Phone: +01 785 864-4681</div><div>Fax: +01 785 864-5335</div><div><br></div><div>email: larussell@vertnet.org</div><div>email: larussell@ku.edu</div><div><br></div><div>Skype: laura.anne.russell</div><div>Gchat: larussell@vertnet.org</div><div><br></div><div>url: www.vertnet.org</div><br></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> "Dröge, Gabriele" <<a href="mailto:g.droege@BGBM.ORG">g.droege@BGBM.ORG</a>><br><span style="font-weight:bold">Date: </span> Wednesday, October 23, 2013 8:04 AM<br><span style="font-weight:bold">To: </span> "Tim Robertson [GBIF]" <<a href="mailto:trobertson@gbif.org">trobertson@gbif.org</a>><br><span style="font-weight:bold">Cc: </span> "<a href="mailto:ipt@lists.gbif.org">ipt@lists.gbif.org</a>" <<a href="mailto:ipt@lists.gbif.org">ipt@lists.gbif.org</a>><br><span style="font-weight:bold">Subject: </span> Re: [IPT] use of extensions; how can duplication of rows be avoided?<br></div><div><br></div><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><meta name="Generator" content="Microsoft Word 14 (filtered medium)"><base href="x-msg://35/"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div lang="DE" link="blue" vlink="purple"><div class="WordSection1"><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hi Tim,<o:p></o:p></span></p><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">ok thanks. This what I was thinking but I wanted to be sure. Will try this.<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Best,<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Gabi<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">Von:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "> Tim Robertson [GBIF] [<a href="mailto:trobertson@gbif.org">mailto:trobertson@gbif.org</a>] <br><b>Gesendet:</b> Mittwoch, 23. Oktober 2013 14:41<br><b>An:</b> Dröge, Gabriele<br><b>Cc:</b> <a href="mailto:ipt@lists.gbif.org">ipt@lists.gbif.org</a><br><b>Betreff:</b> Re: [IPT] use of extensions; how can duplication of rows be avoided?<o:p></o:p></span></p></div></div><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Hi Gabe,<o:p></o:p></p><div><p class="MsoNormal"><o:p> </o:p></p></div><div><p class="MsoNormal">You create 2 sources (both will point to the same database in your instance) and each will have a different SQL statement. <o:p></o:p></p></div><div><p class="MsoNormal"><o:p> </o:p></p></div><div><p class="MsoNormal">It is probably not noticed, but with an IPT you can actually do things like connecting to a postgres database for specimens, and connecting to a mysql database for images provided there are shared unique identifiers in use that effectively do cross database joins. That is pretty advanced usage, but is likely to crop up. Similarly you can upload a CSV file and mix that in with a database connection.<o:p></o:p></p></div><div><p class="MsoNormal"><o:p> </o:p></p></div><div><p class="MsoNormal">Cheers,<o:p></o:p></p></div><div><p class="MsoNormal">Tim<o:p></o:p></p></div><div><p class="MsoNormal"><o:p> </o:p></p><div><div><p class="MsoNormal">On Oct 23, 2013, at 2:34 PM, Dröge, Gabriele wrote:<o:p></o:p></p></div><p class="MsoNormal"><br><br><o:p></o:p></p><div><div><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hi Tim,</span><o:p></o:p></p></div><div><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Ok, but I am already using such views. How can I use multiple sqls in IPT? E.g. those two you suggested. Do you want me to put them all together in the same Source Data SQL Statement field?</span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Best,</span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Gabi</span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></p></div><div><p class="MsoNormal"><image001.jpg><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span><o:p></o:p></p></div><div><p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p></div><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-width:initial;border-color:initial"><div><p class="MsoNormal"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">Von:</span></b><span class="apple-converted-space"><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "> </span></span><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">Tim Robertson [GBIF] [<a href="mailto:trobertson@gbif.org">mailto:trobertson@gbif.org</a>]<span class="apple-converted-space"> </span><br><b>Gesendet:</b><span class="apple-converted-space"> </span>Mittwoch, 23. Oktober 2013 14:01<br><b>An:</b><span class="apple-converted-space"> </span>Dröge, Gabriele<br><b>Cc:</b><span class="apple-converted-space"> </span><a href="mailto:ipt@lists.gbif.org">ipt@lists.gbif.org</a><br><b>Betreff:</b><span class="apple-converted-space"> </span>Re: [IPT] use of extensions; how can duplication of rows be avoided?</span><o:p></o:p></p></div></div></div><div><p class="MsoNormal"> <o:p></o:p></p></div><div><p class="MsoNormal">Hi Gabi,<o:p></o:p></p></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">In *typical* use there would be 1 SQL statement for the core, and then one SQL statement per extension.<o:p></o:p></p></div></div><div><div><p class="MsoNormal">There are occasions that you would break this though.<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">If I were setting up an IPT on MySQL I would use views in the database, and manage those with the database database schema itself. So something along the lines of:<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> CREATE VIEW view_ipt_occurrence <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> AS SELECT id AS id, id AS occurrenceID, name AS scientificName … FROM specimen; <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> CREATE VIEW view_ipt_image AS SELECT s.id AS id, s.id AS <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> SELECT occurrenceID, i.image AS imageURL … FROM image i JOIN specimen s ON i.specimen_id=s.id; <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">Then in the IPT on the occurrence mapping I would simply use this knowing it will auto map since the views use DwC terms as column aliases:<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> SELECT * FROM view_ipt_occurrence;<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> SELECT * FROM view_ipt_image;<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">Does that help at all? <o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">If you send your DB schema, we will be happy to help out with SQL mappings.<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div></div><div><div><p class="MsoNormal">Thanks,<o:p></o:p></p></div></div><div><div><p class="MsoNormal">Tim<o:p></o:p></p></div></div><div><div><p class="MsoNormal"> <o:p></o:p></p></div><div><div><div><p class="MsoNormal">On Oct 23, 2013, at 1:39 PM, Dröge, Gabriele wrote:<o:p></o:p></p></div></div><div><p class="MsoNormal"><br><br><br><o:p></o:p></p></div><div><div><div><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Dear all,</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">I have a general question on Darwin Core and the use of Darwin Core extensions.</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">E.g. I want to use the Occurrence Core and Simple Images with a mysql database.</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">Problem: Only a few of my occurrences have images. The Darwin Core Archive creates a large images file with all occurrence IDs and only a few have also Image urls.</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">But I did expect a file with the image urls only (so much shorter) and all occurrences (with or without image) in the occurrences file.</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">The same problem appears for the identification extension the other way round (duplication of occurrence rows for multiple identifications) and every other extension I’ve tested…</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">But I am a bit confused how this can be done with only one big sql query (with some left joins). Do I have to use multiple resources to use multiple sql queries? Or is this a problem/bug of IPT?</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">Best,</span><o:p></o:p></p></div></div><div><div><p class="MsoNormal"><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">Gabi</span><o:p></o:p></p></div></div><div><p class="MsoNormal"><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">_______________________________________________<br>IPT mailing list<br><a href="mailto:IPT@lists.gbif.org">IPT@lists.gbif.org</a><br><a href="http://lists.gbif.org/mailman/listinfo/ipt">http://lists.gbif.org/mailman/listinfo/ipt</a></span><o:p></o:p></p></div></div></div></div></div></div><p class="MsoNormal"><o:p> </o:p></p></div></div></div></div>_______________________________________________
IPT mailing list
<a href="mailto:IPT@lists.gbif.org">IPT@lists.gbif.org</a>
<a href="http://lists.gbif.org/mailman/listinfo/ipt">http://lists.gbif.org/mailman/listinfo/ipt</a>
</span></body></html>