1

Re: Getting a list of all RDB species

This is a task we get asked to perform on a semi-regular basis. We also get asked for BAP species records and species lists too, along with a selection of other similar queries based on a designation as parameter. So, my question to the community is, how do you go about extracting a list of "all RDB species records"?

Charles
p.s. I do have ways of doing it, but so far they are, to be honest, unsatisfactory.

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

2

Re: Getting a list of all RDB species

Charles

I think there is a related question - when providing a report that lists species records, how do you flag the range of designations for each species? I find reports that allow the customer to, at a glance, see if something is notable are preferred i.e. I would not want to provide a separate list of designations for the species. I also don't want to flag up that, say, a species is on a Northern Ireland wildlife schedule!

The way I'm getting around this is to assign a code (up to 3 characters) for each 'significant' designation (e.g. BD1 for Birds directive Annex 1) and to concatenate all significant designations for each species (separated by spaces) e.g. W5a NS BD1. This data which is generated using an Access query from the Recorder designation table is stored in a separate table which can then be linked to the records. To search for say RDB records a query is set up that searches for the relevant codes. By using this concatenated designation field it is possible to list all designations in a way that takes up minimum space on reports.

3

Re: Getting a list of all RDB species

Charles

You could try making up an XML report based on the following query for species (join to Taxon_Determination and so on to get an observations list):
select itn1.*
from index_taxon_name itn1
inner join index_taxon_name itn2 on itn2.recommended_taxon_list_item_key=itn1.recommended_taxon_list_item_key
inner join taxon_designation td on td.taxon_list_item_key=itn2.taxon_list_item_key
inner join taxon_designation_type tdt on tdt.taxon_designation_type_key=td.taxon_designation_type_key
where tdt.short_name like '%rdb%'

The problem you have got here though is it takes no account of the geographic constraints - I'm not sure of an easy way around this as the constraints are free text and can't be machine interpreted.

Another thing to bear in mind is that quite often a designation is only provided at the taxon group level so you need to include a join to Index_Taxon_Group in there if this is a concern.

Does that help?

John van Breda
Biodiverse IT

4

Re: Getting a list of all RDB species

Well, what I do for for RDB records is specify a complex filter in the Report Wizard to give me all records that have a Taxon Short Name beginning with RDB. Because constraining by geographic area (bounding box or polygon) is essential, I can't use XML Reports unfortunately. Once designations get involved in the Report Wiz process like this, things get rather slow, depending on the size of the geographic area (or bounding box).

I also constrain designation types using the Taxon Status Kind. I've uploaded a little XML Report that lists all of the designations along with their Kind and Description. You can download it from the uploads page. Be warned though, there's a custom function in there, which can be found on the Database Journal website. You'll need to install this and make it executable to the various Recorder database roles before the report will work. John, is there a convenient way of making a custom function executable to all of the roles? It's a bit fiddly having to do each one manually in EM.

To run the report, select Report > Run and choose View Designation Types.xml from the dropdown.

Another question to John: does the report wizard do the Index_Taxon_Group join you mention?

Finally, Rob's idea of concatenating abbreviations seem like a good solution to the designation overload problem. I don't see why concatenating taxon status kinds wouldn't be a solution of sorts. What I do know is that there does need to be something a lot let granular than the current system of selecting each specific designation required for output. Performance could well be an issue, but I think this could be solved with an index table perhaps.

What do others think?

Charles

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

5

Re: Getting a list of all RDB species

I suppose you could fudge an XML report to do a bounding box at the moment but it would require you to manually type in the lat/long for each corner - not ideal.  The new facilities in 6.9 will allow a proper XML report bounding box facility.

To set up security on functions, at Dorset Software we append the following code to the script (after the Go at the end of the function) as in the following example:

/*===========================================================================*\
  Grant permissions.
\*===========================================================================*/
IF EXISTS (SELECT * 
       FROM   SysObjects 
       WHERE  Id = Object_Id(N'[dbo].[ufn_GetFormattedSpeciesName]')
       AND    Type IN ('FN', 'IF', 'TF'))
BEGIN
       PRINT 'Setting up security on function ufn_GetFormattedSpeciesName'
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'R2k_AddOnly')
                GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [R2k_AddOnly]
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'R2k_Administrator')
        GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [R2k_Administrator]
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'R2k_FullEdit')
        GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [R2k_FullEdit]
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'R2k_ReadOnly')
        GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [R2k_ReadOnly]
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'R2k_RecordCardsOnly')
        GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [R2k_RecordCardsOnly]
    IF EXISTS (SELECT * FROM SYSUSERS WHERE NAME = 'Dev - JNCC SQL')
                GRANT EXECUTE ON dbo.ufn_GetFormattedSpeciesName TO [Dev - JNCC SQL]
END
GO

Then as long as you run the script normally the permissions are automatically set up.  The last entry is useful for us at Dorset Software as it allows us to run the function even when not logged into Recorder, as long as we are in the NT group for Recorder developers.  You can skip this one though.

The Report Wizard does not currently join in through Index_Taxon_Group.  However, I think that the requirement to join in Index_Taxon_Group is really a quirk of the current dictionary data, and I think that the designations are all going to be joined directly to each bottom level taxon at some point in the future.  I'm not sure on that though.

John van Breda
Biodiverse IT

6

Re: Getting a list of all RDB species

Thanks John, that's very useful indeed. I'm encouraged by the possibility of the designations quirk being ironed out; can anyone at JNCC or NHM confirm this? If this quirk is fixed, then then using the report wizard for designations reporting should be much more reliable. Couple that with the fact that XML Reports is soon to have geo-spatial selection capabilities, things are looking up.

Charles

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

7

Re: Getting a list of all RDB species

I'm probably using your unsatisfactory method, Charles.
Our various recorder groups have published county Red Data Books, a nice initiative for them if your LRC wants an interesting level of involvement with them.
I've placed all the taxa from these lists into various rucksacks then concatenated them into a larger one using a text editor.
I can now run my searches against the contents of the rucksack.
Tons of disadvantages since it doesn't cope with a newly discovered RDB unless you spot it and add it but then the statuses we're given are woefully out of date too (see my thread elsewhere).
Our major enquiries are for "Protected species" or what some might term "CRoW Act, Section 74" as these are the imperative ones in the Planning enquiries. This list is easier to set up and changes less frequently (just keep your eyes peeled for changes in legislation)

8

Re: Getting a list of all RDB species

Our approach is not to do it Recorder at all. This is because we started with Recorder 3 and we extracted the data and put it into a spreadsheet which has lookup lists for all the usual designations which we amend and add to as necessary. Now new data added to Recorder 2002 is extracted and put through the spreadsheet and finally imported into Mapinfo which we use for most data searches.

Graham Hawker
Thames Valley Environmental Records Centre

9

Re: Getting a list of all RDB species

Hello everyone!

In response to your question regarding the designations quirk, we do intend to fix this and join designations directly to each bottom level taxon. Unfortunately, this will not be incorporated into version 6.8 but will be made a priority in the future.

Kind Regards

Sarah
Biodiversity Information Assistant
JNCC

Sarah Shaw
Biodiversity Information Assistant
JNCC