Parameter Property

Parameter property based filtering is done on the basis of properties mentioned in parameter property. Property can be of text, count or quantity type. Input data will be passed only if parameter property is present in input data with value satisfying the condition in MR rule.

  • Below is the create rule JSON for parameter property based filtering:

{
  "RuleName": "Demo rule parameter property",
  "RuleDescription": "Demo rule for user guide",
  "parallelismFactor": "1",
  "input": {
     "DirectExchange": "Direct.Exchange",
     "RoutingKey": "e325f4fe-a0e3-4252-82af-4c24deb8c0cf"
  },
  "params": [
     {
         "name": "feature",
         "value": "room1"
     },
     {
         "name": "sensorID",
         "value": "NEXUS1"
     },
     {
         "name": "time",
         "value": {
             "starttime": "",
             "endtime": ""
         }
     },
     {
         "name": "expression",
         "value": {
             "if": "",
             "then": "",
             "else": ""
         }
     },
     {
         "name": "",
         "type": "rectangle/circles/polygon",
         "geoFencing": "NO",
         "value": {
             "points": [
                 {
                     "x": "",
                     "y": ""
                 },
                 {
                     "x": "",
                     "y": ""
                 }
             ]
         }
     },
     {
         "name": "ObservedProperties",
         "value": []
     },
     {
         "name": "meta-data",
         "value": []
     },
     {
         "name": "parameter",
         "value": [
             {
                 "name": "Height",
                 "value": "4",
                 "type": "quantity"
             }
         ]
     }
   ],
   "output": {
     "TopicExchange": "DemoExchange",
     "Topic": "demo21"
   }
 }

As we can see in the above JSON sensor ID, feature and parameter is provided as height which acts as filtering condition for input data and routes input data with sensor NEXUS1, feature as room1 and height property in parameter with the given value. In case input data misses the parameter property or the value given in parameter property is not matching the condition, it will be discarded. Topic exchange name is DemoExchange which we have already created in the topic exchange section.

  • In above create rule JSON filtering type of parameter property can be used in the following ways:

1) Range Check (Band Pass)

In order to specify the value as a range check format, the value can be provided with lower range value and upper range value. Here we have used height property of parameter with range of 80-120 which means any value from 80 to 120 will be passed from this MR rule. This acts as band pass . Following portion of create rule JSON can be used for band pass:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "(80,120)",
             "operator": ""
          }
      ]
   }

Steps to create rule will be same as discussed in observed property section.

Send Request operation for parameter property will remain same as in observed property section:

  • Below is the input SOS observation JSON

{
 "version": "1.0.1",
 "observations": [
     {
         "sensor": "testquality",
         "feature": "room1",
         "record": [
             {
                 "starttime": "1-JAN-2014 15:30:00 IST",
                 "output": [
                     {
                         "name": "temp",
                         "value": "xyz",
                         "type": "text"
                     }
                 ]
             }
         ],
         "meta-data": [],
         "parameter": [
             {
                 "name": "Height",
                 "value": "85",
                 "type": "quantity"
             }
         ]
     }
  ]
 }

2) Range Check (Band Block)

In order to specify the value as a range check format, the value can be provided with lower range value and upper range value. Here we have used height property of parameter with range of 80-120 which means any value from 80 to 120 will not be passed from this MR rule. This acts as band block. Following portion of create rule JSON can be used for band block:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "!(80,120)",
             "operator": ""
          }
      ]
   }

3) “<” Operator

In this filtering only the upper value should be defined and the operator “<” is used. Here we have used height property with < operator and value 200 which means any value greater than or equal to 200 for input JSON will be not be passed from this MR rule.Following portion of create rule JSON can be used for < operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "200",
             "operator": "<"
          }
      ]
   }

4) “>” Operator

In this filtering only the lower value should be defined and the operator “>” is used. Here we have used height property with > operator and value 50 which means any value less than or equal to 50 for input JSON will not be passed from this MR rule. Following portion of create rule JSON can be used for > operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "50",
             "operator": ">"
          }
      ]
   }

5) “<=” Operator

In this filtering only the higher value should be defined and the operator “<=” is used. Here we have used height property with <= operator and value 200 which means any value greater than 200 for input JSON will not be passed from this MR rule. Following portion of create rule JSON can be used for > operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "200",
             "operator": "<="
          }
      ]
   }

6) “>=” Operator

In this filtering only the lower value should be defined and the operator “>=” is used. Here we have used height property with >= operator and value 50 which means any value less than 50 for input JSON will be not be passed from this MR rule. Following portion of create rule JSON can be used for >= operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "50",
             "operator": ">="
          }
      ]
   }

7) “!=” Operator

In this filtering only one value to be blocked is defined and the operator “!=” is used. Here we have used height property with != operator and value 80 which means any value equal to 80 for input JSON will be not be passed from this MR rule. Following portion of create rule JSON can be used for != operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "quantity",
             "value": "80",
             "operator": "!="
          }
      ]
   }

8) REGEX Checking

In this filtering regular expression is defined in rule like sys*. Here we have used height property of type text defined with value as regular expression as sys* which means any value other than sys* regular expression for input JSON will not pass from this MR rule. Following portion of create rule JSON can be used for regex operator:

{
      "name": "parameter",
      "value": [
           {
             "name": "Height",
             "type": "text",
             "value": "sys*",
             "operator": ""
          }
      ]
   }