Import possibility of sources e.g. based on CSV file into objects #68
-
Hello, I'm currently trying to get an custom MOSP up and running, and I'm thinking about how to easily import structured data (e.g. CSV) into MOSP. Is there perhaps already a tool or something similar that I don't know exists? I am just wondering how it is possible to get source files in MOSP in the correct format? Many thanks and best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I had the same need some years ago, importing CSV data in MOSP. For this I simply used the API of MOSP with a simple script. You can see an example here: As you can see the script in its current definition will imports assets from a CSV file (assets.csv). The loop "for" simply creates the JSON file, then the content of the JSON file is sent with a HTML POST request to the API of MOSP. I hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi,
I had the same need some years ago, importing CSV data in MOSP. For this I simply used the API of MOSP with a simple script. You can see an example here:
https://github.com/NC3-LU/PyMOSP/blob/master/old/csv_to_mosp.py
As you can see the script in its current definition will imports assets from a CSV file (assets.csv).
You need to give the id of the validating schema and the if of the owning organization.
The loop "for" simply creates the JSON file, then the content of the JSON file is sent with a HTML POST request to the API of MOSP.
I hope this helps.