开发者

Namespaces in JSON

Is there such a 开发者_如何学运维thing as JSON namespaces, just like XML namespaces? Has anyone created a spec or libraries for this? Is this a good or a terrible idea?

I want to make a data spec that can be represented in XML as well as JSON. However I also need the namespace concept, that the data can be extended by annotations in different vocabularies.

To be more specific, this is about representing events. My schema will describe the event in basic terms (time and location), though if you think about it, events can be annotated with different information e.g. attendees or image URLs which I don't want to specify in my schema.


JSON-LD might help :

"JSON-LD (JavaScript Object Notation for Linking Data) is a lightweight Linked Data format that gives your data context."


JSON Schema might be the right thing for this:

http://json-schema.org/

Althought I don't know how well it's implemented.


This is quite an old thread, but there are JSON prefixes, which are almost like namespaces. If you are using Java server-side with Jettison, you can easily meet them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜