Using hydra:Link

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have difficulty to express that an attribute is supposed to be a
hydra:Link.

The spec says I can define a Link in a separate json object like this:
{
  "@context": "http://www.w3.org/ns/hydra/context.jsonld",
  "@id": "http://api.example.com/vocab#comments",
  "@type": "Link".
}

I am not quite sure how that separate json object should be used.
I read the definition above like this:
- - use hydra as context
- - the canonical link of this json object is
"http://api.example.com/vocab#comments"
- - the type of this json object is Link
To me, that makes no sense. No comments term is defined and it does
not seem to say that the value of the comments term should be of type
Link.
Do I miss some idiom here or is there something wrong?

I would have expected it to be an external context which defines the
term comments, but wouldn't it then be something like:
{
  "@context": [
    "http://www.w3.org/ns/hydra/context.jsonld",
    {
      "comments": {
        "@id": "http://api.example.com/vocab#comments",
        "@type": "Link"
      }
    }
  ],
  "@id": "http://api.example.com/vocab.jsonld"
}

The spec continues that I can use the above definition for a comments
Link like this:

{
  "@context": {
    "comments": "http://api.example.com/vocab#comments"
  },
  "@id": "http://api.example.com/an-issue",
  "title": "An exemplary issue linking to its comments",
  "comments": { "@id": "http://api.example.com/an-issue/comments" }
}

I do not understand how the client would know that the former
definition of #comments as a Link applies to the latter usage. I do
not see that the client is advised to read the former json file or any
external context. How can it understand that the comments property
value is a Link?

Best regards,
Dietrich


- -- 
Dietrich Schulten
Escalon System-Entwicklung
Bubenhalde 10
74199 Untergruppenbach
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iEYEARECAAYFAlQzhtoACgkQuKLNitGfiZMiewCePoEh/Dr3g1CHL8C53OjQbiny
/V0An2ZvVBOSWkqkLT6upTjlJZghdEDU
=8+50
-----END PGP SIGNATURE-----

Received on Tuesday, 7 October 2014 06:24:08 UTC