2010-07-01 63 views
5

我对产品信息的RDFa实施的噩梦深陷其中,我很好奇如果有人能提供一些见解。产品的RDFa内容实施

为了向机器提供数据,谷歌不再隐瞒信息,除非它是针对机器的信息。为了提供这些数据,我找不到有关空白元素的任何信息。

如果你看看商业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> 

我发现了什么在执行有趣 - 这百思买已经取得了巨大成功使用的 - 就是没有在标签没有实际内容在这里,而有只是一个内容属性。

我的问题是,有没有人有任何洞察到这种类型的实现,是否有利用内容属性通过添加RDFa结构到现有标记的空div结构罚款?

回答

6

即“snippet style”中的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模板使用GoodRelations在RDFa的,尽管各自的文档类型的标准化的不同状态。下面是正确的DOCTYPE设置:

  1. XHTML: 一)设置DOCTYPE为XHTML + RDFa的1.0: b)设置HTML版本属性为XHTML + RDFa1.0

  2. HTML5 一)设置DOCTYPE的HTML b)组HTML版本属性为HTML + RDFa1.1

请注意,在这个阶段只是一个W3C工作草案,但应该继续工作。

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

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

+1

谢谢马丁, 我的下一个问题然后就是: 我们怎么能告诉谷歌寻找的RDFa标记我们的页面上,如果我们使用HTML5? – S16 2010-07-02 15:42:23

0

重新HTML5,你只需要使用RDFa 1.1RDFa Lite,他们是在HTML5有效。您将例如必须将您的xmlns:转换为使用prefix属性。