我无法预先确定如何消除使用相同谓词的资源的歧义.我是RDF的新手,所以请原谅我的术语:我会试着用例子来解释我的意思.
我有一个Interview资源/模型与(简化)上下文,如下所示:
{
"id": {
"@id": "http://purl.org/dc/terms/identifier"
},
"interviewers": {
"@id": "http://purl.org/dc/terms/contributor",
"@type": "@id",
"@container": "@set"
},
"title": {
"@id": "http://purl.org/dc/terms/title"
},
"interviewees": {
"@id": "http://purl.org/dc/terms/contributor",
"@type": "@id",
"@container": "@set"
}
}
Run Code Online (Sandbox Code Playgroud)
我Interviewer和Interviewee资源有这样的情境:
{
"id": {
"@id": "http://purl.org/dc/terms/identifier"
},
"name": {
"@id": "info:repository/ive/name"
}
}
Run Code Online (Sandbox Code Playgroud)
然后我创建一个如下所示的资源:
{
"id": "06bad25f-83c1-4ee5-b055-0cb87d4c06be",
"interviewers": [
{
"id": "b0c262ce-7eb3-47f2-b212-a0e71cca0c92",
"name": "Somebody",
"@context": {
...
},
"@id": "urn:uuid:b0c262ce-7eb3-47f2-b212-a0e71cca0c92",
"@type": [
"http://id.loc.gov/vocabulary/relators/ivr"
]
}
],
"title": "Interview with So and So", …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Gmail"快速操作"在Gmail主题行中添加"转到操作",但每次邮件主题都没有操作链接.
这是我的邮件正文:
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "Check this out",
"action": {
"@type": "ViewAction",
"url": "https://www.youtube.com/watch?v=eH8KwfdkSqU"
}
}
</script>
</head>
<body>
<p>
This a test for a Go-To action in Gmail.
</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我解决问题吗?
我和JSON一样新.我知道JSON-LD和JSON Schema都用于验证JSON数据.然而,我找不到比较和对比两者的更多信息.
哪一个更好?
为什么用一个而不是另一个?
优点与劣势?
这两者甚至可以比较吗?
我误解了JSON-LD和JSON Schema是什么?
我目前已经构建了一个React应用。由于它是SPA,因此只有一个index.html文件。我想添加2个“ ld + json” script标签,即用于特定路线的评论和书签。
我已经将该script标签注入了componentDidMount该组件,但是Google结构化数据测试工具无法读取该标签。
是因为Google直接从index.html读取并且由于我的script标签被捆绑在main.js中,所以它无法读取它?
可以在客户端React中做到这一点吗?服务器端渲染是唯一可行的方法吗?
-详细说明----我目前想实现像IMDB这样的系统,即每当我们在goole中搜索电影时,IMDB搜索结果将在Google页面本身中显示电影的评级。为此,我需要将脚本放入index.html文件中
<script type='application/ld+json'>
{
"@context": "http://schema.org/",
"@type": "Review",
"itemReviewed": {
"@type": "Thing",
"name": "Name"
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "3",
"bestRating": "5"
},
"publisher": {
"@type": "Organization",
"name": "1234"
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
由于我的应用程序是SPA,因此无法将其放在主index.html文件中。
我当前的方法:假设“ / movies / inception”路由呈现“ MovieDetail”组件。因此,我目前正在将该脚本添加到该组件的末尾。
import React from 'react';
import JsonLd from '../path_to_JSONLD';
class MovieDetail extends React.Component {
render(){
let data = {
"@context": "http://schema.org/",
"@type": "Review",
"itemReviewed": {
"@type": …Run Code Online (Sandbox Code Playgroud) 我有一个简单的RDF文件,并希望将其转换为漂亮的嵌套JSON.
:b0 a <http://schema.org/Book> ;
<http://schema.org/name> "Semantic Web Primer (First Edition)" ;
<http://schema.org/offers> _:b1 ;
<http://schema.org/publisher> "Linked Data Tools" .
_:b1 a <http://schema.org/Offer> ;
<http://schema.org/price> "2.95" ;
<http://schema.org/priceCurrency> "USD" .
Run Code Online (Sandbox Code Playgroud)
应该成为
{
"type" : "Book",
"name" : "Semantic Web Primer (First Edition)",
"offers" : {
"type" : "Offer",
"price" : "2.95",
"priceCurrency" : "USD"
},
"publisher" : "Linked Data Tools"
}
Run Code Online (Sandbox Code Playgroud) 大规模数据架构的问题当然是一个很大的话题,我远非专家。但是,我对如何大规模使用 JSON-LD 感兴趣,因此请原谅缺乏特异性和高级问题。
显然,像谷歌这样的大玩家在谷歌知识图谱中加入了 JSON-LD。
以此为例,假设知识图谱中I/O的数据格式为JSON-LD,那么数据库是如何构建的,才能查询到如此海量的数据?它是否依赖于转换为 RDF 三元组以使用 SPARQL 进行查询,或者是否有其他架构可以以原始 JSON-LD 格式查询数据?有哪些技巧(如果有的话)可以大规模处理(和查询)JSON-LD?
MongoDB 或 Virtuoso(?) 等系统可用于管理大型 JSON 格式的数据并使其可查询,但是否需要将 JSON(-LD) 指定为数据的后端格式而不是 xml(如果人们希望使用某种 RDF)?
再次,为含糊不清而道歉。任何输入,例如关于该主题的一般指示或讨论,将不胜感激。
semantic-web semantic-markup nosql json-ld google-knowledge-graph
我有一堆JSON文件,数千种不同的模式.使用GenSON(Python JSON模式生成器),我设法为每个输入文件创建模式文件.现在,我想要做的是将所有这些不同的文件标准化为一个定义的模式.这是一个例子:
输入
{
"name": "Bob Odenkirk",
"title": "Software Engineer",
"location": {
"locality": "San Francisco",
"region": "CA",
"country": "United States"
},
"age": 62,
"status": "Active"
}
Run Code Online (Sandbox Code Playgroud)
产量
{
"names": ["Bob Odenkirk"],
"occupations": ["Software Engineer"],
"locations": ["San Francisco, CA"]
}
Run Code Online (Sandbox Code Playgroud)
本质上,我正在寻找一种语言无关的方法(即,我不关心使用什么编程语言)定义如何将输入JSON文件解析为输出JSON文件.
我正在阅读 circe 文档,但无法弄清楚如何处理以下问题。
我只想在主 JSON 对象中添加一个带有对象的字段。
{
Fieldalreadythere: {}
"Newfield" : {}
}
Run Code Online (Sandbox Code Playgroud)
我只想Newfield在对象中添加。为了提供一些上下文,我正在处理 Json-ld。我只想添加一个上下文对象。@context:{} 请参见下面的示例:
{
"@context": {
"@version": 1.1,
"xsd": "http://www.w3.org/2001/XMLSchema#",
"foaf": "http://xmlns.com/foaf/0.1/",
"foaf:homepage": { "@type": "@id" },
"picture": { "@id": "foaf:depiction", "@type": "@id" }
},
"@id": "http://me.markus-lanthaler.com/",
"@type": "foaf:Person",
"foaf:name": "Markus Lanthaler",
"foaf:homepage": "http://www.markus-lanthaler.com/",
"picture": "http://twitter.com/account/profile_image/markuslanthaler"
}
Run Code Online (Sandbox Code Playgroud)
我想添加上下文对象,仅此而已。
我怎么能用circe做到这一点。官方文档中的例子主要是讲修改值,但没有实际添加字段等。
我正在尝试正确有效地使用 schema.org json-ld 建议来向网页添加语义。
我有一个独特组织的网页(http://example/organization1):
{
"@context": "http://schema.org/",
"@type": "Organization",
"@id" : "#ID_Organization1",
"name": "Organization1",
"url": "https://myorganization1.com
}
Run Code Online (Sandbox Code Playgroud)
我可以在另一个页面上重复使用该组织的信息而无需重新声明吗?( http://example/offers )
{
"@context": "https://schema.org/",
"@type": "Review",
"itemReviewed" : {
"@type" : "Organization",
"@id" : "http://example/organization1#ID_Organization1"
},
}
Run Code Online (Sandbox Code Playgroud) 我进行了搜索和搜索,但找不到 JSON-LD 架构微数据的示例,该示例将使我的 Facebook 目录识别具有多个变体(例如 T 恤)的产品的所有变体。到目前为止,我已经尝试了这些实现变体的方法:
通过所有这些方法,我只能让 Facebook 识别出一种产品。有谁知道如何为具有多个变体的产品编写 Facebook JSON-LD 微数据,或者我可以在哪里找到这样的示例?谢谢!
json-ld ×10
json ×3
rdf ×2
schema.org ×2
circe ×1
gmail ×1
java ×1
javascript ×1
microdata ×1
nosql ×1
rdf4j ×1
reactjs ×1
ruby ×1
scala ×1
semantic-web ×1