Home Ask Login Register

Developers Planet

Your answer is one click away!

jeff303 February 2016

Is JSON-LD compaction supposed to remove the at @ from @id and @type?

If you visit the JSON-LD playground page here, and click the "Person" example (which, as of this writing, is this), then the output of the compaction contains an attribute called "type", not "@type" which is what I would expect (since the latter corresponds to the JSON-LD type keyword).

What is it about the compaction algorithm that removes the at symbol from the type? If you click on the "Activity" example, the compacted result does contain "@type". Why is there a difference in processing these two inputs?


Markus Lanthaler February 2016

This is a feature called Keyword Aliasing. Schema.org recently added a keyword alias form @type to just type and @id to id to their context and that's why you set that. The compact tab of the person example uses Schema.org's context for the compaction.

Post Status

Asked in February 2016
Viewed 2,095 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life