Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Comparing metadata using Talend Data Integration

Hi,
   I am very new to Talend and trying to solve a requirement in my current project. I need to compare XSD and JSON metadata from two different sources and output a XLS file if these metadata match. Can you please give me some tips if you have worked on similar requirement?
Thanks,
Souvik
Labels (3)
2 Replies
Anonymous
Not applicable

Hi,
Could you please take a look at the component: TalendHelpCenter:tXSDValidator which  validates an input XML file or an input XML flow against an XSD file and sends the validation log to the defined output?
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III
Author

Hi Sabrina,
    Thanks for your response. Let me explain you the requirement a little more in detail. I am receiving schema definitions/metadata from multiple sources. These definitions/metadata are sent in the format of XSD or JSON Schema. All I am trying to do is comparing these metadata information across sources (like XSD and JSON in my example) and give an output if they match or not. 
Below are sample XSD and JSON schemas -
        <?xml version="1.0" encoding="UTF-8"?>
         <xs:schema elementFormDefault="qualified" targetNamespace="myNamespace/TroubleTicketCountResponse.xsd" version="214.0.00" xmlns="myNamespace/TroubleTicketCountResponse.xsd"  xmlns:xs="">
          <xs:element name="TicketCountResponse" type="TicketCountResponseInfo"/>
          <xs:complexType name="TicketCountResponseInfo">
            <xs:annotation>
              <xs:documentation>Retrieves Ticket counts</xs:documentation>
            </xs:annotation>
            <xs:sequence>
               <xs:element minOccurs="0" name="addressId">
                      <xs:annotation>
                        <xs:documentation>Location Id</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="30"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" name="organizationId" type="xs:int">
                      <xs:annotation>
                        <xs:documentation>Organization Identifier</xs:documentation>
                      </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" name="assetId">
                      <xs:annotation>
                        <xs:documentation>CircuitId</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="20"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" name="assetKey">
                      <xs:annotation>
                        <xs:documentation>AssetId</xs:documentation>
                      </xs:annotation>
                      <xs:simpleType>
                        <xs:restriction base="xs:string">
                          <xs:maxLength value="30"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element minOccurs="0" name="accountOrganizationId" type="xs:string">
                      <xs:annotation>
                        <xs:documentation>accountOrganizationid</xs:documentation>
                      </xs:annotation>
                    </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
JSON -
    "title": "CustomerTroubleTicketCount",
    "description": "Retrieves Ticket counts",
    "type": "object",
    "properties": {
        "addressId": {
            "description": "replacement for Location Id",
            "type": "string"
        },
        "organizationId": {
            "description": "Organization Identifier",
            "type": "number"
        },
        "assetId": {
            "description": "Circuit Id",
            "type": "string",
        }
    },
        "assetKey": {
            "description": "AssetId can be serial circuit/CLCI",
            "type": "string",
        }
    },
        "accountOrganizationId": {
            "description": "accountOrganizationid",
            "type": "string",
        }
    }
As you can see i have same fields in both the schemas. All I am trying to do is compare them using Talend and publish an output on the basis of that comparison.