【发布时间】:2020-04-25 09:11:17
【问题描述】:
如何用JSON-LD代替微数据来表达原始内容(不是一组分隔值)的语义?
假设这个 HTML+Microdata 片段变成了 HTML <body>:
<p itemscope itemtype="http://schema.org/Person">
<span itemprop="name">George Bush</span>, the
<span itemprop="disambiguatingDescription">44th President of the USA</span>.
</p>
如何将其微数据转换为 JSON-LD?
还假设我们可以使用多个 ID:
<p>
<span id="person1-name">George Bush</span>, the
<span id="person1-rule">44th President of the USA</span>.
</p>
...所以我想在 HTML <head> 中添加如下内容:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": { "@id": "#person1-name" },
"disambiguatingDescription": { "@id": "#person1-rule" }
}
</script>
是吗?也就是说,任何“Web语义解释器”工具都会接受这种相对的intralink引用,还是现在不实用(仅理论上)?
【问题讨论】: