General JSON-LD question about external context files

Hi all,

I've been digging into all the JSON-LD specs to make sure that I understand all the possibilities of using an external context file. I have two questions about this. Please not that I am not trying to start a discussion, I just want to make sure if I understood it correct and can start looking for another solution :-)

Image I have the following plain JSON. I have no influence on this, only on the external JSON-LD context file.

{
    "results": [
        {
            "id": 1,
            "title": "Event 1"
        },
        {
            "id": 2,
            "title": "Event 2"
        }
    ]
}

Question 1) "id": "@id" won't work, because "id" is an integer instead of a string. Event when using "@base" : "http://my.example.com/events/" this doesn't work. Is it correct that there currently isn't a way to 'map' these things using an external context file?

Question 2) I want the items in the "results" array to be of the type "http://my.example.com/Event". Is it correct that I cannot achieve this without inserting "@type" :  "http://my.example.com/Event" within each item in the plain JSON, thus cannot achieve this using an external context file?

Any confirmation would be appreciated. Thanks in advance!

Dimitri 		 	   		  

Received on Wednesday, 4 November 2015 08:25:39 UTC