gpt4 book ai didi

xml - 产品的 RDFa 内容实现

转载 作者:数据小太阳 更新时间:2023-10-29 01:56:19 26 4
gpt4 key购买 nike

我深陷产品信息的 RDFa 实现的噩梦中,我很好奇是否有人可以提供一些见解。

Google 断言不会仅仅为了向机器提供数据而隐藏信息,除非它是特定于机器的信息。不过,为了提供此数据,我找不到有关具有空元素的主题的任何信息。

如果您查看用于商业的 GoodRelations RDFa 生成器,您会看到一堆嵌套的 div,它们被告知要放在商品页面的底部。例如,我将使用我最喜欢的网站之一:

<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:gr="http://purl.org/goodrelations/v1#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">

<div typeof="gr:Offering" about="#offering">
<div rev="gr:offers" resource="#company"></div>
<div property="rdfs:label" content="Alpinestars S-MX Plus Racing Boots" xml:lang="en"></div>
<div property="rdfs:comment" content="Alpinestars’ S-MX Plus racing boot raises performance and safety to new and unmatched levels with its innovative design, structural protection and comfort." xml:lang="en"></div>
<div property="gr:hasEAN_UCC-13" content="0000000000000" datatype="xsd:string"></div>
<div rel="foaf:depiction" resource="http://www.motorcycle-superstore.com/ProductImages/300/g17268.jpg"></div>
<div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
<div rel="gr:hasPriceSpecification">
<div typeof="gr:UnitPriceSpecification">
<div property="gr:hasCurrency" content="USD" datatype="xsd:string"></div>
<div property="gr:hasCurrencyValue" content="349.95" datatype="xsd:float"></div>
<div property="gr:hasUnitOfMeasurement" content="C62" datatype="xsd:string"></div>
</div>
</div>
<div rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#PayPal"></div>
<div rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#AmericanExpress"></div>
<div rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#Discover"></div>
<div rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#MasterCard"></div>
<div rel="gr:acceptedPaymentMethods" resource="http://purl.org/goodrelations/v1#VISA"></div>
<div rel="foaf:page" resource="http://www.motorcycle-superstore.com/1/1/36/77/ITEM/Alpinestars-S-MX-Plus-Racing-Boots.aspx"></div>
</div>
</div>

我在他们的实现中发现有趣的地方——百思买已经成功地使用了它——这里的标签中没有实际内容,而只有一个内容属性。

那么我的问题是,有没有人对这种类型的实现有任何见解,使用空的 div 结构是否会受到惩罚,该结构利用 content 属性而不是将 RDFa 结构添加到现有标记?

最佳答案

这是“代码段样式”中的 RDFa。完整的论点和背景在这里

http://www.ebusiness-unibw.org/tools/rdf2rdfa/

这里:

赫普,马丁;加西亚,罗伯托; Radinger, Andreas:RDF2RDFa:将 RDF 转换为用于复制和粘贴的片段,技术报告 TR-2009-01,2009 年。PDF 在上面页面的底部。

基本上,在 a) 为数据标记重用可见内容和 b) 关注点分离之间存在权衡。只要可见内容的数据结构和标记组织几乎 1:1 匹配,您就可以轻松地以传统风格使用 RDFa。但是,在丰富的元数据建模上强制执行可见标记的结构会产生困惑的标记,难以维护,容易出错。

祝福

马丁赫普

补充:您可以在 XHTML、HTML5 和 HTML4 模板的 RDFa 中使用 GoodRelations,尽管各个 DOCTYPE 的标准化状态不同。以下是正确的 DOCTYPE 设置:

  1. XHTML:a) 将 DOCTYPE 设置为 XHTML+RDFa 1.0:b) 将 html 版本属性设置为 XHTML+RDFa1.0

  2. HTML5a) 将 DOCTYPE 设置为 html b) 设置html版本属性为HTML+RDFa1.1

请注意,这只是现阶段的 W3C 工作草案,但应该仍然有效。

  1. 其他 HTML 标记使用 HTML5 配方或简单地将 html 版本属性设置为 HTML+RDFa1.1 或 XHTML+RDFa1.0。大多数客户端将从这种类型中提取 RDF。要么

另见: http://answers.semanticweb.com/questions/1187/can-i-use-the-html5-doctype-with-rdfa

关于xml - 产品的 RDFa 内容实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3160149/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com