SMML Elements: Rules

The SMML custom consistency check rules element corresponds to the custom consistency check schema in the semantic model's custom rules. The custom consistency check schema contains rules objects and elements.

rules Elements

  • name (required property) — The name of the custom consistency check rule.
  • description — The description of the custom consistency check rule.
  • category — The group that the rule's results are assigned to. Can set to WARNING or ERROR.
  • errorNumber — The number assigned to the error and is displayed in the custom consistency check results. Can specify numbers and letters.
  • query — The rule's JSONPath query syntax. See About Using JSONPath to Write Custom Rule Queries and JSONPath Custom Consistency Check Query Examples.
  • message — The error or warning message displayed in the custom consistency check results.
  • active — If set to true, custom consistency check rule is enabled. If set to false, rule is disabled.

Syntax

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "$ref": "#/definitions/customConsistencyCheck",
   "definitions": {
      "customConsistencyCheck": {
         "type": "object",
         "properties": {
            "rules": {
               "type": "array",
               "items": {
                  "$ref": "#/definitions/CustomRule"
               }
            }
         },
         "title": "CustomConsistencyCheck"
      },
      "CustomRule": {
         "type": "object",
         "properties": {
            "name": {
               "type": "string",
               "minLength": 1,
               "pattern": "^[^?*']+$"
            },
            "description": {
               "type": "string"
            },
            "category": {
               "$ref": "http://example.com/bi/semanticmodeler/v1/common#/definitions/Category"
            },
            "errorNumber": {
               "type": "string"
            },
            "query": {
               "type": "string"
            },
            "message": {
               "type": "string"
            },
            "active": {
               "type": "boolean"
            },
         },
         "required": [
            "name"
         ]
      }
   }
}