You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though the specification states that the EntityMap should be in plain json, it makes use of the json-ld specific keyword @type, making it invalid json. To fix this, use type (without the @) instead of @type.
I may be wrong here, so push back if so. But I don't think @type is actually invalid JSON. The @ character is perfectly legal in a string key and any conformant parser will swallow it without complaint.
The real question is a different one: the file borrows a JSON-LD convention without declaring a @context, which is admittedly a bit odd. Whether that matters depends on what we want this format to be.
As I see it, there are four options, including doing nothing:
Document the intent. State clearly that @type is a deliberate JSON-LD borrow for semantic clarity, with no full JSON-LD compliance implied. Job done.
Go the whole way. Add a @context and make it properly JSON-LD-compliant. Opens up graph tooling, but adds complexity.
Rename to type. Clean break from JSON-LD, plain JSON field. Simpler, but loses the semantic signal.
Leave it alone. It works, developers recognise it, nothing is actually broken.
Option 4 is probably the path of least resistance, but I can see a case for option 1 just to close down this kind of confusion. Interested in what others think.
I guess it all depends on how strict you want/need the json file to be. You're correct to state that an @ may be used in a key string, nevertheless there are situations where it can cause issues, depending on the strictness of the consuming party/API (I've seen my fair share of scripts/APIs crashing on @'s used in keys).
If it were up to me I'd go for option (3), but that's because I generally go by the rule: "It's better to be strict than sorry", especially since it can be really difficult to change things after a protocol/standard has been adopted.
Activity
DixonJones commentedon May 29, 2026
I may be wrong here, so push back if so. But I don't think
@typeis actually invalid JSON. The@character is perfectly legal in a string key and any conformant parser will swallow it without complaint.The real question is a different one: the file borrows a JSON-LD convention without declaring a
@context, which is admittedly a bit odd. Whether that matters depends on what we want this format to be.As I see it, there are four options, including doing nothing:
@typeis a deliberate JSON-LD borrow for semantic clarity, with no full JSON-LD compliance implied. Job done.@contextand make it properly JSON-LD-compliant. Opens up graph tooling, but adds complexity.type. Clean break from JSON-LD, plain JSON field. Simpler, but loses the semantic signal.Option 4 is probably the path of least resistance, but I can see a case for option 1 just to close down this kind of confusion. Interested in what others think.
jvandriel commentedon Jun 1, 2026
I guess it all depends on how strict you want/need the json file to be. You're correct to state that an
@may be used in a key string, nevertheless there are situations where it can cause issues, depending on the strictness of the consuming party/API (I've seen my fair share of scripts/APIs crashing on @'s used in keys).If it were up to me I'd go for option (3), but that's because I generally go by the rule: "It's better to be strict than sorry", especially since it can be really difficult to change things after a protocol/standard has been adopted.