Defining a relationship between a country and a recipe with Schema - semantic-web

I am building a web page that lists typical dishes for each individual country. Each dish is put in its own article and all of that goes fine. But I wonder if there is a way to link the Recipes to the country. Does it make sense to also specify the country with http://schema.org/Country, and if so how can I link that to the dishes?
I thought about defining the main as a country, and then using http://schema.org/additionalProperty but that doesn't seem to make sense as it expects a PropertyValue, which the recipes aren't.
<main>
<h1>France</h1>
<p>
<span class="capital" title="Capital">Paris</span>
<span class="member-since" title="Member of the EU since 1958">1958</span>
</p>
<article id="recipe-1" itemscope itemtype="http://schema.org/Recipe">
<h1>Éclairs</h1>
<!-- A lot of recipe-related stuff -->
</article>
<article id="recipe-2" itemscope itemtype="http://schema.org/Recipe">
<h1>Macaron</h1>
<!-- A lot of recipe-related stuff -->
</article>
<article id="recipe-3" itemscope itemtype="http://schema.org/Recipe">
<h1>Tarte Tatin</h1>
<!-- A lot of recipe-related stuff -->
</article>
</main>

You can provide the cuisine of a Recipe with its recipeCuisine property:
The cuisine of the recipe (for example, French or Ethiopian).
It expects a Text value.
There is also the locationCreated property, which expects a Place value (which includes Country), but it might be a stretch to use it in this context. Also it wouldn’t be clear if it refers to the location where the recipe is originally coming from, or to the location where the written form was created.
Schema.org doesn’t seem to offer a property to connect a Country and Recipe directly. But you could still connect the items via WebPage.
So for example, if you say WebPage about Country and WebPage mainEntity ItemList, and have each Recipe as itemListElement, there is at least some connection (a page about a specific country has a list of recipes as main content = the recipes are probably related to that country).

Related

What's wrong with my structure data?

It's been more than 4 months that our rich snippets suddenly disappeared, some error were reported in GWT, i corrected everything and errors are now decreasing (only 5 left). here is my code:
<section class="c-center" itemscope itemtype="http://schema.org/Product">
<div>
<h1><span itemprop="name">Product name</span> <span itemprop="brand" class="brand">Brand of product</span></h1>
<div id="reviews" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<div class="rating">
<meta itemprop="ratingValue" content="4.8" />
<meta itemprop="ratingCount" content="56" />
<div class="fill" style="width:96%"></div>
<div class="stars"></div>
</div>
<div class="rating-info">
Based on 56 reviews - Write a review
</div>
</div>
</div>
<div id="img">
<img src="/link-to-image.jpg" alt="Img alt" itemprop="image" />
</div>
<div id="info">
<meta itemprop="url" content="site.com/link-of-product/">
<div id="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="priceCurrency" content="EUR">
<meta itemprop="gtin13" content="1234567899999">
<span class="price" itemprop="price">19,95 €</span> <del>28,50 €</del> -
<span class="stock"><link itemprop="availability" href="http://schema.org/InStock">Available</span>
</div>
</div>
</section>
here are my questions:
1- is there anything wrong?
2- I've seen in many posts that currency should not be in the itemprop="price" but in google examples, they do include it! what should I do?
3- should I use ratingCount or reviewCount ?
4- some products exist in different sizes with different prices, is it recommended to include the AggregateOffer with lowest and highest price?
Thanks a lot
How does it appear visually?
The structured data linter shows a typical snippet which looks good and has star rating, and there are no errors in google's tool. Two things which stand out are:
url has no protocol, set to http://yoursite.com/page1 for
price should be number only, which could well be affecting search results, currency is a separate field so should not be embedded in price as well
use <meta> to give your price with a full stop as the separator, not the comma and put large values as 1234567.89 not 1,234,567.89 or 1.234.567,89 but display it as you would normally
price info from http://schema.org/
Use the priceCurrency property (with ISO 4217 codes e.g. "USD") instead of including ambiguous symbols such as '$' in the value.
Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.
Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similiar Unicode symbols.
google actually gives this example in its policies page
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">119.99</</span>
previous Offer price, you could include in <del> structured data for the expired Offer price, with priceValidUntil set to a date in the past, the current price can also have an expiry date.
consider setting itemCondition to http://schema.org/NewCondition
image urls - I've noticed that full url starting path rather than a relative path seem to be preferred - your /link-to-image.jpg is interpreted as http://example.com/link-to-image.jpg not http://site. com/link-to-image.jpg in the testing tool, I'm unsure if this is the same when testing direct from the URL but it seems best not to be amigous
lastly use a shopping search tool, including google shopping to search for a best seller, see if it can find it by price, brand, availability etc. if competitor sites appear first you can even check the structured data tester with their URL to see if you are missing anything

Google Rich Snippets Not Working

I'm working on a website for a friend (www.texasfriendlydds.com) and am trying to give them an edge with Rich Snippets that Google allegedly loves. It's a defensive driving school with 10 locations in the Austin area. I've placed the schema.org code within the address of each location, but while searching 'defensive driving austin' - I do not see any of the locations listed. I have 10 of the following code for each location(different address for each):
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="name">Texas Friendly Defensive Driving</span><br />
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">13201 Ranch Road 620</span><br />
<span itemprop="addressLocality">Austin</span> <span itemprop="addressRegion">TX</span> <span itemprop="postalCode">78750</span>
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4.6</span> stars - based on <span itemprop="reviewCount">24</span> reviews
</div>
Free meal w/ <span itemprop="priceRange">$40 tuition</span><br /><br />
<meta itemprop="openingHours" content="Thursdays 3:30pm - 9:30pm"><b>Thursdays 3:30pm - 9:30pm</b><br />
</div>
In addition, at the bottom of the page, I aggregate all the reviews in attempt to get organic search rich snippet star-ratings to no avail. I've compared my code directly with the following site:
- http://www.microdatagenerator.com/aggregate-rating-schema-generator/
They were exactly the same (minus the values). You can find their snippets by Googling 'aggregate rating schema' and find the 2nd listing with rich snippet stars and 956 ratings. At one point I read that you need to show proof of your ratings, but this site doesn't do that and they have them.
I've used the Google Structured Data Testing Tool (https://developers.google.com/structured-data/testing-tool/) and everything comes out peachy. So why in the world am I not seeing any results from this?
We (Google) don't accept rich snippets for homepages; rich snippet annotations should be placed on leaf pages.

How to markup a document with RDFa when data is across multiple elements

I have the following HTML structure:
<address>
<div>Address Line One</div>
<div>Address Line Two</div>
<div>Address Line Three</div>
<div>Post Code</div>
</address>
Since the data I have is does not consistently have regions or localities, I cannot reliably use the properties addressRegion and addressLocality as defined at schema.org. Instead, I think I should be using the streetAddress property for everything except the post code.
My question is whether this is valid RDFa markup?:
<address property="address" typeof="PostalAddress">
<div property="streetAddress">Address Line One</div>
<div property="streetAddress">Address Line Two</div>
<div property="streetAddress">Address Line Three</div>
<div property="postalCode">Post Code</div>
</address>
If not, is there another way to do this without changing the structure of the HTML?
Your markup is syntactically valid, but it’s probably not conveying what you mean.
You are adding three street addresses (!) to the PostalAddress node, but
consumers have no reason to assume that these are three parts of actually one street address, and
RDFa doesn’t rely on the relative order of these triples anyway (unless you are using lists), so when a consumer queries your data, these three streetAddress values could come up in any order.
So without changing something (I’m not sure what exactly you mean with "structure") in your HTML, you can’t fix this.
scor suggests to add a parent div, which is a good and easy solution.
There are many other ways how to add this triple (for example, adding a meta element giving the full street address and removing the properties from the div elements), but unless you have some special constraints about what you can/cannot change in your HTML, go with the div.
Side note about your markup:
Based on my recommendation for postal address markup, I’d use br elements for separating the street address lines, with optional span elements if a grouping, like in your case, is needed:
<address>
<p property="schema:address" typeof="schema:PostalAddress">
<span property="schema:streetAddress">
Address Line One<br>
Address Line Two<br>
Address Line Three<br>
</span>
<span property="schema:postalCode">
Post Code
</span>
</p>
</address>
That said, I’d question your use of Schema.org’s streetAddress property. Regions or localities should not be included, because, well, they are not part of the "street address". I’d only mark up the actual street address, even if that would mean in your case that the region and the locality don’t get included in the graph.
You can wrap your series of div elements with a higher level div:
<address property="address" typeof="PostalAddress">
<div property="streetAddress">
<div>Address Line One</div>
<div>Address Line Two</div>
<div>Address Line Three</div>
</div>
<div property="postalCode">Post Code</div>
</address>

Create own properties to using Schema.org with RDFa Lite?

So Im putting semantics on my page using RDFa Lite and the vocabulary Schema.org, but I have ran into an problem. Im putting it on a Person that is a soocer player. I got informations like player number, player position and so on? How do I define these with Schema.org?
So my code looks like this
<div class="indhold" vocab="http://schema.org/" typeof="Person">
<h2>Spiller - <span property="name" >Morten Jensen</span></h2>
<img property="image" src="http://e2.365dm.com/12/06/660x350/YannMvila_2775667.jpg" alt="Morten Jensen billede" class="spiller" />
<p><b>Navn:</b> <span property="name">Morten Jensen</span></p>
<p><b>Fødselsdag:</b> <span property="birthDate">1989-12-12</span></p>
<p><b>Hold:</b> <span property="memberOf"><span typeof="Organisation" property="name">FC København</span></span></p>
<p><b>Spillernr.:</b> <span property="playerNumber">2</span></p>
<p><b>Position:</b> <span property="playerPosition">Målmand</span></p>
<p><b>Beskrivelse:</b><br/>
<span property="description">Denne spiller startede i en meget tidlig alder, men var fast besluttet på at blive en kæmpe stjerne! Om få år spåes han en kæmpe fremtidig indenfor dansk fodbold! </span>
</p>
</div>
I have tried google, but Im not quite sure you can just create properties like that?
To extend schema.org to support custom properties you usually have to find a more generic type or property that is a superset of your custom term. In the case of playerNumber and playerPosition, I can't think of any property from schema.org that relates to these two custom terms. You could potentially use 'description' even though it is very generic, so something like:
property="description/playerNumber"
property="description/playerPosition"
In any case, this should not prevent you from publishing your content in RDFa lite. If you are not sure what to do about playerNumber and playerPosition, you can also just leave them out and not add RDFa Lite for them. You don't have to annotate every single item of your page, you can always improve that later.
You could also ask your question on http://lists.w3.org/Archives/Public/public-vocabs/, it is the official mailing list for the scgem
BTW, the rest of your markup looks good. Just make sure to move the typeof="Organization" into the span that has property="memberOf", since you are defining a new entity organization entity, it should be in the same HTML element as the property that creates it. Also, in schema.org, Organization is spelt in US English with a "z".

Floor number with schema.org microdata?

Any idea how to markup a floor number with schema.org microdata for a local business' postal address?
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="legalName">Company Limited</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">Billy Street 100</div>
<div>10th Floor</div>
<div><span itemprop="addressLocality">Paris</span>,
<span itemprop="addressRegion">TX</span>
<span itemprop="postalCode">75462</span></div>
<div itemprop="addressCountry">United States</div>
</div>
</div>
Also, is the above markup semantic?
If there's no floor number, should I use RDFa?
Unfortunately, schema.org doesn't have a property for secondary address line, which is where the floor number would go. postOfficeBoxNumber is as close as it gets, but it looks like it's reserved specifically for PO Box numbers, not the whole line that contains PO Box.
Perhaps you could put floor number in streetAddress, on a new line using a <br> tag.
Although I know a lot about street addresses (I work at SmartyStreets), I'm not a microdata expert: but from what I can tell, yes, the markup looks okay to me.
And you could use RDFa instead if you'd like: Google supports it for its rich snippets. Or you could have some fun and extend schema.org for your needs.