digitalbazaar / jsonld.js

A JSON-LD Processor and API implementation in JavaScript
https://json-ld.org/
Other
1.66k stars 195 forks source link

Handle term definition on `@type` with empty map. #369

Closed davidlehn closed 4 years ago

davidlehn commented 4 years ago

Fixes expand#tec02 & toRdf#tec02.

@gkellogg "keyword redefinition" was not what I expected for this type of error. Is that more appropriate than the more generic "invalid term definition"?

gkellogg commented 4 years ago

Fixes expand#tec02 & toRdf#tec02.

@gkellogg "keyword redefinition" was not what I expected for this type of error. Is that more appropriate than the more generic "invalid term definition"?

It's "keyword redefinition" as that is the case for any attempt to change a keyword, other than specific carve-outs for @type. One could argue for "invalid term definition", but it's not a term, and it's a bit late to change the spec.