Skip to content

wrong implementation in datamodels_subject(subject: str), inconsistant with the structure of official_list_data_models.json #81

@agaldemas

Description

@agaldemas

in the function datamodels_subject(subject: str) in pysmartdatamodels.py, the code can't work !
in

for item in datamodelsdict:
            if "repoName" and "dataModels" in item:
                if item["repoName"] == subject:
                    output = item["dataModels"]
                    done = True

but the structure of official_list_data_models.json is

"officialList": [
    {
      "repoName": "dataModel.User",
      "repoLink": "https://github.com/smart-data-models/dataModel.User.git",
      "dataModels": [
        "Activity",
        "UserContext"
      ],
      "domains": [
        "CrossSector"
      ]
    },

so the test if item["repoName"] == subject: cannot work !!!!
it should be something like: if subject in item["domains"]: to work !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions