Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Visualized" tab ignores id even when @context aliases id to @id; only accepts literal @id #848

Open
trwnh opened this issue Nov 18, 2024 · 3 comments

Comments

@trwnh
Copy link

trwnh commented Nov 18, 2024

Given a document such as this for input:

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/multikey/v1",
    "https://w3id.org/security/suites/secp256k1-2019/v1"
  ],
  "alsoKnownAs": [
    "at://atproto.com"
  ],
  "id": "did:plc:ewvi7nxzyoun6zhxrhs64oiz",
  "service": [
    {
      "id": "#atproto_pds",
      "serviceEndpoint": "https://enoki.us-east.host.bsky.network",
      "type": "AtprotoPersonalDataServer"
    }
  ],
  "verificationMethod": [
    {
      "controller": "did:plc:ewvi7nxzyoun6zhxrhs64oiz",
      "id": "did:plc:ewvi7nxzyoun6zhxrhs64oiz#atproto",
      "publicKeyMultibase": "zQ3shunBKsXixLxKtC5qeSG9E4J5RkGN57im31pcTzbNQnm5w",
      "type": "Multikey"
    }
  ]
}

The JSON-LD Playground's "Visualized" tab renders with blank nodes instead of using the actual identifiers.

image

Changing all 3 instances of id to @id seems to fix it.

image

@davidlehn
Copy link
Member

Yeah, I'm not sure what it should do here, but that behavior is poor. This code hasn't been touched probably since it was first added. Patches welcome, but the code base is difficult to work with and waiting on someone (me?) to refactor it to be easier to update.

@trwnh
Copy link
Author

trwnh commented Nov 19, 2024

I think it should recognize id as an alias of @id right? But I understand if the whole thing needs more work.

@davidlehn
Copy link
Member

The general case is that until you process the data with the contexts you don't know what id maps to or what maps to @id. id to @id is a common convention, but not required. Visualizing the expanded form or N-Quads would be easier, but may be lower level than what people wanted to see. There's plenty of room for improved tooling in this area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants