Re: In-place hydra:Link

October 7 2014 9:16 AM, "Dietrich Schulten" <ds@escalon.de> wrote: 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> is it possible to express that an attribute is a hydra:Link inside a
> json object, without external context, either by saying so near a
> jsonld IRI like this:
> 
> {
> "@context" : {
> "@vocab" : "http://schema.org",
> }
> "@type": "Event",
> "name": "Walk off the Earth - REVO tour",
> "offers" : {
> "@id": "http://api.example.com/event/123/offers",
> "?": <-- say that this is to be dereferenced as hydra:Link
> }
> }
> 
> Or maybe in the context?
> 
> {
> "@context" : {
> "@vocab" : "http://schema.org",
> "offers" : "?" <-- say that the value of offers is a hydra:Link
> }
>

I don't think either can be done. Though you could include the representation of offers property next to the resource itself. Though this would be something non-standard to do.

[
  {
    "@context": { },
    "@type": "Event",
    "offers": "..."
  },
  {
    "@id:": "offers",
    "@type": "hydra:Link"
  }
]

This way your client could look at the retrieved document for link descriptions before trying to dereference them or the ApiDocumentation (as I described in me earlier mail).

However that's not something a generic client would do. In fact I would expect generic client to be confused if they got such a document in response.

Regards,
Tom

> 
> Best regards,
> Dietrich
> 
> - --
> Dietrich Schulten
> Escalon System-Entwicklung
> Bubenhalde 10
> 74199 Untergruppenbach
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (MingW32)
> 
> iEYEARECAAYFAlQzkxsACgkQuKLNitGfiZOUwQCg51k8XfVDTQB40rIXIIlNnpKh
> ot4AoLMglL+nbVEHtkVLtt59gNrYJ/F7
> =wFjd
> -----END PGP SIGNATURE-----

Received on Tuesday, 7 October 2014 07:27:45 UTC