How do you parse a JSON structure such as this
"properties": {
"/base/pinball/pinball_machine_basis/pinball_machines": {
"expected_type": {
"id": "/base/pinball/pinball_machine",
"text": "Pinball Machine"
},
"text": "Pinball Machines",
"values": [
{
"id": "/m/026z8cp",
"text": "The Lord of the Rings",
"url": "http://www.freebase.com/view/m/026z8cp"
}
]
},
"/common/topic/article": {
"expected_type": {
"id": "/common/document",
"text": "Document"
},
"text": "article",
"values": [
{
"id": "/m/025h5z",
"text": "",
"url": "http://www.freebase.com/view/m/025h5z"
}
]
},
"/common/topic/image": {
"expected_type": {
"id": "/common/image",
"text": "Image"
},
"text": "image",
"values": [
{
"id": "/m/029wvk4",
"text": "The Lord of the Rings: The Motion Picture Trilogy poster (2003)",
"url": "http://www.freebase.com/view/m/029wvk4"
},
{
"id": "/m/0bdyf3j",
"text": "",
"url": "http://www.freebase.com/view/m/0bdyf3j"
},
{
"id": "/m/0glyg_4",
"text": "lotr-extended-blu-ray.jpg",
"url": "http://www.freebase.com/view/m/0glyg_4"
}
]
},
I will not know in advance the high level names such as “/base/pinball/pinball_machine_basis/pinball_machines”, “/common/topic/article”, or “/exhibitions/exhibition_subject/exhibitions_created_about_this_subject”
i have tried Jackson but cannot see how to generate a java class that matches this structure. it apears to be an array but isnt surrounded with “[” or “]”.
the structure repeats “expected_type”, “text”, “values” etc. what am i missing?
Having hit a brick wall with this problem i contacted Tatu Saloranta
who was extremely helpful. with his help i managed to complete my Freebase Explorer Android Application. I have made my android application source code available in GITHUB if anyone is interested.
GITHUB source Code
The android application is also available here