Importing .json files into Tropy

Hi! I have downloaded images and photos using an API. I loaded the images into Tropy. Someone now made a schema that fits the API: GitHub - RISE-UNIBAS/crowdtangle-api-schema: Simple ontological representation of the CrowdTangle API to be used in a Tropy template

How can I now import the json files into Tropy? They all look like this:
Thank you!

{
“platformId”: “100058190614517_506085618007788”,
“platform”: “Facebook”,
“date”: “2022-10-02 07:54:35”,
“updated”: “2022-10-03 20:07:51”,
“type”: “photo”,
“message”: “Good luck to everyone running in the #LondonMarathon today. Let me know in the comments if you are a constituent of Erith and Thamesmead and taking part! #WeRunTogether”,
“expandedLinks”: [
{
“original”: “Redirecting...”,
“expanded”: “Redirecting...
}
],
“link”: “Redirecting...”,
“postUrl”: “Good luck to... - Abena Oppong Asare MP, Erith and Thamesmead | Facebook”,
“subscriberCount”: 1887,
“score”: -20.0,
“media”: [
{
“type”: “photo”,
“url”: “https://scontent-sea1-1.xx.fbcdn.net/v/t39.30808-6/310338316_506085324674484_4810506304451741347_n.jpg?stp=dst-jpg_s720x720&_nc_cat=110&ccb=1-7&_nc_sid=8024bb&_nc_ohc=c2lACDk9UpIAX-kYAik&_nc_ht=scontent-sea1-1.xx&oh=00_AT_7hdC7IwOy_g6Ygb_CSD8WOiRTRQhGgFEBmIIWhtJY9w&oe=633EA0FB”,
“height”: 720,
“width”: 629,
“full”: “https://scontent-sea1-1.xx.fbcdn.net/v/t39.30808-6/310338316_506085324674484_4810506304451741347_n.jpg?stp=dst-jpg_s720x720&_nc_cat=110&ccb=1-7&_nc_sid=8024bb&_nc_ohc=c2lACDk9UpIAX-kYAik&_nc_ht=scontent-sea1-1.xx&oh=00_AT_7hdC7IwOy_g6Ygb_CSD8WOiRTRQhGgFEBmIIWhtJY9w&oe=633EA0FB
}
],
“statistics”: {
“actual”: {
“likeCount”: 1,
“shareCount”: 0,
“commentCount”: 0,
“loveCount”: 0,
“wowCount”: 0,
“hahaCount”: 0,
“sadCount”: 0,
“angryCount”: 0,
“thankfulCount”: 0,
“careCount”: 0
},
“expected”: {
“likeCount”: 9,
“shareCount”: 2,
“commentCount”: 3,
“loveCount”: 3,
“wowCount”: 0,
“hahaCount”: 0,
“sadCount”: 2,
“angryCount”: 1,
“thankfulCount”: 0,
“careCount”: 2
}
},
“account”: {
“id”: 11188122,
“name”: “Abena Oppong Asare MP, Erith and Thamesmead”,
“handle”: “AbenaOppongAsareMP”,
“profileImage”: “https://scontent-sea1-1.xx.fbcdn.net/v/t39.30808-1/273043231_353909263225425_4382072501344548951_n.jpg?stp=cp0_dst-jpg_p50x50&_nc_cat=103&ccb=1-7&_nc_sid=05dcb7&_nc_ohc=vF6GCN9R334AX99-i06&_nc_ht=scontent-sea1-1.xx&oh=00_AT8yQLAjg58l_o23mIlDF06k-9t3oZ3AO4i-5HL0sKuVzQ&oe=633FA75B”,
“subscriberCount”: 1888,
“url”: “Redirecting...”,
“platform”: “Facebook”,
“platformId”: “100058190614517”,
“accountType”: “facebook_page”,
“pageAdminTopCountry”: “GB”,
“pageDescription”: “Abena Oppong-Asare is the Labour MP for Erith and Thamesmead”,
“pageCreatedDate”: “2019-10-23 11:58:23”,
“pageCategory”: “POLITICIAN”,
“verified”: false
},
“languageCode”: “en”,
“legacyId”: 0,
“id”: “11188122|506085618007788”
}

To import many photos with full metadata into Tropy the JSON file needs to be using Tropy’s JSON item format. To see what this looks like you can export or copy/paste an existing Tropy item and look at the corresponding JSON data.

This means that you need to convert the JSON content above first. If this is more than a one off situation (e.g. you’d like to download more data from the API in question), then the best way to do this is using a plugin. We’re happy to help you set this up, but as a first step you need to review the JSON data and decide what information you want to import into Tropy and how you want the result to look like.

Looking at the data, you’d probably like to turn this into one item with one photo attached. And then you probably want to attach some of the additional data as metadata at either the item or photo level. One good approach to figure this out is to create this sample item by hand first. For example, you could open the link to the full photo (you’ll have to re-fetch it from the API because it’s currently expired) and drag the Photo/URL from the browser into Tropy. This should create the item and photo for you. Next, copy and paste all the relevant metadata fields into the metadata panel the way you’d expect the result to look. When you’re done, you can export the sample item as JSON-LD. Given these two JSON files it should be straightforward to create a suitable plugin to ingest similar data into Tropy.