How to implement Schema.org properties in meta data?
Schema.org describes how to implement object properties using the meta
tag but the examples given are properties with primitive types such as Text
or Boolean
. Let's say I want to display a grid of images and each image is of type ImageObject
. The copyrightHolder
property itself is either an Organization
or Person
. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden span
s or div
s.
html schema.org microdata
add a comment |
Schema.org describes how to implement object properties using the meta
tag but the examples given are properties with primitive types such as Text
or Boolean
. Let's say I want to display a grid of images and each image is of type ImageObject
. The copyrightHolder
property itself is either an Organization
or Person
. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden span
s or div
s.
html schema.org microdata
add a comment |
Schema.org describes how to implement object properties using the meta
tag but the examples given are properties with primitive types such as Text
or Boolean
. Let's say I want to display a grid of images and each image is of type ImageObject
. The copyrightHolder
property itself is either an Organization
or Person
. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden span
s or div
s.
html schema.org microdata
Schema.org describes how to implement object properties using the meta
tag but the examples given are properties with primitive types such as Text
or Boolean
. Let's say I want to display a grid of images and each image is of type ImageObject
. The copyrightHolder
property itself is either an Organization
or Person
. If I want to include the organization legal name, how would I do that using only meta data?
With "regular" HTML elements I would write:
<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<span itemprop="legalName">ACME Inc.</span>
</span>
This obviously doesn't look right:
<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc.">
</meta>
The only thing that comes into mind is using a set of hidden span
s or div
s.
html schema.org microdata
html schema.org microdata
edited Nov 21 '18 at 11:27
unor
65.7k17138242
65.7k17138242
asked Nov 21 '18 at 10:44
smaressmares
401518
401518
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link
(withitemprop
) for values that are URLs
meta
(withitemprop
) for values that aren’t URLs
div
/span
(withitemscope
) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head
element (where div
/span
aren’t allowed), see this answer. If you only want to provide a few properties in the head
element, you can make use of the itemref
attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
add a comment |
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410354%2fhow-to-implement-schema-org-properties-in-meta-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link
(withitemprop
) for values that are URLs
meta
(withitemprop
) for values that aren’t URLs
div
/span
(withitemscope
) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head
element (where div
/span
aren’t allowed), see this answer. If you only want to provide a few properties in the head
element, you can make use of the itemref
attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
add a comment |
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link
(withitemprop
) for values that are URLs
meta
(withitemprop
) for values that aren’t URLs
div
/span
(withitemscope
) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head
element (where div
/span
aren’t allowed), see this answer. If you only want to provide a few properties in the head
element, you can make use of the itemref
attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
add a comment |
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link
(withitemprop
) for values that are URLs
meta
(withitemprop
) for values that aren’t URLs
div
/span
(withitemscope
) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head
element (where div
/span
aren’t allowed), see this answer. If you only want to provide a few properties in the head
element, you can make use of the itemref
attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:
link
(withitemprop
) for values that are URLs
meta
(withitemprop
) for values that aren’t URLs
div
/span
(withitemscope
) for items
So your example could look like this:
<div itemscope itemtype="http://schema.org/ImageObject">
<div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="legalName" content="ACME Inc." />
</div>
</div>
If you want to provide the whole structured data in the head
element (where div
/span
aren’t allowed), see this answer. If you only want to provide a few properties in the head
element, you can make use of the itemref
attribute.
That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).
answered Nov 21 '18 at 11:45
unorunor
65.7k17138242
65.7k17138242
add a comment |
add a comment |
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
add a comment |
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
add a comment |
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">
I was reading Getting Started again and noticed 2b that states
When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.
So I assume it would be fine to just use
<meta itemprop="copyrightHolder" content="ACME Inc.">
answered Nov 21 '18 at 11:06
smaressmares
401518
401518
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
add a comment |
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
1
1
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder).
– unor
Nov 21 '18 at 11:54
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53410354%2fhow-to-implement-schema-org-properties-in-meta-data%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown