• Post Reply Bookmark Topic Watch Topic
  • New Topic

how do I convert json to json-ld  RSS feed

 
john hog
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to make a call to a service that expects json-ld, and I only have json. What is the process in order to convert json to json-ld. Given that I have the context the service uses, say www.example.com/test/core.json-ld and www.example.com/test2/core.json-ld,
is there some library magic that will just accept json and context as a parameter and spit out json-ld?

From what I have been reading, it seems very possible to convert json > json-ld, I am still new to this and can't seem to find an easy solution. It sounds like all the json needs is a context, but I am still unsure of how to do this.

I want something like

{
"id": 1,
"name": "A green door",
"price": 12.50,
}

to be

{
@context{
test : www.example.com/test/core.json-ld
test2 : www.example.com/test2/core.json-ld
}
"id": 1,
"test:name": "A green door",
"test2:price": 12.50,
}
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Googled for "json-ld" and found http://json-ld.org/ which has links at the bottom to implementations for various programming languages, among which a Java library: https://github.com/jsonld-java/jsonld-java

Maybe that will be useful.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!