兼容模式

Experience Data Model (XDM)是一个公开记录的规范,由Adobe驱动,用于提高数字体验的互操作性、表现性和强大功能。 Adobe在GitHub🔗上的开源项目中维护源代码和正式XDM定义。 这些定义使用XDM标准表示法编写,并使用JSON-LD(链接数据的JavaScript对象表示法)和JSON Schema作为定义XDM架构的语法。

在公共存储库中查看正式XDM定义时,您可以看到标准XDM与您在Adobe Experience Platform中看到的不同。 您在Experience Platform中看到的内容称为兼容性模式,它提供了标准XDM与Experience Platform中使用该模式的方式之间的简单映射。

兼容模式的工作原理

兼容模式允许XDM JSON-LD模型通过更改标准XDM中的值同时保持语义相同来与现有数据基础结构一起使用。 它使用嵌套的JSON结构,以树状格式显示架构。

您会注意到标准XDM和兼容模式之间的主要区别是删除了字段名称的“xdm:”前缀。

以下并排比较显示在标准XDM和兼容性模式中与生日相关的字段(删除了“description”属性)。 请注意,兼容性模式字段包括对XDM字段的引用,以及它在“meta:xdmField”和“meta:xdmType”属性中的数据类型。

标准XDM兼容模式
{
  "xdm:birthDate": {
    "title": "Birth Date",
    "type": "string",
    "format": "date"
  },
  "xdm:birthDayAndMonth": {
    "title": "Birth Date",
    "type": "string",
    "pattern": "[0-1][0-9]-[0-9][0-9]"
  },
  "xdm:birthYear": {
    "title": "Birth year",
    "type": "integer",
    “最小值”:1,
    "maximum": 32767
  }
}

{
  "birthDate": {
    "title": "Birth Date",
    "type": "string",
    "format": "date",
    "meta:xdmField": "xdm:birthDate",
    "meta:xdmType": "date"
  },
  "birthDayAndMonth": {
    "title": "Birth Date",
    "type": "string",
    "pattern": "[0-1][0-9]-[0-9][0-9]",
    "meta:xdmField": "xdm:birthDayAndMonth",
    "meta:xdmType": "string"
  },
  "birthYear": {
    "title": "Birth year",
    "type": "integer",
    “最小值”:1,
    "maximum":32767,
    "meta:xdmField": "xdm:birthYear",
    "meta:xdmType": "short"
  }
}