标签: json-ld

大规模查询 JSON-LD

大规模数据架构的问题当然是一个很大的话题,我远非专家。但是,我对如何大规模使用 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

6
推荐指数
1
解决办法
999
查看次数

使用 Circe 将字段添加到 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做到这一点。官方文档中的例子主要是讲修改值,但没有实际添加字段等。

scala json-ld circe

6
推荐指数
2
解决办法
2816
查看次数

JSON-LD“@id”可以用于链接到另一个网页上描述的项目吗?

我正在尝试正确有效地使用 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)

schema.org json-ld

6
推荐指数
1
解决办法
1898
查看次数

具有多个 Facebook 目录变体的产品的 JSON-LD 微数据

我进行了搜索和搜索,但找不到 JSON-LD 架构微数据的示例,该示例将使我的 Facebook 目录识别具有多个变体(例如 T 恤)的产品的所有变体。到目前为止,我已经尝试了这些实现变体的方法:

  • 具有一系列产品的 ProductGroup(在“hasVariant”ProductGroup 属性内)
  • 提供一系列优惠的产品
  • 一系列产品

通过所有这些方法,我只能让 Facebook 识别出一种产品。有谁知道如何为具有多个变体的产品编写 Facebook JSON-LD 微数据,或者我可以在哪里找到这样的示例?谢谢!

microdata facebook-opengraph json-ld facebook-marketing-api

6
推荐指数
1
解决办法
551
查看次数

LD JSON里面的Javascript

我想知道是否可以在ld + json脚本中执行一些javascript.例如"window.location.hostname"

<script type="application/ld+json">
{
   "@context": "http://schema.org",
   "@type": "WebSite",
   "url": "http://" + window.location.hostname
}
</script>
Run Code Online (Sandbox Code Playgroud)

javascript json json-ld

5
推荐指数
1
解决办法
3047
查看次数

Gmail无法识别JSON-LD

我正在尝试测试Gmail在HTML邮件中处理嵌入式JSON-LD的功能,以便在收件箱视图中显示相关操作,此处将介绍其介绍.我已向自己发送了一条消息(使用Python API),我希望Gmail能够呈现我的View Action,此处显示一个示例.然而,一切都没有发生.我期待看到"查看文件"的链接,类似于将为航班预订显示的链接等.

我试图了解我的特定JSON-LD内容是否存在问题,或者我是否尝试执行不受支持的操作.嵌入的相关JSON-LD段<body>是:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "CreativeWork",
  "@id": "http://my-site.com/file/1",
  "additionalType": "http://www.productontology.org/id/Computer_file",
  "name": "My File",
  "description": "View this file",
  "url": "http://my-site.com/file/1",
  "action": {
    "@type": "ViewAction",
    "url": "http://my-site.com/file/1",
    "name": "View File"
  }
}
</script>
Run Code Online (Sandbox Code Playgroud)

如果电子邮件编码的方式存在问题,这里是原始格式(个人信息编辑)

Received: from 874510238733-ktbae5ftk223du75th86q0uua7i7rp5v.apps.googleusercontent.com
    named unknown
    by gmailapi.google.com
    with HTTPREST;
    Fri, 6 Mar 2015 14:54:52 -0800
Content-Type: multipart/alternative;
 boundary="===============5111695568485418487=="
MIME-Version: 1.0
to: ****@gmail.com
subject: A file has been shared to your email
Date: Fri, 6 Mar …
Run Code Online (Sandbox Code Playgroud)

schema.org google-schemas json-ld

5
推荐指数
0
解决办法
542
查看次数

JSON-LD自定义上下文

我正在做一些关于JSON-LD的研究.我发现上下文在每个例子中都使用了一些公共模式站点.我可以用自己的吗?

从:

{
   "@context":{
       "name": "http://schema.org/name"
   }
}
Run Code Online (Sandbox Code Playgroud)

至:

{
   "@context":{
       "name": "http://my-site.com/name"
   }
}
Run Code Online (Sandbox Code Playgroud)

json-ld

5
推荐指数
1
解决办法
636
查看次数

JSON-LD框架具有可选属性?

如何在JSON-LD上下文中将某些属性定义为"可选"?

我创建了问题的简单示例.这是JSON-LD Playground中的相同示例.这是示例数据:

{
  "@context": {
    "ex": "http://example.org/ex#",
    "foaf": "http://xmlns.com/foaf/0.1/",
    "frapo": "http://purl.org/cerif/frapo/",
    "owl": "http://www.w3.org/2002/07/owl#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "xsd": "http://www.w3.org/2001/XMLSchema#"
  },
  "@graph": [
    {
      "@id": "ex:Organization_1",
      "@type": "foaf:Organisation",
      "foaf:member": [
        {
          "@id": "ex:Person_1"
        },
        {
          "@id": "ex:Person_2"
        }
      ],
      "frapo:funds": [
        {
          "@id": "ex:Project_1"
        },
        {
          "@id": "ex:Project_2"
        }
      ]
    },
    {
      "@id": "ex:Person_2",
      "@type": "foaf:Person",
      "foaf:currentProject": {
        "@id": "ex:Project_2"
      },
      "foaf:name": "Jack"
    },
    {
      "@id": "ex:Project_2",
      "@type": "foaf:Project",
      "foaf:name": "Small project 2"
    },
    {
      "@id": …
Run Code Online (Sandbox Code Playgroud)

rdf embedding json-ld

5
推荐指数
1
解决办法
301
查看次数

JSON-LD框架单个对象数组

有没有办法强制单个对象到数组?每次测试对象类型真的很烦人.

我试过这个上下文,但它不起作用.在JSON-LD Playground中也有例子.使用此上下文,资源将转换为单个对象,而不是包含一个对象的数组,如您所料.

{
  "@context": {
    "member": {
      "@id": "http://xmlns.com/foaf/0.1/member",
      "@container": "@list"
    },
    "ex": "http://example.org/ex#",
    "foaf": "http://xmlns.com/foaf/0.1/",
    "owl": "http://www.w3.org/2002/07/owl#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "frapo": "http://purl.org/cerif/frapo/"
  },
  "@type": "foaf:Organisation",
  "member": []
}
Run Code Online (Sandbox Code Playgroud)

结果:

 ... {
      "@id": "ex:Organization_1",
      "@type": "foaf:Organisation",
      "foaf:member": {
        "@id": "ex:Person_1",
        "@type": "foaf:Person",
        "foaf:name": "Bill"
      }
    } ...
Run Code Online (Sandbox Code Playgroud)

应该是什么:

"foaf:member": [{ "@id": ... }]
Run Code Online (Sandbox Code Playgroud)

arrays json-ld

5
推荐指数
1
解决办法
1001
查看次数

@id与用于链接JSON-LD节点的URL

我已经在主页上定义OrganizationWebSite节点上定义了发布者,现在我想从其他页面上的文章链接到该发布者.但是,我也希望链接到它WebSite,@id如果我遵循使用URL作为的建议,他们自然会共享相同的内容@id.

{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "@id": "http://www.example.com/",
    "url": "http://www.example.com/",
    ...
    "publisher": {
        "@type": "Organization",
        "@id": "http://www.example.com/",  <-- duplicated
        "url": "http://www.example.com/"
    }
}
Run Code Online (Sandbox Code Playgroud)
{
    "@context": "http://schema.org",
    "@type": "WebPage",
    "@id": "http://www.example.com/news",
    "url": "http://www.example.com/news",
    "isPartOf": {
        "@id": "http://www.example.com/"  <-- site or publisher?
    }
    ...
    "publisher": {
        "@id": "http://www.example.com/"  <-- site or publisher?
    }
}
Run Code Online (Sandbox Code Playgroud)

我假设每个节点的ID必须是唯一的,那么是否有一个最佳实践来统一ID,例如添加哈希?

{
    "@id": "http://www.example.com/#site",
    ...
    "publisher": {
        "@id": "http://www.example.com/#publisher",
    }
}
Run Code Online (Sandbox Code Playgroud)

如果可行的话,处理器(谷歌)会加载@id以查找节点的其余属性吗?

与此相关的是,url在许多节点类型中发现的属性是假设@id …

url uri schema.org json-ld

5
推荐指数
1
解决办法
3852
查看次数