Is this related to

http://stackoverflow.com/questions/39062352/how-to-get-http-response-header-in-apache-jena-during-calling-method-filemanager

You can make the HTTP call yourself, do what you want with the headers, then pass the inputstream for the response to RIOT.

Alternatively, the library Jena uses, java-jdsonld, may be able to help you.

-----

It does seem to be a bit of an anti-pattern of the web that having HTTP headers used by different modules makes using libraries rather hard.

        Andy

On 23/08/16 14:40, Ganesh Kumar wrote:
Hi,

We are working on writing Hypermedia clients for our APIs using
JSON-LD+Hydra.
We are using Jena to get most of the heavy lifting.

I am new to Jena and just getting hold of the reins at the moment.

The JSON-LD spec provides option for defining the context in a separate
link header (Refer:
https://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)
Hydra also supports similar structure (since it is implemented over
JSON-LD) for supporting API documentation. This also helps in reducing the
payload size.

The parser that is in-built in JSON-LD doesn't seem to read the 'Link'
header in the document and build a context. Please correct me if I am wrong.
I couldn't find an easy way to access the headers through Jena, unless I
make a second call using HttpOp() or hack HttpOp() writing an additional
method to access the required headers.
If Link headers have to be used to interpret the context, can you suggest
me an appropriate way to do this.

Secondly, I could not find support for additional techniques like Json web
tokens. (http://jwt.io) which also requires a write option to the HTTP
Headers.
And sending any custom headers to the server is also another issue that I
am looking to solve.

My questions:
1. How do I handle Link headers in building JSON-LD context?
2. Is there a better way to handle the headers problem without making a
second HEAD call to the URL
3. Is there a way to write custom headers to Jean's ARQ request?

It would be helpful if you can point me to the right resource to get this
done. Thank you.

Regards,
Ganesh


Reply via email to