LaPhonso
LaPhonso

Reputation: 1

Errors for RDFa in my HTML example

I am new to programming and I'm working on writing RDFa in HTML. I know I'm close, but I've not getting validated at Structured Data Linter. I'm wondering if anyone with more experience may be able to identify my shortcomings.

SO = schema.org
DC - Dublin Core
GL - GoodLaPhonso (my own schema and not a real website yet)

<!DOCTYPE html>
<html>
<head>
<title>RDFa in HTML5</title>
</head>
<body>
<div vocab="http://schema.org/">
div vocab="http://schema.org/" typeof="product">
<a property="brand"=SO:brand="Coldwater Creek"</span></a>, 
<div>
Category: <span property="category">Moose</span>
</div>
<div>
 Color: <span property="color">Brass</span> 
</div>
<div>
Date Created: <span property="dateCreated">1996</span> 
 </div>
 <div>
 Image: <span property="image">Object</span>
 </div>
 <div>
 Location Created: <span property="locationCreated">Unknown</span>
</div>
<div>
<div vocab="http://purl.org/dc/elements/1.1/creator">
div vocab="http://purl.org/dc/elements/1.1/creator" typeof="creator">
Creator: <a property="creator">Unknown</a> 
</div>
<div>
<div vocab="http://purl.org/dc/elements/1.1/description">
div vocab="http://purl.org/dc/elements/1.1/description"  t
typeof="description">
Description: <a property="description">1996 brass moose ornament from Coldwater Creek.</a>
</div>
<div>
<div vocab="http://goodlaphonso.org">
div vocab="http://goodlaphonso.org" typeof=“ID">
Ornament ID: <a property=“ornamentid”>0</a>
</div>
<div>
Market Value: <a property=“marketValue">25 dollars</a>
</div>
<div>
Size:<span property=“size”>4 inches</span>
</div>
</body>
</html>

Upvotes: 0

Views: 81

Answers (1)

unor
unor

Reputation: 96587

You have several HTML errors.

Missing < (but some of these lines seem to be duplicated):

div vocab="http://schema.org/" typeof="product">

div vocab="http://purl.org/dc/elements/1.1/creator" typeof="creator">

div vocab="http://purl.org/dc/elements/1.1/description"  t
typeof="description">

div vocab="http://goodlaphonso.org" typeof=“ID">

Wrong quotation marks ( instead of "):

typeof=“ID"

property=“ornamentid”

property=“marketValue"

property=“size”

Wrong attributes:

=SO:brand="Coldwater Creek"

t

Closing span tag without opening tag:

 <a property="brand"=SO:brand="Coldwater Creek"</span></a>

About your RDFa

URIs are case-sensitive. So it has to be Product, not product.

As you are using multiple vocabularies, you may find it easier to use one prefix (e.g., on the body element) instead of several vocab attributes. See an example. This would also allow you to mix vocabularies for the same content.

It’s typically not useful to provide property values like "Unknown". If the locationCreated or the creator is unknow, omit the property. Otherwise the creator and the location would be named "Unknown".

Upvotes: 1

Related Questions