JSON中的命名空间 [英] Namespaces in JSON

查看:77
本文介绍了JSON中的命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在诸如XML名称空间之类的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?

我想制作一个可以用XML以及JSON表示的数据规范.但是,我还需要命名空间概念,即可以通过不同词汇表中的注释来扩展数据.

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.

更具体地说,这是关于表示事件的.我的架构将以基本术语(时间和位置)描述事件,不过如果您考虑一下,事件可以用不同的信息来注释,例如我不想在架构中指定的与会者或图像URL.

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 可能会有所帮助:

"JSON-LD(用于链接数据的JavaScript对象表示法)是一种轻量级的链接数据格式,可为您提供数据上下文."

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

这篇关于JSON中的命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆