【发布时间】:2011-03-10 18:19:28
【问题描述】:
我深陷于产品信息的 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 结构是否会比将 RDFa 结构添加到现有标记中受到惩罚?
【问题讨论】:
标签: xml rdf xml-namespaces rdfa