The data models available for python developers. pysmartdatamodels 0.5.40 published. Beta version.

Now you can find in pypi.org the python package pysmartdatamodels with 13 functions for the integrators of the data models (more than 800) in external systems and applications. It is a beta version. There is a function, update_data() that whenever is run, it updates the data models to the last version (including adding the new data models). The code is available at the utils directory.
This python package includes all the data models and several functions (listed below) to use in your developments.

If you want to be updated on this package you can join this mailing list (Announcements are sent only when something relevant happens). We love to get your feedback at info@smartdatamodels.org

There are several online tools to manage and to create the data models, generate examples or to adapt to existing ontologies. See the tools menu option at the home site.

Functions available include:

1- List all data models. Function list_all_datamodels()
2- List all subjects. Function list_all_subjects()
3- List the data models of a subject. Function datamodels_subject(subject)
4- List description of an attribute. Function description_attribute(subject, datamodel, attribute)
5- List data-type of an attribute. Function datatype_attribute(subject, datamodel, attribute)
6- Give reference model for an attribute. Function model_attribute(subject, datamodel, attribute)
7- Give reference units for an attribute. Function attributes_datamodel(subject, datamodel)
8- List the attributes of a data model. Function attributes_datamodel(subject, datamodel)
9- List the NGSI type (Property, Relationship or Geoproperty) of the attribute. Function ngsi_datatype_attribute(subject, datamodel, attribute)
10- Print a list of data models attributes separated by a separator. Function print_datamodel(subject, datamodel, separator, meta_attributes)
11- Returns the link to the repository of a subject. Function subject_repolink(subject)
12- Returns the links to the repositories of a data model name. Function datamodel_repolink(datamodel)
13- Update the official data model list or the database of attributes from the source. Function update_data()

Roadmap

1.- Create a proper documentation

2.- Function to allow submission of improvements (i.e. missing recommended units or model) and comments to the different data models. Currently, you can do it by searching for your data model here
https://smartdatamodels.org/index.php/list-of-data-models-3/ visiting the github repo and making your PR or raising your issues there.
3.- Function to submit a new data model to an incubation repository. Currently, this is done manually incubated repository. By filling this form you are granted to contribute with new data models.
4.- Include new functions like search for the subject of a data model or other that you can suggest to us at info@smartdatamodels.org

### some example code
from pysmartdatamodels import pysmartdatamodels as sdm
subject = "dataModel.Weather"
dataModel = "WeatherForecast"
attribute = "precipitation"
print(sdm.list_all_datamodels())
print(sdm.list_all_subjects())
print(sdm.datamodels_subject("dataModel.Weather"))
print(sdm.description_attribute(subject, dataModel, attribute))
print(sdm.datatype_attribute(subject, dataModel, attribute))
print(sdm.model_attribute(subject, dataModel, attribute))
print(sdm.units_attribute(subject, dataModel, attribute))
print(sdm.attributes_datamodel(subject, dataModel))
print(sdm.subject_repolink(subject))
print(sdm.datamodel_repolink(dataModel))
print(sdm.print_datamodel(subject, dataModel, ",", ["property", "type", "dataModel", "repoName", "description", "typeNGSI", "modelTags", "format", "units", "model"]))
sdm.update_data()
Bookmark the permalink.

Comments are closed.