简体   繁体   English

JSON到JSON-LD

[英]JSON to JSON-LD

I want to convert JSON file into JSON-LD. 我想将JSON文件转换为JSON-LD。

Can anyone tell me, what are the procedures/steps should be done to do that? 任何人都可以告诉我,这样做的程序/步骤是什么?

or 要么

Is there any tools for doing that conversion done? 是否有任何工具可以完成转换?

Thanks 谢谢

In most cases, the only thing you need to do is to create a JSON-LD context and add it to your JSON documents. 在大多数情况下,您唯一需要做的就是创建一个JSON-LD上下文并将其添加到您的JSON文档中。 You can either embed it directly or put it in a different file and simply reference it. 您可以直接嵌入它或将其放在不同的文件中,只需引用它即可。 Depending on the structure of your JSON documents and the vocabulary you are using, you might need to change the JSON slightly. 根据JSON文档的结构和您使用的词汇表,您可能需要稍微更改JSON。 Typicall this involves adding identifiers in the form of URLs to your JSON objects ( @id ) and restructuring it to match the way the vocabulary is modelled. 典型的这包括以URL的形式向JSON对象( @id )添加标识符,并重构它以匹配词汇表的建模方式。

If you are looking for tools, I'd suggest to have a look at https://github.com/antoniogarrote/json-ld-macros 如果您正在寻找工具,我建议您查看https://github.com/antoniogarrote/json-ld-macros

Hope this helps. 希望这可以帮助。 As others already pointed out, the more information you provide, the better answers you'll get. 正如其他人已经指出的那样,您提供的信息越多,您获得的答案就越好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM