w3resource

Schema.org Types and properties tutorial

 

Types and properties

In this page we have discussed (i) various supported data types and (ii) how different types (schemas) are organized and (iii) what are different types, text and URLs are expected to be.

Data Types

The following table describes various types of data supported by Schema.org :

Data Types Description
Boolean True or False.
Date A date value in ISO 8601 date format. According to this format, today (and this time) will be like following :
Date : 2024-12-15
Separate date and time in UTC: : 2024-12-15 18:00Z
Combined date and time in UTC : 2024-12-15T18:00Z
Date with week number : 2024-W50-12
Ordinal date : 2024-349
Number Specifies a number. Maybe a floating number (e.g. 21.56) or an integer (e.g. 87).
Text Specifies a text. It may be a URL (e.g. http://www.example.com/).

Schema.org offers a variety of types called as schemas and their properties to describe different types of content.

In this section of the tutorial, we will discuss all these in detail with lots of examples.

How schemas are organized

Schema.org organizes schemas in a hierarchy. This allows you to associate a schema with a content from a very broad perspective to a very specific one. The following discusses that.

Schemas

Thing

Thing is the most generic type available.

properties

Properties type Description
description Text Specifies a short description of an item.
image URL Specifies a URL of the image of an item.
name Text Specifies the name of an item.
url URL Specifies the URL of an item.

In the next level in the hierarchy, there are seven schemas. Each of which has more schemas. The following table gives a basic idea of these.

Schema Description
CreativeWork Specifies that the associated content is a creative work, for example, books, movies, photographs, software programs, etc.
Event Specifies that the associated content is an event happening at a certain time at a certain location.
Intangible Specifies that the associated content is about something intangible, like quantities, structured values, etc.
Organization Specifies that the associated content is about an organization like a School, a Club, a Corporate House etc.
Person Specifies that the associated content is about a person. He / she may be alive, dead or even fictional.
Place Specifies that the associated content is about a place. The place must be a fixed, physical entity.
Product Specifies that the associated content is about a product, anything which is sellable. For example a PC, an Apartment, A Car etc.

Expected Types, Text and URLs

Schema.org offers a guideline for what should be the Types, Text and URLs look like.

The more content you markup, it's better. But you should not markup anything which is not visible to your visitor. For example, if you have a piece of text as code documentation, which you have commented, that is not visible to your visitor, so it should not be marked up.

The value of the property can itself be an embedded item. But that is not mandatory. You can also have a child type embedded as expected type. For example, for a content, if the expected type is Event, you can use it's child type BusinessEvent if you find it appropriate.

Use 'url' property. See the code bellow :

<div itemscope itemtype="http://schema.org/CreativeWork">
<a href="https://www.w3resource.com/php/php-home.php" itemprop="url">PHP Tutorial</a>
</div>
<div itemscope itemtype="http://schema.org/CreativeWork">
<a href="https://www.w3resource.com/mysql/mysql-tutorials.php" itemprop="url">MySQL Tutorial</a>
</div>

Each entry links to an associated work. So 'url' property is used to link to that.

Previous: Schema.org Tutorial
Next: Schema.org CreativeWork Type tutorial

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/schema.org/types-and-properties.php