Re: How to assign metadata to a schema that is not complete in markup

37 views
Skip to first unread message
Message has been deleted

Martin Hepp

unread,
Sep 15, 2011, 5:53:04 AM9/15/11
to schemaorg-...@googlegroups.com
You can use meta or link attributes for this

e.g.

<link itemprop="url" href="http://www.acme-bagels.com/" />

Note that you can (should) use a closing / for link, but not for <meta>, which does the same for values that are not URIs.


> Hello,
>
> I have a case like follows:
>
>
> <div class="avatarcontainer" itemscope="" itemtype="http://schema.org/
> Organization">
> <div class="teamPerson">
> <img src="../images/context/team/team.jpg">
> <p itemprop="name" class="teamName">glücklich des Christoph Steiner</
> p>
> <div itemprop="address" itemscope="" itemtype="http://schema.org/
> PostalAddress">
> <p itemprop="streetAddress" class="teamPhone">Schlachthofstraße 9a</
> p>
> <p class="teamPhone"><span itemprop="postalCode">I-39100</span> <span
> itemprop="addressLocality">Bozen (BZ) Italia</span></p>
> <p class="teamPhone"></p><a itemprop="email"
> href="mailto:in...@gluecklich.it">in...@gluecklich.it</a>
> <p itemprop="telephone" class="teamPhone">+39 0471 974989</p>
> </div>
> </div>
> </div>
>
> I would like to add a "image" property. Unfortunatley, the image
> specified in the markup is not the company logo [which is what i want
> to insert], due to a design decision. How can i go ahead and add this
> metadata in an appropiate way?
> Must i specify all of this in the header OR is there a way to add in
> properties that will not be visible in the browser? [for example by
> setting display: none via CSS] Do google/yahoo/bing penalize this
> "attempted cloaking" of data?
>
> Thanks for your opinions.

--------------------------------------------------------
martin hepp
e-business & web science research group
universitaet der bundeswehr muenchen

e-mail: he...@ebusiness-unibw.org
phone: +49-(0)89-6004-4217
fax: +49-(0)89-6004-4620
www: http://www.unibw.de/ebusiness/ (group)
http://www.heppnetz.de/ (personal)
skype: mfhepp
twitter: mfhepp

Check out GoodRelations for E-Commerce on the Web of Linked Data!
=================================================================
* Project Main Page: http://purl.org/goodrelations/
* Quickstart Guide for Developers: http://bit.ly/quickstart4gr
* Vocabulary Reference: http://purl.org/goodrelations/v1
* Developer's Wiki: http://www.ebusiness-unibw.org/wiki/GoodRelations
* Examples: http://bit.ly/cookbook4gr
* Presentations: http://bit.ly/grtalks
* Videos: http://bit.ly/grvideos

Philip Jägenstedt

unread,
Sep 15, 2011, 11:03:40 AM9/15/11
to schemaorg-...@googlegroups.com
On Thu, Sep 15, 2011 at 11:53, Martin Hepp <mfh...@gmail.com> wrote:
> You can use meta or link attributes for this
>
> e.g.
>
>    <link itemprop="url" href="http://www.acme-bagels.com/" />
>
> Note that you can (should) use a closing / for link, but not for <meta>, which does the same for values that are not URIs.

Actually, only <link> is valid for specifying a URL property. So says
the spec: "If a property's value, as defined by the property's
definition, is an absolute URL, the property must be specified using a
URL property element."

I'm not sure which closing / you mean, but the URL will be resolved so
it need not include a trailing / while the trailing / in the tag
itself is only needed for XHTML, not HTML.

--
Philip Jägenstedt

Martin Hepp

unread,
Sep 18, 2011, 1:04:17 PM9/18/11
to schemaorg-...@googlegroups.com
Hi Philipp:

On Sep 15, 2011, at 5:03 PM, Philip Jägenstedt wrote:

> On Thu, Sep 15, 2011 at 11:53, Martin Hepp <mfh...@gmail.com> wrote:
>> You can use meta or link attributes for this
>>
>> e.g.
>>
>> <link itemprop="url" href="http://www.acme-bagels.com/" />
>>
>> Note that you can (should) use a closing / for link, but not for <meta>, which does the same for values that are not URIs.
>
> Actually, only <link> is valid for specifying a URL property. So says
> the spec: "If a property's value, as defined by the property's
> definition, is an absolute URL, the property must be specified using a
> URL property element."

Yes, thanks for stressing that.


>
> I'm not sure which closing / you mean, but the URL will be resolved so
> it need not include a trailing

There are two issues here:
For referring to the identifier of a value (e.g. http://schema.org/InStock), it does matter whether you attach a trailing slash or not.
You must write the URI in exactly the same way as it is specified; otherwise, a meta-data parser will not understand the data unless it applies some data cleansing heuristics that go beyond the standard.

So from the data perspective,

http://schema.org/InStock

and

http://schema.org/InStock/

are two different identifiers and only the correct one can be assumed to be understood by consuming client.

So the sloppy usage of trailing slashes in URIs in the past should be avoided in future Microdata usages.

Whether an HTTP server will serve a document or redirect the client or return a 404 error when you request http://schema.org/InStock/ while it should be http://schema.org/InStock is a completely different issue at the HTTP protocol level.

A good server will likely point you to the correct URI.

> / while the trailing / in the tag
> itself is only needed for XHTML, not HTML.

That is what I was actually referring to. Even if it is needed only in XHTML, I personally think closing elements properly as in XML makes a lot of sense, even though it may not be mandatory from a HTML perspective, simply because it helps see the tree of elements during development and debugging.

>
> --
> Philip Jägenstedt

Philip Jägenstedt

unread,
Sep 19, 2011, 9:50:16 AM9/19/11
to schemaorg-...@googlegroups.com
On Sun, Sep 18, 2011 at 19:04, Martin Hepp <mfh...@gmail.com> wrote:
> Hi Philipp:
> On Sep 15, 2011, at 5:03 PM, Philip Jägenstedt wrote:
>
>> On Thu, Sep 15, 2011 at 11:53, Martin Hepp <mfh...@gmail.com> wrote:
>>> You can use meta or link attributes for this
>>>
>>> e.g.
>>>
>>>    <link itemprop="url" href="http://www.acme-bagels.com/" />
>>>
>>> Note that you can (should) use a closing / for link, but not for <meta>, which does the same for values that are not URIs.
>>
>> Actually, only <link> is valid for specifying a URL property. So says
>> the spec: "If a property's value, as defined by the property's
>> definition, is an absolute URL, the property must be specified using a
>> URL property element."
> Yes, thanks for stressing that.
>>
>> I'm not sure which closing / you mean, but the URL will be resolved so
>> it need not include a trailing
>
> There are two issues here:
> For referring to the identifier of a value (e.g. http://schema.org/InStock), it does matter whether you attach a trailing slash or not.
> You must write the URI in exactly the same way as it is specified; otherwise, a meta-data parser will not understand the data unless it applies some data cleansing heuristics that go beyond the standard.
>
> So from the data perspective,
>
> http://schema.org/InStock
>
> and
>
> http://schema.org/InStock/
>
> are two different identifiers and only the correct one can be assumed to be understood by consuming client.
>
> So the sloppy usage of trailing slashes in URIs in the past should be avoided in future Microdata usages.

Yes, itemtype is treated as an opaque identifier, so URLs must be both
absolute and normalized in the same way. However, itemid and any URLs
used as property values (which was the case here) are resolved, so
they need neither be absolute URLs or be normalized in any particular
way.

>> / while the trailing / in the tag
>> itself is only needed for XHTML, not HTML.
>
> That is what I was actually referring to. Even if it is needed only in XHTML, I personally think closing elements properly as in XML makes a lot of sense, even though it may not be mandatory from a HTML perspective, simply because it helps see the tree of elements during development and debugging.

That is fine, as long as it is clear that it is a matter of style, not
actually required by the HTML syntax.

--
Philip Jägenstedt

Peter Sefton

unread,
Sep 22, 2011, 8:19:50 PM9/22/11
to schemaorg-...@googlegroups.com
On Fri, Sep 16, 2011 at 1:03 AM, Philip Jägenstedt <phi...@foolip.org> wrote:

Actually, only <link> is valid for specifying a URL property. So says
the spec: "If a property's value, as defined by the property's
definition, is an absolute URL, the property must be specified using a
URL property element."
 
Philip Jägenstedt

Bit <link> is only allowed in the <head>. There is an example of it used in the <body> in the metadata spec but that's not valid HTML5 as far as I can tell. This is quite a problem for trying to use URIs as property values - the only alternative is an empty <a> element.

Peter Sefton.

--

Peter Sefton +61410326955 p...@ptsefton.com http://ptsefton.com
Gmail, Twitter & Skype name: ptsefton


Martin Hepp

unread,
Sep 23, 2011, 5:34:08 AM9/23/11
to schemaorg-...@googlegroups.com
Hi all:

As far as I know the usage of link and meta in the HTML body is now legal in HTML5 if you use it with Microdata/itemprop.
I do not have a reference at hand, but there was a lengthy discussion on this earlier this year.

Martin

--------------------------------------------------------

Philip Jägenstedt

unread,
Sep 23, 2011, 7:16:54 AM9/23/11
to schemaorg-...@googlegroups.com
On Fri, Sep 23, 2011 at 02:19, Peter Sefton <ptse...@gmail.com> wrote:
>
>
> On Fri, Sep 16, 2011 at 1:03 AM, Philip Jägenstedt <phi...@foolip.org>
> wrote:
>>
>> Actually, only <link> is valid for specifying a URL property. So says
>> the spec: "If a property's value, as defined by the property's
>> definition, is an absolute URL, the property must be specified using a
>> URL property element."
>>
>>
>> Philip Jägenstedt
>
> Bit <link> is only allowed in the <head>. There is an example of it used in
> the <body> in the metadata spec but that's not valid HTML5 as far as I can
> tell. This is quite a problem for trying to use URIs as property values -
> the only alternative is an empty <a> element.
> Peter Sefton.

Both <link> [1] and <meta> [2] are allowed where phrasing content is
allowed if the itemprop attribute is present.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-link-element
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-meta-element

--
Philip Jägenstedt

Reply all
Reply to author
Forward
0 new messages