Difference between revisions of "Rule frame"
Yann.laurent (Talk | contribs) (→VALID project Action rules) |
Yann.laurent (Talk | contribs) (→VALID project Action rules) |
||
Line 97: | Line 97: | ||
| align="center" | inter-entity | | align="center" | inter-entity | ||
| align="center" | Daily Check (N+1?) | | align="center" | Daily Check (N+1?) | ||
− | | align="center" | timestamp, Port information | + | | align="center" | timestamp, Port information,VMS, e-LogBook |
| align="center" | | | align="center" | | ||
| align="center" | New | | align="center" | New | ||
| align="center" | | | align="center" | | ||
| align="center" | A logbook entry (Fishing Activity Report -FAR- declaration) must be available for every calendar day with VMS positions at sea | | align="center" | A logbook entry (Fishing Activity Report -FAR- declaration) must be available for every calendar day with VMS positions at sea | ||
− | | align="center" | (If return = "FALSE") Raise Alert ("No | + | | align="center" | (If return = "FALSE") Raise Alert ("No FAR reporting for the last day contact port authorities for thorough check on vessel (calls managePort(PortName)) |
− | |} | + | |- |
+ | | align="center" | inter-entity | ||
+ | | align="center" | When RTP message is received | ||
+ | | align="center" | Species in FAR(Fishing Activity Report = species catches) declarations, DIS (Discarded Species) declarations, TRA (Transhipments) declarations, DEP (Departure from port) declaration = number of species on board when vessel leaves port, RTP (Return To Port = Landing declaration) | ||
+ | | align="center" | | ||
+ | | align="center" | New | ||
+ | | align="center" | | ||
+ | | align="center" | Comparison of logbook entries regarding species (catches, quantities on board, transhipments, discards) with species stated in the landing declaration | ||
+ | | align="center" | (If return = "FALSE") Raise Alert ("") | ||
+ | |- | ||
+ | | align="center" | tuple | ||
+ | | align="center" | When RTP message is received | ||
+ | | align="center" | PNO (Prior Notification) message, RTP (Return To Port) message , for given fisheries (Herring, Mackerel, horse mackerel) to prepare landing control | ||
+ | | align="center" | | ||
+ | | align="center" | New | ||
+ | | align="center" | | ||
+ | | align="center" | A PNO is sent at least 4h prior to real return to port (RTP) | ||
+ | | align="center" | (If return = "FALSE") Raise Alert ("") | ||
+ | |- | ||
+ | | align="center" | inter-entity | ||
+ | | align="center" | When FAR message is received | ||
+ | | align="center" | FAR (Fishing Activity Report) declarations, Fishing authorisations | ||
+ | | align="center" | | ||
+ | | align="center" | New | ||
+ | | align="center" | | ||
+ | | align="center" | Verify whether the combinations of fishing area, gear and species entered in a declaration of catches, are consistent with valid combinations according to a valid fishing authorization. (excluding catches taken for the purpose of scientific research) | ||
+ | | align="center" | (If return = "FALSE") Raise Alert ("") | ||
+ | |- | ||
+ | | align="center" | inter-entity | ||
+ | | align="center" | When all declarations of commercialization are received | ||
+ | | align="center" | Landing declaration, Declarations of commercialization | ||
+ | | align="center" | | ||
+ | | align="center" | New | ||
+ | | align="center" | | ||
+ | | align="center" | Check whether landed species match species stated in the declarations of commercialisation (usage, transport declarations, take-over declarations). | ||
+ | | align="center" | (If return = "FALSE") Raise Alert ("") | ||
+ | |- | ||
+ | | align="center" | inter-entity | ||
+ | | align="center" | When all sales note are received | ||
+ | | align="center" | Sale notes, Fleet register | ||
+ | | align="center" | | ||
+ | | align="center" | New | ||
+ | | align="center" | | ||
+ | | align="center" | Check that vessel selling species is registered with a valid licence | ||
+ | | align="center" | (If return = "FALSE") Raise Alert ("")|} | ||
=== Taxon name reconciliation rules === | === Taxon name reconciliation rules === |
Revision as of 08:08, 30 July 2013
Rule Frame
One approach to capturing requirements and potentially define on the implementation facilities, is to use a rule frame. This classifies and describes the expected types of rules to apply to data once an action has been triggered.
The rule frame described in this example related to the validation of a imaginary dataset that is collected from a Regional Fisheries Organization, and has been loaded as a CSV in ICIS. It now needs to be reconciled with previous datasets from the same reporting stream, and be published in various locations.
There are 2 basic types of rules:
- Contraints check if a condition is violated (return a boolean), and this triggers some action (from an alert, to stopping the transaction) that is not related to a modification of data.
- Action rules trigger an event that can be a transaction, a form navigation, or something similar.
There are also several types of rules:
- Attribute rules operate on one input value, and usually check only it's validity according to a predefined range.
- Tuple rules check if two values in a row that have a defined relationship do not violate the relationship.
- Entity rules check if the values in a tuple 'fit' within the data-table (or structured dataset) they belong to. Exaples are time-series of VMS positions where two consecutive records may have temporal and spatial distances that should be observed.
- Inter-entity rules check if the values in one table-row are consistent with the values in another (set of) tables. Examples are if the given lat-long are within an EEZ, if the given genus / species name is valid, if the portname is open for vassels of the reporting category, and much, much more.
- OTA are Other Triggered Actions, and basically cover all actions that are not modeled with the data. These can e.g. be import and export actions, logging, alerting, backing-up, or sharing.
Rules have to fired by an event, that can be user-triggered (mouse-events, click events), data manipulation (CRUD), or by a clock. In order to perform the operation correctly, they must fire at the right time, and in the correct sequence. The timing is usually related to maintaining data integrity, thus before the manipulation is persisted. The sequence is a topic for another page. This page is to collect user level requirements only, more developer oriented pages will have to describe the implementation and fire-sequence.
Check rules
Type | Trigger | When | Status | Implemented by | Comment | Action |
---|---|---|---|---|---|---|
Attr | 0 <= temp <= 30 | AI / AU | New | Check that Seawater is warmer then 0, and cooler than 30 | Raise Alert ("Your water temp is out of range") | |
Tuple | dtStart <= dtEnd | BI / BU | New | A check to ensure start dates are before end-dates | Raise Alert ("A start date must be before the end-date") | |
Entity | Unique key on genus, species, subspecies | BI / BU | New | Check that species are unique | Raise Error ("This species already exists") | |
Inter Entity | Valid Lat/Long | App logic | New | Find if Lat/Long fits within BBox of distributions | Raise Alert ("This position seems unvalid") |
Action rules
Type | Trigger | Params | Returns | Status | Implemented by | Comment | Action |
---|---|---|---|---|---|---|---|
tuple | getGeoName | Lat / Long | geoName | New | Retrieve the nearest geoName, of any kind | (If return = "") Raise Alert ("No name found") | |
tuple | getGeoNameCityOrPort | Lat / Long | geoName | New | Retrieve the nearest geoName, of type "City" / "Port" | (If return = "") Raise Alert ("No name found") |
VALID project Action rules
Please note that no action has been defined for the VALID rules. The below proposed actions are tentative.
The table below presents the 7 core VALID rules.
Type | Trigger | Params | Returns | Status | Implemented by | Comment | Action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tuple | Daily Check (N+1?) | timestamp, PortName | New | Check that delay between two VMS reporting <= 12h | (If return = "FALSE") Raise Alert ("No VMS reporting for the last 12 hours contact port authorities for thorough check on vessel (calls managePort(PortName)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inter-entity | Daily Check (N+1?) | timestamp, Port information,VMS, e-LogBook | New | A logbook entry (Fishing Activity Report -FAR- declaration) must be available for every calendar day with VMS positions at sea | (If return = "FALSE") Raise Alert ("No FAR reporting for the last day contact port authorities for thorough check on vessel (calls managePort(PortName)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inter-entity | When RTP message is received | Species in FAR(Fishing Activity Report = species catches) declarations, DIS (Discarded Species) declarations, TRA (Transhipments) declarations, DEP (Departure from port) declaration = number of species on board when vessel leaves port, RTP (Return To Port = Landing declaration) | New | Comparison of logbook entries regarding species (catches, quantities on board, transhipments, discards) with species stated in the landing declaration | (If return = "FALSE") Raise Alert ("") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tuple | When RTP message is received | PNO (Prior Notification) message, RTP (Return To Port) message , for given fisheries (Herring, Mackerel, horse mackerel) to prepare landing control | New | A PNO is sent at least 4h prior to real return to port (RTP) | (If return = "FALSE") Raise Alert ("") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inter-entity | When FAR message is received | FAR (Fishing Activity Report) declarations, Fishing authorisations | New | Verify whether the combinations of fishing area, gear and species entered in a declaration of catches, are consistent with valid combinations according to a valid fishing authorization. (excluding catches taken for the purpose of scientific research) | (If return = "FALSE") Raise Alert ("") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inter-entity | When all declarations of commercialization are received | Landing declaration, Declarations of commercialization | New | Check whether landed species match species stated in the declarations of commercialisation (usage, transport declarations, take-over declarations). | (If return = "FALSE") Raise Alert ("") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
inter-entity | When all sales note are received | Sale notes, Fleet register | New | Check that vessel selling species is registered with a valid licence | (If return = "FALSE") Raise Alert ("")|}
Taxon name reconciliation rules
|