On 13/08/14 21:29, Jim Balhoff wrote:
On Aug 13, 2014, at 4:19 PM, Andy Seaborne <[email protected]> wrote:


Jim,

Thanks for trying.  It's probably a question for jsonld-java
directly. Jena is using jsonld-java and maybe the writer is being
too simplistic.  If there improvements, then I'm very willing to
add them but when I tried various options, I didn't get nicer
output at the time.  Maybe I was missing something as well.

I think it's all a little more complex than I initially realized, but
I know a bit more about JSON-LD now. :-) It seems like the way to
manipulate the structure of the produced JSON-LD is via framing:

http://json-ld.org/spec/latest/json-ld-framing/

It might be nice for Jena to allow the user to provide a frame when
writing JSON-LD.

Agreed.

The way to get information from the application is in Jena's "Context" object (unrelated to JSON-LD's "@context"). The application is going to have to be aware of JSON-LD details and maybe jsonld-java details but I don't see that as avoidable.

Proposal:

Additional context keys:

jsonldContext
  - value: the object expected for JsonLdProcessor.compact

jsonldFraming -
  - value: the object expected for JsonLdProcessor.frame

if jsonldFraming is set
Then
    JsonLdProcessor.frame
else
    JsonLdProcessor.compact with jsonldContext.

Do you have an example (data, @context, frame) to use a development use case?

        Andy


However in my case I wanted some triples to be
serialized in the reverse direction, using the "@reverse" keyword (I
have lots of triples with different subjects but the same object).
But I don't think @reverse is handled yet in the framing algorithm:

https://github.com/json-ld/json-ld.org/issues/311

Best regards, Jim


        Thanks
        Andy


Reply via email to