Taxon Information
Taxon Group
A Taxon Group is a broad grouping of taxa used mainly for Dictionary purposes, but also useful where the taxa does not have a common name. The taxon group is held as a key in the Taxon_Version table and the names of the groups in the Taxon_Group table. The following example show the SQL necessary to get the Taxon Group name from a Taxon_List_Item_Key.
Select TG.Taxon_Group_Name from
Taxon_Group TG
INNER JOIN Taxon_Version TV ON
TV.Output_Group_Key = TG.Taxon_Group_Key
INNER JOIN Taxon_List_Item TLI
ON TLI.Taxon_Version_Key = TV.Taxon_Version_Key
WHERE
TLI,Taxon_List_Item_key = 'key here'
The following incorporates this into a query to return records by joining it to Taxon_Determination
SELECT
SV.Survey_Key,SE.Survey_Event_Key,S.Sample_Key,
dbo.FormatEventRecorders(S.Sample_key) AS Recorders
,TOCC.Taxon_Occurrence_Key,TDET.Taxon_Determination_Key,ITN.Actual_Name
,TG.Taxon_Group_Name
FROM Survey SV
INNER JOIN Survey_Event SE ON SE.Survey_Key =
SV.Survey_Key
INNER JOIN
Sample S ON S.Survey_Event_Key =SE.Survey_Event_Key
INNER JOIN
Taxon_Occurrence TOCC ON TOCC.Sample_key = S.Sample_Key
INNER
JOIN Taxon_Determination TDET ON TDET.Taxon_Occurrence_Key =
TOCC.Taxon_Occurrence_Key
INNER JOIN Index_Taxon_Name ITN ON
ITN.Taxon_List_Item_Key =TDET.Taxon_List_Item_Key
INNER JOIN
Taxon_List_Item_Key TLI ON TLI.Taxon_List_Item_Key =
TDET.Taxon_List_Item_Key
INNER JOIN .Taxon_Version_Key = TV.Taxon_Version_Key =
TLI.Taxon_Version_Key
INNER JOIN
Taxon_Group TG ON TG.Taxon_Group_Key = TV.Output_Group_Key
WHERE TDET.preferred =
1
Linking the Recommended_Taxon_List_Item_Key or the Preferred_Taxon_List_Item_Key should produce the same Taxon_Group_Name and this is true in most cases, but there are some anomalies in the Dictionary which do not always produce the correct results.
Dictionary
Table Taxon_List holds the name of the Dictionary. This can be obtained from the Index_taxon_Name by joining Taxon_List_Version, then Taxon_List. This example will give the Dictionary use for the original entry.
SELECT
SV.Survey_Key,SE.Survey_Event_Key,S.Sample_Key,
dbo.FormatEventRecorders(S.Sample_key) AS Recorders
,TOCC.Taxon_Occurrence_Key,TDET.Taxon_Determination_Key,ITN.Actual_Name
,TG.Taxon_Group_Name,
TL.Item_name
FROM Survey SV
INNER
JOIN Survey_Event SE ON SE.Survey_Key = SV.Survey_Key
INNER
JOIN Sample S ON S.Survey_Event_Key =SE.Survey_Event_Key
INNER
JOIN Taxon_Occurrence TOCC ON TOCC.Sample_key = S.Sample_Key
INNER
JOIN Taxon_Determination TDET ON TDET.Taxon_Occurrence_Key =
TOCC.Taxon_Occurrence_Key
INNER JOIN Index_Taxon_Name ITN ON
ITN.Taxon_List_Item_Key =TDET.Taxon_List_Item_Key
INNER JOIN
Taxon_List_Item_Key TLI ON TLI.Taxon_List_Item_Key =
TDET.Taxon_List_Item_Key
INNER JOIN .Taxon_Version_Key = TV.Taxon_Version_Key =
TLI.Taxon_Version_Key
INNER JOIN
Taxon_Group TG ON TG.Taxon_Group_Key = TV.Output_Group_Key
INNER JOIN Taxon_List_Version TLV ON TLV.Taxon_Version_Key =
ITN.Taxon_Version_Key
INNER JOIN Taxon_List TL ON TL.Taxon_List_Key =
TLV.Taxon_List_Key
WHERE
TDET.preferred = 1
WHERE TDET.preferred = 1
Taxon Designations (Status)
Recorder 6.14 introduces a new index table (Index_Taxon_Designation) and a method of controlling the reporting of Status information via 'sets' of designations. See Designation (Status).
Expanding Rucksacks
If Rucksacks are used the keys may not be at taxon level. If you are not sure about this expand the Rucksack using Index_Taxon_Group.
SELECT
ITG.Contained_List_Item_Key FROM Index_Taxon_Group ITG WHERE
<Condition field= "ITG.Taxon_List_Item_key" entrycount
="-1" operator=
"equal" type ="Taxon" name= "SelectRucksack"
userucksack= "yes" />