odpi / egeria

Egeria core
https://egeria-project.org
Apache License 2.0
805 stars 260 forks source link

Python function to print the asset universe #4676

Closed mandy-chessell closed 2 years ago

mandy-chessell commented 3 years ago

Egeria's open metadata labs use python notebooks to drive sequences of REST API calls to Egeria's runtime platform called the OMAG Server Platform. There is one function called printAssetUniverse that needs work. This function is designed to provide a data scientist with detailed information about an Asset (such as a file or a database). This includes name, description, its location, content, classification, profile information, comments and other feedback, who owns it, etc.

At the moment the function just returns the basic information and prints out the Json from the REST API call like this:

GET https://localhost:9443/servers/cocoMDS3/open-metadata/common-services/asset-consumer/connected-asset/users/calliequartile/assets/377afa80-312d-4d94-847e-3c42dd8f47b1
Returns:
{
    "class": "AssetResponse",
    "relatedHTTPCode": 200,
    "asset": {
        "class": "Asset",
        "headerVersion": 0,
        "type": {
            "class": "ElementType",
            "headerVersion": 0,
            "elementSourceServer": "cocoMDS3",
            "elementOrigin": "LOCAL_COHORT",
            "elementMetadataCollectionId": "e89b978d-da68-4aec-8001-3bb46f32aee9",
            "elementMetadataCollectionName": "Data Lake Catalog",
            "elementCreatedBy": "peterprofile",
            "elementUpdatedBy": "cocoMDS2npa",
            "elementCreateTime": "2021-02-09T22:01:38.292+00:00",
            "elementUpdateTime": "2021-02-09T22:01:38.951+00:00",
            "elementVersion": 10,
            "elementTypeId": "2ccb2117-9cee-47ca-8150-9b3a543adcec",
            "elementTypeName": "CSVFile",
            "elementSuperTypeNames": [
                "DataFile",
                "DataStore",
                "Asset",
                "Referenceable",
                "OpenMetadataRoot"
            ],
            "elementTypeVersion": 1,
            "elementTypeDescription": "A description of a comma separated value (CSV) file",
            "status": "ACTIVE"
        },
        "guid": "377afa80-312d-4d94-847e-3c42dd8f47b1",
        "classifications": [
            {
                "class": "ElementClassification",
                "headerVersion": 0,
                "elementSourceServer": "cocoMDS3",
                "elementOrigin": "LOCAL_COHORT",
                "elementMetadataCollectionId": "e89b978d-da68-4aec-8001-3bb46f32aee9",
                "elementMetadataCollectionName": "Data Lake Catalog",
                "elementCreatedBy": "cocoMDS1npa",
                "elementUpdatedBy": "cocoMDS2npa",
                "elementCreateTime": "2021-02-09T22:01:38.438+00:00",
                "elementUpdateTime": "2021-02-09T22:01:38.951+00:00",
                "elementVersion": 13,
                "classificationTypeVersion": 0,
                "classificationOrigin": "ASSIGNED",
                "classificationName": "LatestChange",
                "classificationProperties": {
                    "changeTarget": null,
                    "description": "Adding AssetZoneMembership classification to Asset 377afa80-312d-4d94-847e-3c42dd8f47b1",
                    "user": "erinoverview",
                    "classificationName": "AssetZoneMembership",
                    "changeAction": null
                },
                "status": "ACTIVE"
            },
            {
                "class": "ElementClassification",
                "headerVersion": 0,
                "elementSourceServer": "cocoMDS3",
                "elementOrigin": "LOCAL_COHORT",
                "elementMetadataCollectionId": "e89b978d-da68-4aec-8001-3bb46f32aee9",
                "elementMetadataCollectionName": "Data Lake Catalog",
                "elementCreatedBy": "erinoverview",
                "elementCreateTime": "2021-02-09T22:01:38.834+00:00",
                "elementVersion": 1,
                "classificationTypeVersion": 0,
                "classificationOrigin": "ASSIGNED",
                "classificationName": "AssetOwnership",
                "classificationProperties": {
                    "owner": "tanyatidie",
                    "ownerType": null
                },
                "status": "ACTIVE"
            },
            {
                "class": "ElementClassification",
                "headerVersion": 0,
                "elementSourceServer": "cocoMDS3",
                "elementOrigin": "LOCAL_COHORT",
                "elementMetadataCollectionId": "e89b978d-da68-4aec-8001-3bb46f32aee9",
                "elementMetadataCollectionName": "Data Lake Catalog",
                "elementCreatedBy": "erinoverview",
                "elementCreateTime": "2021-02-09T22:01:38.923+00:00",
                "elementVersion": 1,
                "classificationTypeVersion": 0,
                "classificationOrigin": "ASSIGNED",
                "classificationName": "AssetZoneMembership",
                "classificationProperties": {
                    "zoneMembership": {
                        "instancePropertyCategory": "ARRAY",
                        "arrayCount": 2,
                        "arrayValues": {
                            "class": "InstanceProperties",
                            "instanceProperties": {
                                "0": {
                                    "class": "PrimitivePropertyValue",
                                    "instancePropertyCategory": "PRIMITIVE",
                                    "primitiveDefCategory": "OM_PRIMITIVE_TYPE_STRING",
                                    "primitiveValue": "data-lake"
                                },
                                "1": {
                                    "class": "PrimitivePropertyValue",
                                    "instancePropertyCategory": "PRIMITIVE",
                                    "primitiveDefCategory": "OM_PRIMITIVE_TYPE_STRING",
                                    "primitiveValue": "clinical-trials"
                                }
                            },
                            "propertyNames": [
                                "0",
                                "1"
                            ],
                            "propertyCount": 2
                        }
                    }
                },
                "status": "ACTIVE"
            }
        ],
        "extendedProperties": {
            "quoteCharacter": "\"",
            "delimiterCharacter": ",",
            "fileType": "csv"
        },
        "qualifiedName": "file://secured/research/clinical-trials/drop-foot/Patients.csv",
        "displayName": "Drop Foot Clinical Trial Patients",
        "description": "List of patients registered for the drop foot clinical trial.",
        "owner": "tanyatidie",
        "ownerType": "USER_ID",
        "zoneMembership": [
            "data-lake",
            "clinical-trials"
        ],
        "referenceData": false
    },
    "certificationCount": 0,
    "commentCount": 1,
    "connectionCount": 1,
    "externalIdentifierCount": 0,
    "externalReferencesCount": 0,
    "informalTagCount": 0,
    "licenseCount": 0,
    "likeCount": 0,
    "keywordCount": 0,
    "knownLocationsCount": 0,
    "noteLogsCount": 0,
    "ratingsCount": 0,
    "relatedAssetCount": 0,
    "relatedMediaReferenceCount": 0
}

The counts at the end indicate what other information is potentially available. This is a small example of an asset, but the information returned could be very extensive.

We are looking for a function that extracts as much information as is avalable and displays it in a useful way to help a data scientist decide if this asset is going to be useful.

This link gives some background on what can be stored about an asset. https://egeria.odpi.org/open-metadata-publication/website/cataloging-assets/

The call to printAssetUniverse is in the inderstanding-an-asset.ipynb in the asset-management-labs: https://egeria.odpi.org/open-metadata-resources/open-metadata-labs/

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.