Skip to content

Question about good practice for @id #7

@cristianvasquez

Description

@cristianvasquez

Hello,

I'm looking at this document: https://json-ld.org/spec/latest/json-ld-api-best-practices/

Where Best Practice 8, "Identify objects with a unique identifier," says:

'Entities described in JSON objects often describe web resources having a URL; entity descriptions SHOULD use an identifier uniquely identifying that entity. In this case, using the resource location as the identity of the object is consistent with this practice.'

This mechanism allows a client to follow, without effort, links to other entities in the Web.

But sometimes @id have a context on it like in:

{
  "@context": {
    ...
    "image": { "@id": "schema:image", "@type": "@id"},
    ...
  }
}

In this case, the client needs to be smart enough to build the URL to follow links.

Question: could be considered a good practice to provide URLs in @id when possible?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions