Skip to content

Skip Logic

Rebecca Madsen edited this page May 21, 2019 · 9 revisions

Purpose

Skip logic provides interfaces an API to use a Network Query to define whether an interface should be skipped or shown.

Skip Logic API

Property Possible Values Purpose
action
Required
'SHOW' or 'SKIP' This string dictates whether an interface should be skipped or shown if the query against the network matches.
filter
Required
An object describing the query, or (DISABLED UNTIL SAFE) A string that can be functionized to create a query. This filter is used to construct the query against the network.
filter.join
Optional
Default: 'AND'
'OR' or 'AND' This describes how to combine the rules in the filter. It defaults to 'AND'.
filter.rules
Optional
Default: []
An array of objects, which are subquery rules. These rules are evaluated against the network.
filter.rules.type
Required
'alter', 'ego', or 'edge' The type of network object to match against.
filter.rules.id
Optional
A unique identifier. Identifier for a rule.
filter.rules.options
Required
An object describing the subquery. This describes the subquery
filter.rules.options.type
Required
A string ID matching a key in the variable registry under either 'node' or 'edge'; e.g., the ID corresponding to a 'person' or 'friend' name. See a node example with NODE_TYPE_ID Describes which type of node or edge from the network to include in the query.
filter.rules.options.attribute
Required
A string ID matching a key in the above type's variable definitions, denoting an edge or node attribute. Describes which attribute value to match against.
filter.rules.options.operator
Required
'EXISTS', 'NOT_EXISTS', 'EXACTLY', 'NOT', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL' These rules are evaluated against the network.
filter.rules.options.value A string, number, etc. This is optional if the rule operator is 'EXISTS' or 'NOT_EXISTS'; otherwise, a value must be specified. Used in the subquery comparison to match against node/edge attribute's values.

Example usage using a filter object

      "skipLogic": {
        "action": "SHOW",
        "filter": {
          "join": "OR",
          "rules": [
            {
              "type": "alter",
              "id": "15218241538622",
              "options": {
                "type": "person",
                "attribute": "name",
                "operator": "EXACTLY",
                "value": "Dee"
              }
            },
            {
              "type": "ego",
              "id": "15218241553253",
              "options": {
                "attribute": "name",
                "operator": "EXACTLY",
                "value": "Bob"
              }
            },
            {
              "type": "edge",
              "id": "15218241565624",
              "options": {
                "type": "friends",
                "operator": "EXISTS"
              }
            }
          ]
        }
      }