On Aug 12, 2014, at 10:20 AM, Andy Seaborne <[email protected]> wrote: > On 11/08/14 20:03, Jim Balhoff wrote: >> Hi, >> >> I am trying to output a Model as JSON-LD. It's working fine, but now >> I would like to make some changes to how the output is structured. >> For example, I'd like to define a @reverse property in the @context >> so that I can output certain triples in the reverse direction. Is it >> possible to influence the output of the JSON-LD writer? I have not >> found a way. >> >> Thank you, Jim >> > > Jena uses java-jsonld to do the JSON-LD reading and writing. If there is a > way to control java-jsonld to do that then it can be added (and I expect > there is - I just don't know what it is). There is a way to pass writer > specific configuration details. Currently, nothing is done but an obvious > feature is to pass in the context setup. > > The Jena apart of the JSON writer is in org.apache.jena.riot.out.JsonLDWriter > > Would you like to have a look?
Yesterday I spent some time looking at jsonld-java. I added some code to Jena so I could pass in a map for the context. This does get included in the JSON output @context but doesn't influence the way the data is structured. So far I don't see how to guide the output so that there is only one root object. I suspect I may be missing something that could be done with the "compact" or "frame" operations. Best regards, Jim
