Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 365
Jerome Avatar asked Sep 23 '10 10:09

Jerome


2 Answers

JSON-LD might help :

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

like image 147
redben Avatar answered Sep 23 '22 03:09

redben


JSON Schema might be the right thing for this:

http://json-schema.org/

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

like image 29
Russ Clarke Avatar answered Sep 21 '22 03:09

Russ Clarke