Facet
All docs

Semantic Mapping Guide

Declaring business-meaning classifications (e.g. "sensitive", "approver", "high-risk") over data ADG has already observed.

Semantic Mapping Guide

Read this if: you need your Governance, Analytics, or FinOps dashboards to answer a business question your raw data doesn't already name directly — e.g. "which of these Artifacts count as an approval?", "which Resources are approvers?", or "which Artifacts touch sensitive data and should be flagged for review?"

Semantic Mapping lets you declare business meaning over data ADG has already observed, without changing anything about how your application is instrumented, and without the platform ever guessing at your business semantics on its own.

When to use this layer

Use Semantic Mapping when your business logic needs to classify an already-observed Trace, Activity, Artifact, or Resource into a category your raw data doesn't name directly with a fixed field — for example:

  • "Which Artifacts are sensitive?" — maybe your payload has a classification field, maybe it's inferred from the Artifact's name, maybe from which step produced it. You decide the rule.
  • "Which Resources are approvers?" — maybe by resource name, maybe by resource type.
  • "Which Artifacts are financial_documents?"

If your raw data already names the canonical field directly — your payload literally has a key your platform just needs to read under a different name — that's a renaming problem, not a classification one: see the Field Mapping guide instead. If you need an entirely new canonical Artifact type that doesn't exist today, that's a platform change, not a per-customer classification rule — talk to your Facet platform contact about that instead of trying to express it here.

Authoring a rule

A Semantic Mapping rule has three parts: what kind of entity it applies to, the conditions that must all match, and any extra attributes to attach to a match.

{
  "semantic_type": "<your classification name>",
  "entity": "trace | activity | artifact | resource",
  "match": [
    { "field": "<field path>", "op": "equals", "value": "<any>" }
  ],
  "attributes": { "<any key>": "<any static value>" }
}
  • entity selects which collection the rule scans: trace evaluates the Trace itself; activity evaluates every Activity in it; artifact evaluates every Artifact across every Activity; resource evaluates every distinct Resource used anywhere in the Trace.
  • match conditions are combined with AND — every condition must hold for the rule to fire. To express OR, write multiple rules that share the same semantic_type.
  • field paths read directly from the entity: payload.foo reaches into an Artifact's own payload; name, artifact_type, resource_type, and similar top-level fields are also valid.
  • op is one of:
    • equals / not_equals — exact value comparison.
    • contains — substring match (on a string field) or membership (on a list field).
    • exists — true whenever the field has any value at all; value is ignored.
  • attributes are static metadata merged verbatim into every match — useful for a human-readable reason, a severity tag, or any other fixed label your dashboards want to show alongside the classification. These are never computed — only fixed values you supply yourself.

A worked example

{
  "rules": [
    {
      "semantic_type": "approval",
      "entity": "artifact",
      "match": [
        { "field": "artifact_type", "op": "equals", "value": "APPROVAL" }
      ]
    },
    {
      "semantic_type": "approver",
      "entity": "resource",
      "match": [
        { "field": "name", "op": "contains", "value": "Approver" }
      ]
    },
    {
      "semantic_type": "sensitive_artifact",
      "entity": "artifact",
      "match": [
        { "field": "payload.classification", "op": "equals", "value": "confidential" }
      ],
      "attributes": { "reason": "payload.classification == confidential" }
    }
  ]
}

This produces three classifications: every Artifact already typed APPROVAL is tagged approval; every Resource whose name contains "Approver" is tagged approver; and any Artifact whose payload marks itself confidential is tagged sensitive_artifact, carrying the reason attribute along with it.

Configuring Semantic Mapping

Semantic Mapping is entirely platform-managed — there is no SDK-side configuration file for it, because it operates on data that's already been observed and stored, not on your application's own runtime.

Configure it in the Customer Portal's "Semantic Mapping" tab: author your rule set directly, or upload/download it as a single file for bulk editing. The Portal validates your rule set before saving — an unknown entity type, unknown operator, or malformed rule is rejected with a clear message pointing at the offending field.

A new rule set always replaces the previous one in full for that application — it's never merged field-by-field.

Tenant-wide defaults

If several of your applications should share the same classification rules (e.g. the same sensitive_artifact rule across every application in your organization), configure it once as your tenant-wide default in the Portal instead of repeating it per application. Any application's own rule set, if configured, always takes precedence as a whole over the tenant-wide default — the two are never partially merged together, since a partial merge of two different rule sets for the same classification has no well-defined meaning.

Who typically owns this

Because classification is a business or regulatory judgment call — "what counts as sensitive, or high-risk, for this business line" — it's typically owned by a Compliance, Risk, or domain business stakeholder, often alongside your Facet solutions engineer in an onboarding workshop, rather than by the engineer who wired up the original instrumentation. Field Mapping and Ontology Mapping, by contrast, are naming/schema questions better suited to an integrating engineer. Each layer's config is deliberately kept separate so the right person is only ever asked questions within their own competence.

Relationship to Field Mapping

Semantic Mapping classifies; it never renames or computes a value. If your dashboard shows a blank or missing value for a field you know your data has, under a different name, that's Field Mapping's job, not Semantic Mapping's — see the Field Mapping guide. In practice, a classification rule works best once the data it inspects is already readable under its canonical name, so Field Mapping is usually configured first.

Where to go next

  • The Field Mapping guide — renaming your own field names onto canonical fields a projection already expects.
  • The Artifact Type Mapping guide — classifying your own outcome Artifacts by type, a related but distinct, earlier step.
  • The Ontology Mapping Decision Guide — for the earlier question of which of your own objects/calls should become a Trace, Activity, Artifact, or Resource in the first place.
  • Your Facet platform contact — for tenant-wide defaults, or for help working through a classification decision with a compliance or business stakeholder.