1

Re: Synonymy

Ok I want to create a batch update which will allow the user to select a taxon in the dictionary and then set (or unset) the confidential flag for all occurrences (picking up all synonyms etc.).

This is the first time I have tried to get to grips with the complexities of the taxon dictionary so any useful pointers would be much appreciated

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

2

Re: Synonymy

Hi Rob,

Here's a quick idea of where to start looking. You can select the taxa from the Index_taxon_name table. This has a taxon_list_item_key field which can join to Taxon_Determination, then Taxon_Occurrence where you will find the Confidential flag. Make sure you filter just for Taxon_Determination records where preferred=1.

Let us know how you get on,

Best Wishes

John van Breda
Biodiverse IT

3

Re: Synonymy

Thanks John,

I had guessed that would be the way. Ultimately I am intending to create a taxon designation for all our confidential species and apply the update to everything on the list, but that seems like a fairly straightforward addition to what you describe.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

4

Re: Synonymy

The following shooudl do what you require.

<?xml version="1.0" ?>
<batchupdate menupath="LcBatchUpdates" title="LCBU10- Change Confidential flag for selected taxa  "
description="Changes the Confidential flag for all occurrences in the database for the selected taxa. Works on a taxon name entered or as a quick report from the Taxon Dictionary. Picks up synonyms etc. providing they are properly linked in name server " >

<SQL>

<Where keytype="Default">

UPDATE Taxon_Occurrence  set

<Condition field= "Confidential"   operator="equal" type="OptionSet"  name="Set Confidential Equals"  >
        <Option name="True" value = "1" />
        <Option name="False" value = "0" />
     
</Condition>


FROM Taxon_Determination TDET
INNER JOIN Taxon_Occurrence  TOCC
ON TOCC.Taxon_Occurrence_key = TDET.Taxon_Occurrence_key AND TDET.Preferred = 1
INNER JOIN
Index_Taxon_name ITN ON ITN.Taxon_List_Item_Key = TDET.Taxon_List_Item_Key
INNER JOIN
Index_Taxon_Name ITN2 ON ITN2.Recommended_Taxon_List_Item_Key = ITN.Recommended_Taxon_List_Item_Key
WHERE
<Condition field="ITN2.Actual_Name" operator="equal" type="Text" name="Taxon Name"  entrycount="1" />

</Where>

<Where keytype="Taxon">

UPDATE Taxon_Occurrence  set


<Condition field= "Confidential"   operator="equal" type="OptionSet"  name="Set Confidential Equals"  >
        <Option name="True" value = "1" />
        <Option name="False" value = "0" />
     
</Condition>


FROM Taxon_Determination TDET
INNER JOIN Taxon_Occurrence  TOCC
ON TOCC.Taxon_Occurrence_key = TDET.Taxon_Occurrence_key AND TDET.Preferred = 1
INNER JOIN
Index_Taxon_name ITN ON ITN.Taxon_List_Item_Key = TDET.Taxon_List_Item_Key
INNER JOIN
Index_Taxon_Name ITN2 ON ITN2.Recommended_Taxon_List_Item_Key = ITN.REcommended_Taxon_List_Item_Key
WHERE
ITN2.Taxon_List_Item_key = '%s'


</Where>


</SQL>
</batchupdate>

Mike Weideli

5

Re: Synonymy

Fantastic, thanks Mike, saved me a lot of thinking there.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre