Difference between revisions of "Rule frame"

From D4Science Wiki
Jump to: navigation, search
(ICIS Rule Frame)
(Action rules)
Line 65: Line 65:
 
| align="center" | Retrieve the nearest geoName, of type "City" / "Port"
 
| align="center" | Retrieve the nearest geoName, of type "City" / "Port"
 
| align="center" | (If return = "") Raise Alert ("No name found")
 
| align="center" | (If return = "") Raise Alert ("No name found")
 +
|}
 +
 +
==== VALID project Action rules ====
 +
 +
{| border="1" cellpadding="4" cellspacing="0" valign="top"
 +
! width="50"|'''Type''' !! width="120"|'''Trigger''' !! width="120"|'''Params''' !! width="120"|'''Returns''' !! width="120"|'''Status''' !!width="120"|'''Implemented by''' !! width="120"|'''Comment''' !! width="120"|'''Action''' 
 +
|- valign="top"
 +
| align="center" | tuple
 +
| align="center" | chkPort
 +
| align="center" | PortName, timestamp
 +
| align="center" |
 +
| align="center" | New
 +
| align="center" |
 +
| align="center" | Check if the reported port is valid
 +
| align="center" | (If return = "") Raise Alert ("No port found, want to check the name Y/N (calls managePort(PortName)")
 +
|-
 +
| align="center" | entity
 +
| align="center" | chkPortMooring
 +
| align="center" | [[PortName], [timestamp]]
 +
| align="center" |
 +
| align="center" | New
 +
| align="center" |
 +
| align="center" | Check if the reported stay in a port is valid; no other location can be reported in between reported location
 +
| align="center" | (If return = "FALSE") Raise Alert ("No valid port mooring reported")
 +
|-
 +
| align="center" | inter-entity
 +
| align="center" | chkSteaming
 +
| align="center" | [[Lat], [long], [timestamp]]
 +
| align="center" |
 +
| align="center" | New
 +
| align="center" |
 +
| align="center" | Check if the reported positions are valid steaming according to chkSea, chkSpeed, chkLicense, chkFishArea
 +
| align="center" | (If return = "FALSE") Raise Alert ("No valid port mooring reported")
 +
|-
 +
| align="center" | OTA
 +
| align="center" | managePort
 +
| align="center" | [PortName, timestamp opt]
 +
| align="center" |
 +
| align="center" | New
 +
| align="center" |
 +
| align="center" | Check if the PortName does exist given the timestamp, and gives Create Update options
 +
| align="center" | (If return = "TRUE") Raise Alert ("Your changes have been sent for review")
 +
 
|}
 
|}

Revision as of 17:00, 9 July 2013

ICIS 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.

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

Type Trigger Params Returns Status Implemented by Comment Action
tuple chkPort PortName, timestamp New Check if the reported port is valid (If return = "") Raise Alert ("No port found, want to check the name Y/N (calls managePort(PortName)")
entity chkPortMooring [[PortName], [timestamp]] New Check if the reported stay in a port is valid; no other location can be reported in between reported location (If return = "FALSE") Raise Alert ("No valid port mooring reported")
inter-entity chkSteaming [[Lat], [long], [timestamp]] New Check if the reported positions are valid steaming according to chkSea, chkSpeed, chkLicense, chkFishArea (If return = "FALSE") Raise Alert ("No valid port mooring reported")
OTA managePort [PortName, timestamp opt] New Check if the PortName does exist given the timestamp, and gives Create Update options (If return = "TRUE") Raise Alert ("Your changes have been sent for review")