Informatica-EIC / REST-API-Samples

This repository contains Java samples for EIC REST API. For instructions on running the samples, see the Readme files in the java directory.
MIT License
24 stars 32 forks source link

lineage_validator with Reference Data Sets #40

Open greg-infa opened 1 year ago

greg-infa commented 1 year ago

Hi Darren,

It is sometimes necessary to create custom lineage to (or from) Reference Data Sets/Elements. lineage_validator classifies all id's of Reference Data Sets as invalid. Adding "includeRefObjects": "true" to the first call of /access/2/catalog/data/objects inside validate_edc_id function should fix it. So the lines 298-310 of the script would be:

tResp = edcHelper.session.get(
        apiURL,
        params={
            "offset": 0,
            "pageSize": 1,
            "id": f"{id}",
            "associations": link_type,
            "includeDstLinks": "true",
            "includeSrcLinks": "true",
            "includeRefObjects": "true"
        },
        headers=header,
    )

The is_resource_casesenitive function will not work for Reference Data Sets, as the /access/1/catalog/resources/{resourceName} does not work with Reference Resources well (they may have "too strange" names), but it is not an issue as the first call to /access/2/catalog/data/objects should validate correctly.

Thanks Greg

darren-wrigley commented 1 year ago

thx for the info - the initial rqts for this utility script didn't involve reference resources/objects - your suggested changes make sense. i can make the change, and also modify the check for case-sensitive resources to handle reference resources