2

schema.org を使用して一連の記事をフォーマットしたいのですが、記事は単なるテキストではありません。これらには、リンク、<em><strong>、およびその他の軽量マークアップが含まれています。textこれをプロパティに正しく配置するにはどうすればよいですか?

そこにマークアップを入れることだけを考えましたが、注釈付きの HTML 内にある場合は理にかなっています。

<div itemscope itemtype="http://schema.org/CreativeWork">
  <h1 itemprop="name">An example I just wrote</h1>
  <p itemprop="text">here's a <a href="http://example.com">link</a>, it's very <em>important</em></p>
</div>

しかし、これを JSONLD として保存する場合、テキストを HTML として解釈する必要があると仮定するのはかなり奇妙です。

{
  "@context": "http://schema.org",
  "@type": "CreativeWork",
  "name": "An example I just wrote"
  "text": "here's a <a href=\"http://example.com\">link</a>, it's very <em>important</em>"
}

Markdown で書いている可能性は十分にあります。

{
  "@context": "http://schema.org",
  "@type": "CreativeWork",
  "name": "An example I just wrote"
  "text": "here's a [link](http://example.com), it's very _important_"
}

または、同じ考えを表現できる他の言語。また、どの言語を使用しているかはかなり重要です。それは、テキストをどのように読むべきかを示しているからです。

4

1 に答える 1

2

使用した言語を明確にしたい場合は、値を入力できます。上記のスニペットを取得すると、rdf:HTML データ型を使用すると、次のようになります。

{
  "@context": "http://schema.org",
  "@type": "CreativeWork",
  "name": "An example I just wrote"
  "text": {
    "@value": "here's a <a href=\"http://example.com\">link</a>, it's very <em>important</em>",
    "@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML"
  }
}
于 2014-10-25T10:07:53.357 に答える