Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Master Data Facility

Josh Horton edited this page Feb 21, 2020 · 2 revisions

Master Data Facility

This page describes the XML to JSON mappings for Master Data Facility.

GS1 to JSON mapping

This section shows the GS1 XML to JSON mappings. JSON keys are on the left, and the XPaths to the corresponding tag in GS1 XML are on the right, separated by a colon character (:).

// Context Node: /basic_party_registration:BasicPartyRegistrationMessage/party
{

"assetIdUri": "urn:ibm:provenance:asset:transaction:order:<string>:default:default:<string>",
"organization": "<string>",
"layer": "location",
"label": "location",
"data":

{
  "locationGLN": "gln",
  "partyRole": {
    "partyName": "partyRole/partyName",
    "partyRoleCode": "partyRole/partyRoleCode"
  },
  "isPartyActive": "isPartyActive",
  "registeringParty": "registeringParty",
  "partyAddress": {
    "name": "partyAddress/name",
    "city": "partyAddress/city",
    "countryCode": "partyAddress/countryCode",
    "languagePartyCode": "partyAddress/languageOfThePartyCode",
    "poBoxNumber": "partyAddress/pOBoxNumber",
    "postalCode": "partyAddress/postalCode",
    "state": "partyAddress/postalCode",
    "streetAddress": "partyAddress/streetAddressOne"
  }
}

Input

The following example shows a valid GS1 XML file for input. The JSON output follows.

Note: The following fields have been removed for GDPR compliance:

  1. PartyContact (all sub-elements)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<basic_party_registration:basicPartyRegistrationMessage xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:basic_party_registration="urn:gs1:gdsn:basic_party_registration:xsd:3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <sh:StandardBusinessDocumentHeader>
        <sh:HeaderVersion>1</sh:HeaderVersion>
        <sh:Sender>
            <sh:Identifier Authority="GS1">string</sh:Identifier>
        </sh:Sender>
        <sh:Receiver>
            <sh:Identifier Authority="GS1">string</sh:Identifier>
        </sh:Receiver>string
        <sh:DocumentIdentification>
            <sh:Standard>GS1</sh:Standard>
            <sh:TypeVersion>3.1</sh:TypeVersion>
            <sh:InstanceIdentifier>string</sh:InstanceIdentifier>
            <sh:Type>basicPartyRegistration</sh:Type>
            <sh:CreationDateAndTime>2011-03-11T11:00:00.000-05:00</sh:CreationDateAndTime>
        </sh:DocumentIdentification>
    </sh:StandardBusinessDocumentHeader>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>namec</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>
    <party>
        <isPartyActive>true</isPartyActive>
        <registeringParty>string</registeringParty>
        <gln>string</gln>
        <partyAddress>
            <city>city</city>
            <countryCode>country code</countryCode>
            <languageOfThePartyCode>en</languageOfThePartyCode>
            <name>name</name>
            <pOBoxNumber></pOBoxNumber>
            <postalCode>postal code</postalCode>
            <state>state</state>
            <streetAddressOne>street address</streetAddressOne>
            <streetAddressTwo></streetAddressTwo>
        </partyAddress>
        <partyRole>
            <partyName>name</partyName>
            <partyRoleCode>role code</partyRoleCode>
        </partyRole>
    </party>

</basic_party_registration:basicPartyRegistrationMessage>

Output

The following example shows the JSON output from the input GS1 XML file above.

This is the generated ID:

{
  "id": "urn:ibm:provenance:asset:location:location:security_disabled:default:default:string"
}

This is the generated JSON:

{
    "isPartyActive": "true",
    "registeringParty": "numeric string",
    "locationGLN": "numeric string",
    "partyAddress": {
        "countryCode": "code",
        "name": "name",
        "city": "city",
        "poBoxNumber": "number",
        "postalCode": "postal code",
        "state": "state",
        "streetAddress": "street address"
    },
    "partyRole": {
        "partyName": "name",
        "partyRoleCode": "role code"
    },
    "documentHeader": {
        "senderGLN": "string",
        "receiverGLN": "string",
        "documentID": "string",
        "documentType": "basicPartyRegistration",
        "creationDateTime": "2011-03-11T11:00:00.000-05:00"
    }
}
Clone this wiki locally