4

I want to convert JSON file into JSON-LD.

Can anyone tell me, what are the procedures/steps should be done to do that?

or

Is there any tools for doing that conversion done?

Thanks

Saiful Islam
  • 124
  • 2
  • 14
  • I would suggest you "Be clear" i mean in which language you are trying to do? Have u tried so far? Any sample JSON & Sample JSON-LD? – SHEKHAR SHETE Dec 19 '14 at 11:20
  • I definitely prefer java and I have a JSON file.Now my task is to convert it into JSON-LD as prerequisites to publishing LINKED data. I also have a vocabulary. – Saiful Islam Dec 19 '14 at 15:05

1 Answers1

3

In most cases, the only thing you need to do is to create a JSON-LD context and add it to your JSON documents. You can either embed it directly or put it in a different file and simply reference it. Depending on the structure of your JSON documents and the vocabulary you are using, you might need to change the JSON slightly. Typicall this involves adding identifiers in the form of URLs to your JSON objects (@id) and restructuring it to match the way the vocabulary is modelled.

If you are looking for tools, I'd suggest to have a look at https://github.com/antoniogarrote/json-ld-macros

Hope this helps. As others already pointed out, the more information you provide, the better answers you'll get.

Markus Lanthaler
  • 3,683
  • 17
  • 20
  • I am trying to learn and apply JSON-LD into my project. The JSON oject I am working with, I am posting a small portion of it in the following comment. I am not sure, which vocabulary I need to use to convert this JSON into JSON-LD. and Thanks for reply. – Saiful Islam Jan 08 '15 at 15:34
  • {"ID": 31395, "UUID": "D53928E2-4E17-4C68-95C4-E05055B5CEF0", "ParentChargePointID": null, "DataProviderID": 1, "DataProvider": { "WebsiteURL": "http://openchargemap.org", "Comments": null, "DataProviderStatusType": { "IsProviderEnabled": true, "ID": 1, "Title": "Manual Data Entry" }, "IsRestrictedEdit": false, "IsOpenDataLicensed": true, "IsApprovedImport": true, "License": "Licensed under Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)", ...... } – Saiful Islam Jan 08 '15 at 15:35
  • For full JSON file ... http://api.openchargemap.io/v2/poi/ right now, I am confused about vocabulary. I am not sure, which vocabulary I need to use for converting this JSON into JSON-LD. – Saiful Islam Jan 08 '15 at 16:12
  • 1
    @SaifulIslam There are many vocabularies, here I have compiled a list from which you can choose: http://vanthome.github.io/rest-api-essay-presentation/rest_apis.html#39 – vanthome Jan 20 '15 at 11:48
  • 1
    You probably won't find a vocabulary which *exactly* represents your internal datastructure. No one could have anticipated what you've come up with. You can thus either create your own vocabulary or try to combine existing vocabularies. I quite like http://lov.okfn.org to search for vocabularies – Markus Lanthaler Jan 22 '15 at 00:04