w3c / json-ld-syntax

JSON-LD 1.1 Specification
https://w3c.github.io/json-ld-syntax/
Other
112 stars 22 forks source link

Mixing graph id-s and node id-s in the example No. 155 #261

Closed iherman closed 4 years ago

iherman commented 4 years ago

Example 116 has the following structure (referring to named graph indexes:

  "@context": {
    "@version": 1.1,
    "graphMap": {
      "@id": "http://example.org/graphMap",
      "@container": ["@graph", "@id"]
    }
  },
  "graphMap": {
    "http://manu.sporny.org/about#manu": {
      "@id": "http://manu.sporny.org/about#manu",
      ...
    },
    "https://greggkellogg.net/foaf#me": {
      "@id": "https://greggkellogg.net/foaf#me",
      ...
    }
  }

Resulting in TriG graphs of the form:

<http://manu.sporny.org/about#manu> {
  <http://manu.sporny.org/about#manu> a foaf:Person;
     ...
}

Which is, functionally, of course correct. But it somehow gives the impression that the name of the graph and the id of the topmost node are expected to be identical. They are not, these are two different notions. In fact, I would think it is a bad practice to do so. My proposal is to do something like:

  "@context": {
    "@version": 1.1,
    "graphMap": {
      "@id": "http://example.org/graphMap",
      "@container": ["@graph", "@id"]
    }
  },
  "graphMap": {
    "http://manu.sporny.org/about#foafGraph": {
      "@id": "http://manu.sporny.org/about#manu",
      ...
    },
    "https://greggkellogg.net/foaf#foafGraph": {
      "@id": "https://greggkellogg.net/foaf#me",
      ...
    }
  }

instead.

gkellogg commented 4 years ago

Closed via #270.