这是一个建筑物的适当的Schema.org/Microdata标记吗? [英] Is this proper Schema.org/Microdata markup for a building?

查看:88
本文介绍了这是一个建筑物的适当的Schema.org/Microdata标记吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的网站上添加Microdata符号(使用Schema.org),这个网站基本上是关于建筑物的。我一直在阅读很多内容,但我仍然无法找出在哪里使用 itemscope itemtype itemprop



有人可以告诉我这是不是Microdata / Schema.org标记,或者我是缺少的东西?

< div class =infobox infobox_buildingitemscope itemtype =http:/ /schema.org/LandmarksOrHistoricalBuildings\">

<! - 建筑物名称 - >
< h1 class =page_title>普恩特金角湾新城< / h1>

<! - 建筑师 - >
< div class =data_row architectitemscope itemtype =http://schema.org/creator>
< div class =tag cell> Arquitecto< / div>
< div class =value cell>
< a href =https://stage.wikiarquitectura.com/arquitecto/virlogeux-michel/itemprop =Person> Michel Virlogeux< / a>
< a href =https://stage.wikiarquitectura.com/arquitecto/kiran-hakan/itemprop =Person> HakanKıran< / a>
< / div>
< / div>

<! - 高度 - >
< div class =data_rowitemscope itemtype =http://schema.org/height>
< div class =tag cell> Altura< / div>
< div class =value cellitemprop =QuantitativeValue> 65m< / div>
< / div>

<! - 宽度 - >
< div class =data_rowitemscope itemtype =http://schema.org/width>
< div class =tag cell> Ancho< / div>
< div class =value cellitemprop =QuantitativeValue> 12.6m< / div>
< / div>

<! - - 位置 - >
< div class =data_rowitemprop =addressitemscope itemtype =http://schema.org/PostalAddress>
< div class =tag cell>Ubicación< / div>
< div class =value cellitemprop =streetAddress> Arap Cami Mahallesi,Beyoğlu/İstanbul,Turquía< / div>
< / div>

< / div> <! - 信息框 - >


解决方案

您似乎混淆了属性和类型。 >

在Microdata中,属性在 itemprop 属性中指定,而类型在 itemtype 属性。

如果您只使用词汇表Schema.org,则将为类型使用完整的URI( itemtype =http:// schema。 org / PostalAddress),而您只需使用slug作为属性( itemprop =address)。



在Schema.org中,很容易看出是什么,因为它们遵循约定,属性的第一个字母是小写字母( address ),而类型的第一个字母是大写字母( PostalAddress )。




句法,您正在使用地址 + PostalAddress 正确地执行此操作,但与创建者 + Person height / width + QuantitativeValue



也就是说,你也犯了一些词汇错误。 LandmarksOrHistoricalBuildings 类型不能有创建者也不是高度也不是一个 width 属性。



你可以通过访问( LandmarksOrHistoricalBuildings )并检查第一个表格。

I am trying to add Microdata notation (using Schema.org) to my website which basically talks about buildings. I’ve been reading a lot about it but I’m still having trouble figuring out where to use itemscope, itemtype and itemprop.

Can anybody tell me if this is good Microdata/Schema.org markup or if I’m missing something?

<div class="infobox infobox_building" itemscope itemtype="http://schema.org/LandmarksOrHistoricalBuildings">

    <!-- Building Name -->
    <h1 class="page_title">Puente Golden Horn Metro</h1>

    <!-- Architect -->
    <div class="data_row architect" itemscope itemtype="http://schema.org/creator">
        <div class="tag cell">Arquitecto</div>
        <div class="value cell">
            <a href="https://stage.wikiarquitectura.com/arquitecto/virlogeux-michel/" itemprop="Person">Michel Virlogeux</a>
            <a href="https://stage.wikiarquitectura.com/arquitecto/kiran-hakan/" itemprop="Person">Hakan Kıran</a>                                                  
        </div>
    </div>

    <!-- Height -->
    <div class="data_row" itemscope itemtype="http://schema.org/height">
        <div class="tag cell">Altura</div>
        <div class="value cell" itemprop="QuantitativeValue">65m</div>
    </div>

    <!-- Width -->
    <div class="data_row" itemscope itemtype="http://schema.org/width">
        <div class="tag cell">Ancho</div>
        <div class="value cell" itemprop="QuantitativeValue">12,6m</div>
    </div>

    <!-- Location -->
    <div class="data_row" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
        <div class="tag cell">Ubicación</div>
        <div class="value cell" itemprop="streetAddress">Arap Cami Mahallesi, Beyoğlu/İstanbul, Turquía</div>
    </div>

</div> <!-- infobox -->

解决方案

You seem to confuse properties and types.

In Microdata, properties get specified in the itemprop attribute, while types get specified in the itemtype attribute.

If you only use the vocabulary Schema.org, you’ll use the full URI for types (itemtype="http://schema.org/PostalAddress"), while you use just the slug for properties (itemprop="address").

In Schema.org, it’s easy to see what is what, because they follow the convention that the first letter of properties is lowercase (address), and the first letter of types is uppercase (PostalAddress).


Syntactically, you are doing it correctly with address+PostalAddress, but wrong with creator+Person and height/width+QuantitativeValue.

That said, you are also making some vocabulary errors. The LandmarksOrHistoricalBuildings type can’t have a creator nor a height nor a width property in the first place.

You can see which properties a type can have by visiting the type’s page (LandmarksOrHistoricalBuildings) and checking the first table.

这篇关于这是一个建筑物的适当的Schema.org/Microdata标记吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆