RSJSON Parser mappings

RSJSON to JSON conversion mappings

The RSJSON Parser Snap uses the following mappings to parse the entity information in RSJSON format to the simplified JSON format.

RSJSON element Parsed JSON element
id id
name name
type type
properties Not parsed
data.attributes attributes
attributeName.values.value
"data": {
"attributes": {
"thgdescription": {
"values": [
{
"id": "1_0_0",
"value": "test",
"locale": "en-US",
"source": "internal"
}
]
}
}
}
attributes.attributeName
"attributes" : {
"thgdescription" : "test"
}

For nested types: The group and other metadata is ignored.

"testnestedparent": {
"group": [
{
"id": "9_0_0",
"locale": "en-US",
"source": "internal",
"childnestedparentaa": {
"values": [
{
"id": "9_0_0_0",
"value": "test",
"locale": "en-US",
"source": "internal"}
]
},
"childnestedparentbb": {
"values": [
{
"id": "9_0_0_0",
"value": "test",
"locale": "en-US",
"source": "internal"}
]
}
},
"id": "9_0_1",
"locale": "en-US",
"source": "internal",
"childnestedparentaa": {
"values": [
{
"id": "9_0_1_0",
"value": "1",
"locale": "en-US",
"source": "internal"
}
]
},
"childnestedparentbb": {
"values": [
{
"id": "9_0_1_0",
"value": "1",
"locale": "en-US",
"source":"internal"
}
]
}
}
]
}

The simplified version will look like this.

"testnestedparent": [
{
"childnestedparentaa" : "test",
"Childnestedparentbb" : "test"
},
{
"childnestedparentaa" : "1",
"childnestedparentbb" : "1"
}
]

For localizable properties,

"thgbrand": {
"values": [
{
"id": "7_0_0",
"value": "French",
"locale": "fr-FR",
"source": "internal"},
{
"id": "9_0_0",
"value": "Amazon",
"locale": "en-US",
"source": "internal"
}
]
}
thgbrand" : {
"fr-FR" : "French",
"en-US:"Amazon"
}

For the data above, if the user selects fr-FR as the Locale, the output looks like below.

"thgbrand" : "French"

If user selects a locale that is not available, the output value will be null.

"thgbrand" : null
Note: This applies for both global attributes and context attributes.

For attributes with a uom:

"packaginglength": {
"values": [
{
"id": "9_0_0",
"value": 13.5,
"locale": "en-US",
"source": "internal",
"uom": "in",
"properties": {
"uomIdentifier": "in",
"uomData":
"uomLength/f9be4093-0970-4215-bf58-e7d362f9380a"}
}
]
}
"Packaginglength": "13.5##in"

When contexts are present:

"contexts": [{
"context": {
"refchannel": "India Mobile"
},
"attributes": {
"mdmname": {
"values": [
{
"id": "1_0_0",
"value": "Coffee table",
"locale": "en-US",
"os": "contextCoalesce",
"osid": "55daca89",
"ostype": "product",
"osctxpath": "self@@self",
"source": "internal"
}
]
}
}
},
{
"context": {
"refcountrylist": "India"
},
"attributes": {
"mdmname": {
"values": [
{
"id": "1_0_0",
"value": "Coffee table",
"locale": "en-US",
"os": "contextCoalesce",
"osid": "55daca89",
"ostype": "product",
"osctxpath": "self@@self",
"source": "internal"
}
]
}
}
}
}]

The keys for contexts are generated using conetxtName and contextValue separated with a hyphen "-":

"contexts": [
"refchannel-India Mobile" : {
"attributes": {
mdmname" : "Coffee table"
}
},
"refcountrylist-India" : {
"attributes": {
"mdmname" : "Coffee table"
}
}
}

When relationships are present

"relationships": {
"hasimages": [
{
"id": "9_0_1",
"relTo": {
"id": "579691c5",
"type": "image"
}
}]
"relationships": {
"hasimages": [
{
"id": "579691c5",
"type": "image"
}
]
}

When a relationship has attributes

"relationships": {
"ischildofproductmodel": [
{
"id": "13_0_0",
"relTo": {
"id": "ersuAcOa5y90KrM",
"type": "productmodel"
}
"properties": {
"direction": "both",
"relationshipType": "ischildofproductmodel"
},
"attributes": {
"additionaldetails": {
"values": [
{
"id": "21_0_0",
"value": "test",
"locale": "en-US",
"source": "internal"
}
]
},
"productorder": {
"values": [
{
"id": "21_0_0",
"value": 10,
"locale": "en-US",
"source": "internal"
}
]
}
}
}
]
}
"relationships": {
"ischildofproductmodel": [{
"id": "ersuAcOa5y90KrM",
"type": "productmodel"
"relationshipAttributes" : {
"additionaldetails":"test",
"productorder":10
}
}]
}

If the given input document has the information about the child id, the output looks like this (Applicable to only RSJSON Parser Snap):

"relationships": {
"ischildofproductmodel": [
{
"id": "ersuAcOa5y90KrM",
"type": "productmodel"
"name": "test product model"
"relationshipAttributes" : {
"additionaldetails":"test",
"productorder":10
},
"attributes" : {
"mdmname":"test product model",
"mdmid":1
}
}
]
}