SemanticModelUpsert

Use this node to create or update a semantic model.

Asset Type Name for Rules 

semanticmodel

Example Definition in chain.json 

1{
2  "name": "create_a_sdm",
3  "label": "Creates a Simple SDM",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "upsert_sdm1": {
9        "graphNodeType": {
10          "name": "SemanticModelUpsert"
11        },
12        "parameters": {
13          "name": "Test_Sample",
14          "label": "Test Sample",
15          "file": "sdms/sdm.json",
16          "semanticMetrics" : [
17            "MySemanticMetric"
18          ]
19        },
20        "sources": [],
21        "runAs": "CurrentUser"
22      }
23    }
24  }
25}

Example Definition with Locked Capabilities in chain.json 

Lock the capabilities for a semantic model to make it read-only for end users.

1{
2  "name": "create_a_sdm",
3  "label": "Creates a Simple SDM",
4  "dominoVariant": "sfdc_internal__UnifiedAnalyticsDominoVariant",
5  "parameters": {},
6  "definition": {
7    "nodes": {
8      "upsert_sdm1": {
9        "graphNodeType": {
10          "name": "SemanticModelUpsert"
11        },
12        "parameters": {
13          "name": "Test_Sample",
14          "label": "Test Sample",
15          "file": "sdms/sdm.json",
16          "capabilities": {
17            "deleteLocked": "true",
18            "editLocked": "true"
19          },
20          "semanticMetrics" : [
21            "MySemanticMetric"
22          ]
23        },
24        "sources": [],
25        "runAs": "CurrentUser"
26      }
27    }
28  }
29}

Parameters 

ParameterDefinition
name(Required) The developer name for the semantic model.
label(Required) The label for the semantic model. This is the label that appears in app logs and app install history.
file(Required) The path to the JSON file that contains the semantic model representation.
capabilities(Optional) The capabilities for the semantic model. Supported string values include deleteLocked, editLocked, and dataKitLocked. When set to "true", a semantic model can’t be altered by an end-user.
condition(Optional) An EL expression, evaluated at runtime, that determines whether to create or upgrade this semantic model or not.
semanticMetrics(Optional) A list of metric names associated with the semantic model.

Set runAs to CurrentUser so that this node runs with the permissions of the user installing the app. If you omit runAs, the node runs as AutoProc, a system user.

Note

App Context Values 

Semantic models created from a template get an entry in the App Context if they are successful. These entries are keyed off of the template specific asset name and contain information about the instance that was created.

App Context ValueDefinition
App.SemanticModels.<template specific asset name>.IdThe ID of the created semantic model.
App.SemanticModels.<template specific asset name>.NameThe developer name of the created semantic model.
App.SemanticModels.<template specific asset name>.LabelThe label of the created semantic model.
App.SemanticModels.<template specific asset name>.NamespaceThe namespace of the created semantic model.
App.SemanticModels.<template specific asset name>.FullyQualifiedNameThe fully qualified name of the created semantic model.

On Failure 

If this task fails, it returns a FAIL_TERMINAL status. The chain stops and no downstream nodes run.

See Also