加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml – 产品的RDFa内容实现

发布时间:2020-12-16 23:12:42 所属栏目:百科 来源:网络整理
导读:我是噩梦中的膝盖深处,这是产品信息的RDFa实施,如果有人能提供一些见解我很好奇. 谷歌表示,不是为了向机器提供数据而隐藏信息,除非它是特定于机器的信息.为了提供这些数据,我找不到任何有关空元素的信息. 如果你看一下商业的GoodRelations 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>

我觉得有趣的是它们的实现 – 百思买已经取得了巨大成功 – 是标签中没有实际内容,而只是内容属性.

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

解决方法

这是“片段样式”中的RDFa.充分论证&背景在这里

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

和这里:

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

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

最好的祝愿

马丁赫普

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

> XHTML:
a)将DOCTYPE设置为XHTML RDFa 1.0:

b)将html版本属性设置为XHTML RDFa1.0

> HTML5
a)将DOCTYPE设置为html
?
b)将html版本属性设置为HTML RDFa1.1

请注意,这只是现阶段的W3C工作草案,但应该可行.

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

要么

也可以看看:
http://answers.semanticweb.com/questions/1187/can-i-use-the-html5-doctype-with-rdfa

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读