{"id":10360,"date":"2024-05-15T09:32:49","date_gmt":"2024-05-15T07:32:49","guid":{"rendered":"https:\/\/smartdatamodels.org\/?p=10360"},"modified":"2024-05-15T12:16:11","modified_gmt":"2024-05-15T10:16:11","slug":"examples-of-code-associated-to-every-data-model","status":"publish","type":"post","link":"https:\/\/smartdatamodels.org\/index.php\/examples-of-code-associated-to-every-data-model\/","title":{"rendered":"Examples of code associated to every data model"},"content":{"rendered":"<p>In order to make easier the use of the Smart Data Models now in every repository in GitHub there is a new directory named &#8216;code&#8217; that contains for the python code using the pysmartdatamodels\u00a0 for the architecture in the image below.<\/p>\n<p>The idea is a code that fills several attributes of the data model with suitable values and insert them into a context broker installed by default.<\/p>\n<p>The code for installing an instance of the context broker is also included as comments in the header of the code<\/p>\n<p>The code is generated automatically (like most of what we do)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10361\" src=\"https:\/\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/code_example_architecture.png\" alt=\"\" width=\"377\" height=\"447\" srcset=\"https:\/\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/code_example_architecture.png 377w, https:\/\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/code_example_architecture-253x300.png 253w, https:\/\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/code_example_architecture-295x350.png 295w, https:\/\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/code_example_architecture-127x150.png 127w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<p>You can see an example of this code here<\/p>\n<p><a href=\"https:\/\/github.com\/smart-data-models\/dataModel.Transportation\/blob\/master\/EVChargingStation\/code\/code_for_using_dataModel.Transportation_EVChargingStation.py\">https:\/\/github.com\/smart-data-models\/dataModel.Transportation\/blob\/master\/EVChargingStation\/code\/code_for_using_dataModel.Transportation_EVChargingStation.py<\/a><\/p>\n<p>Of course there could be many things that could be improved and extended. Let us know in this <a href=\"mailto:info@smartdatamodels.org\">mail account<\/a> or in the usual <a href=\"https:\/\/smartdatamodels.org\/index.php\/support\/\">support channels<\/a>.<\/p>\n<p>In the future if there are interest we could create also in other languages. Please <a href=\"https:\/\/smartdatamodels.org\/index.php\/support\/\">let us know<\/a> if you have interest on this possibility.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to make easier the use of the Smart Data Models now in every repository in GitHub there is a new directory named &#8216;code&#8217; that contains for the python code using the pysmartdatamodels\u00a0 for the architecture in the image below. The idea is a code that fills several attributes&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/smartdatamodels.org\/index.php\/examples-of-code-associated-to-every-data-model\/\">More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[105,107,109,113,115,119,117,88,143,111,125,182,201],"tags":[],"class_list":["post-10360","post","type-post","status-publish","format-standard","hentry","category-cross-sector","category-smart-cities","category-smart-energy-domain","category-smart-environment","category-smart-manufacturing","category-smart-robotics","category-smart-water","category-smart-sensoring","category-smartaeronautics","category-smart-agrifood","category-smartdestinations","category-smarthealth","category-smartlogistics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":9213,"url":"https:\/\/smartdatamodels.org\/index.php\/simple-but-useful-programs-to-interact-with-a-broker-in-php\/","url_meta":{"origin":10360,"position":0},"title":"Simple but useful programs to interact with a broker in PHP","author":"maestro","date":"13\/07\/2023","format":false,"excerpt":"We have released two very simple programs to create an entity in a context broker and for removing an entity based on its id. Although this is pretty straight forward, being coded in PHP allows you to integrate with, in example, in a WordPress site. In fact these programs are\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12623,"url":"https:\/\/smartdatamodels.org\/index.php\/new-testing-process-in-progress-were-you-can-contribute-your-code\/","url_meta":{"origin":10360,"position":1},"title":"New testing process in progress were you can contribute your code","author":"maestro","date":"06\/02\/2025","format":false,"excerpt":"Current test process for new and extended data models In order to approve a new data model a test needs to be passed. It cold be accessed in the 3rd option in the tools menu at the front page: Pro: it is currently working Con: It is mostly created in\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2776,"url":"https:\/\/smartdatamodels.org\/index.php\/release-of-software-for-smart-data-models-initiative\/","url_meta":{"origin":10360,"position":2},"title":"Release of software for Smart Data Models Programs","author":"maestro","date":"28\/06\/2021","format":false,"excerpt":"According to the last open session, the script for the creation of the model.yaml file (see this example) file which is present in every data model has been released. It is a python 3.6 script you can access in the utils directory of the program. source code available.","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7671,"url":"https:\/\/smartdatamodels.org\/index.php\/release-source-code-for-some-of-the-services-for-python-developers\/","url_meta":{"origin":10360,"position":3},"title":"Release source code for some of the services. For python developers.","author":"maestro","date":"22\/11\/2022","format":false,"excerpt":"In the tools option of the main menu, there are a few services to help you to use, create and debug your data models. Although working, some of these services are limited. We are releasing the code for some of the services to allow you to contribute with improvments. It\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2022\/11\/python-logo-master-v3-TM-flattened-300x101.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2818,"url":"https:\/\/smartdatamodels.org\/index.php\/source-code-for-generating-ngsi-ld-key-values-examples-based-on-smart-data-models-released\/","url_meta":{"origin":10360,"position":4},"title":"Source code for generating NGSI-LD key values examples based on Smart Data Models released","author":"maestro","date":"05\/07\/2021","format":false,"excerpt":"According to the last open session, the script for the creation of the examples of the NGSI-LD key values is available for review and use with an open license. It is a python 3.6 script you can access in the utils directory of the initiative. Source code available","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10356,"url":"https:\/\/smartdatamodels.org\/index.php\/new-version-of-pysmartdatamodels-python-package-0-7-1\/","url_meta":{"origin":10360,"position":5},"title":"New version of pysmartdatamodels python package 0.7.1","author":"maestro","date":"07\/05\/2024","format":false,"excerpt":"The changes in this new version are: - Including new function validate_dcat_ap_distribution_sdm - Updating the comments of most of the functions - Some code improvements by jilin.he@fiware.org - Included a new directory with templates for the creation of a data model. Not used yet but next version they will be\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/pysmartdatamodels_0.7.1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/10360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/comments?post=10360"}],"version-history":[{"count":3,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/10360\/revisions"}],"predecessor-version":[{"id":10364,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/10360\/revisions\/10364"}],"wp:attachment":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/media?parent=10360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/categories?post=10360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/tags?post=10360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}