data-models icon indicating copy to clipboard operation
data-models copied to clipboard

Error in "location" when generating a random example

Open silviasdfg opened this issue 1 year ago • 4 comments

When I generate a random example of a WasteContainer entity using ngsi_ld_example_generator from pysmartdatamodels, the type of "location" is set to "Property" instead of "GeoProperty"

silviasdfg avatar Feb 07 '24 11:02 silviasdfg

That's very good point, let us check it out

albertoabellagarcia avatar Feb 16 '24 08:02 albertoabellagarcia

did you use it in pysmartdatamodels package or in the online service?

albertoabellagarcia avatar Feb 16 '24 08:02 albertoabellagarcia

by the comment I guess it is in pysmartdatamodels

albertoabellagarcia avatar Feb 16 '24 08:02 albertoabellagarcia

yes, I was using the pysmartdatamodels package

silviasdfg avatar Feb 19 '24 10:02 silviasdfg

Your error could be possible if you are running and old version of the pysmartdatamodels, you have two options:

  1. run the function sdm.update_data(). This function retrieves last version of the data about the data models that possibly fixes your need (takes some minutes, be patient, it downloads the full database)
  2. update to the last version 0.7.1 of the package

Let me suggest you to make a test with this code before and after updating with 1) or 2) . Possibly the error would appear before updating and will disappear afterwards.

from pysmartdatamodels import pysmartdatamodels as sdm

result = sdm.ngsi_ld_example_generator("https://raw.githubusercontent.com/smart-data-models/dataModel.WasteManagement/master/WasteContainer/schema.json") print(result) with open("payload.json", "w") as file: json.dump(result, file, indent=2)

albertoabellagarcia avatar May 08 '24 12:05 albertoabellagarcia