AtlasOfLivingAustralia / sds

Sensitive species rules API
https://sds.ala.org.au
0 stars 7 forks source link
ala-product-sds

sds Build Status

The sensitive data service manages sensitivity concerns in the conservation and biosecurity areas.

The sensitive species are supplied via external agencies and are currently stored and maintained in the list tool: https://lists.ala.org.au/public/speciesLists?isSDS=eq:true

The sds api relies on the sds-webapp2 to generate and supply XML configuration files as listed: https://sds.ala.org.au

LIST TOOL REQUIREMENTS

When a user is modifying or adding an SDS list the following information is required as list metadata (potentially this metadata should be moved to the collectory we put it in the list tool to prevent modifications to collectory):

Region - the region of Australia in which this is applied. This needs to be the id of one of the regions defined here:

https://sds.ala.org.au/sensitivity-zones.xml

Authority - an acronym for the organisation under whose authority it is listed

Category (optional) - The category for the sensitivity. When this is provided at the list level it applies to all items on the list (Example https://lists.ala.org.au/speciesListItem/listAuth/dr878). If it is not supplied the list needs to have a Category property that is populated for each item (Example https://lists.ala.org.au/speciesListItem/listAuth/dr493). The value of the category must be an id of one of the categories defined here:

https://sds.ala.org.au/sensitivity-categories.xml

Generalisation (optional) - how to generalise the coordinates, mainly used for conservation species. Supported values include WITHHOLD, 10km, 1km, 100m. If this is supplied at the list level it will apply to all species. If it has not been supplied at the list level it must be supplied as a property for each record.

SDS Type - either PLANT_PEST or CONSERVATION.

Taxon Rank - the rank of the entry can be specified in the taxonRank column in the list.

SENSITIVE SPECIES XML GENERATION

This is performed automatically by the sds-webapp2, it checks the list tool regularly to see if it needs to update the list. It uses au.org.ala.sds.util.SensitiveSpeciesXmlBuilder#generateFromWebservices located in this project.

SDS

The SDS can be configured using an external properties file that is located in the /data/sds/sds-config.properties, this in contrary to where we put the configuration files for other apps and should probably be changed. Configuration options are:

There are multiple entry points into the SDS to test for sensitivity. You can either use the SensitiveDataService to automatcially handle the determination of sensitivity and application of the rules. OR you can generate your own SensitiveSpeciesFinder and handle the validation yourself via the ValidationService.

It is probably easiest to use the SensitiveDataService#testMapDetails methods. They take a map of darwinCoreTerms and return a ValidationOutcome. The validation Outcome contains whether or not the details were considered sensitive and a map of values to use instead of the supplied values. It will also contain error reports and emails that need to be sent as notifications in a plant pest situation.

CONSERVATION RULES

There are 2 different classes of conservation rules, state provided and data resource provided. State provided rules need to be applied to all records that fall within the state that supplied the rules. Whereas data resource provided rules are only applied to records that are supplied by the same data resource that supplied the rule. At the moment we only have one data resource provided list and this is https://lists.ala.org.au/speciesListItem/listAuth/dr494 this is applied to all the Bird Life data resource; dr359, dr570 and dr571.

When are species is identified as a conservation the SDS:

  1. Generalises the coordinates based on the configured amount. Populating the dataGeneralizations and/or informationWithheld properties in the return map.

  2. It removes values in the locationRemarks, verbatimLatitude,verbatimLongitude, locality, verbatimCoordinates and footprintWKT fields.

  3. It supplies the original values in an "originalSensitiveValues" map - this is used by the biocache so that the original values can be provided under the correct authority.

PLANT_PEST RULES THEORY

There are 10 categories of plant pest rules that have been defined in .

According to the original documentation this needs to be applied first. But subsequent talks with APPD indicate that this may be a catch all rule that should be applied only if no other rules are matched. There is a test case in PlantPestNotKnownInAustraliaTest to test this, it currently fails. We were waiting to confirm that this is the case before making the changes in the SDS.

These categories has specific notification requirements as per . These are not implemented within the SDS. The SDS will provide the necessary messages it will be up to the individual components to perform the required actions. At the moment the biocache DOES NOT handle the notifications correctly. We were waiting for the SDS to have complete lists and updated contacts.

PLANT PEST RULES IMPLEMENTATION

The Plant Pest rules are implemented using Drools, a rules based engine. The Rules are defined in drl files that are located in the src/resources directory. The category to which a sensitive species belongs dictates which rule is applied.

The rules will determine whether or not a record can be loaded, the email alerts that need to be sent and the warning messages that should be displayed.