smart-data-models / data-models

Data Models in common use based on real world use-cases. These definitions underpin a digital market of interoperable and replicable smart solutions.
https://smartdatamodels.org/
114 stars 56 forks source link

Functionality unclear with regards to properties and attributes in pysmartdatamodels #40

Closed auphofBSF closed 1 year ago

auphofBSF commented 2 years ago

I imagine there is a plan for attributes and properties as shown in https://github.com/smart-data-models/data-models/blob/df304f80d691750d8bd9d50d1be4bf96590b3c88/pysmartdatamodels/pysmartdatamodels.py#L77

I would like to retrieve the RepoLink as defined in official_list_data_models.json for the moment I have implemented the following,

is there an alternative and what is the intended properties ?

def datamodels_subject(subject: str, names_only=True):
    """List the names or full record of the entities defined in the data models.
    Parameters:
        subject: name of the subject
        names_only: (default True)  output only the list of data models for a subject
                    else output the full JSON object as in `official_list_data_models.json` 
    Returns:
       if subject is found
         if names_only
            array of strings: data models' names belonging to the subject
         else
            dict of properties(full JSON object as in `official_list_data_models.json` )  about the subject
       if subject is not found
         False
    """

I will be happy to use suggestions or push this as a PR?

albertoabellagarcia commented 2 years ago

What you mean is something that is also on the debate. Should we include the official list of data models? I would say yes. Then why is it not here? Because we were creating the package and more important because we do not have feedback requesting that. Your feedback is important and therefore I guess that we should include it. Additionally other of my main concerns about the package is how to maintain the connections with the official list and repository because it is 'continuously' (2-3 days) being updated.

albertoabellagarcia commented 1 year ago

this link is the official list pointing to the repositories

albertoabellagarcia commented 1 year ago

We have just published the pysmartdatamodels with two new functions inspired by your requests to get the repo of a data model and the repo of a subject. The source code is released as well. thanks