Is This Proper Schema.org/Microdata Markup For A Building?
Solution 1:
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.
Solution 2:
I also had the same problem or question like you. Because my buildings are not even historical (when is a building historical?), I created my own schema:
{
"@context":
{
"Place": "http://schema.org/Place",
"name": "http://purl.org/dc/terms/title",
"alternateName":"http://purl.org/dc/terms/title",
"description": "http://purl.org/dc/terms/description",
"geo": "http://schema.org/geo",
"image":
{
"@id": "http://schema.org/image",
"@type": "@id"
},
"latitude":
{
"@id": "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
"@type": "xsd:decimal"
},
"longitude":
{
"@id": "http://www.w3.org/2003/01/geo/wgs84_pos#long",
"@type": "xsd:decimal"
},
"containedInPlace":"http://schema.org/Place",
"containsPlace":"http://schema.org/Place",
"architect":"http://schema.org/Creator",
"Address": "http://www.w3.org/2006/vcard/ns#Address",
"address": "http://www.w3.org/2006/vcard/ns#address",
"street": "http://www.w3.org/2006/vcard/ns#street-address",
"locality": "http://www.w3.org/2006/vcard/ns#locality",
"region": "http://www.w3.org/2006/vcard/ns#region",
"country": "http://www.w3.org/2006/vcard/ns#country",
"postalCode": "http://www.w3.org/2006/vcard/ns#postal-code",
"meter": "http://purl.org/measurement#meter",
"kilometer": "http://purl.org/measurement#kilometer",
"feet": "http://purl.org/measurement#feet",
"miles": "http://purl.org/measurement#miles",
"xsd": "http://www.w3.org/2001/XMLSchema#"
}
}
But I am not sure whether google or some other search services will get the idea. If you have any improvements or ideas to the schema let me know!
Post a Comment for "Is This Proper Schema.org/Microdata Markup For A Building?"