Can value in PropertyValue be an array? [duplicate] - schema.org

A Schema.org object of type Person can have a sameAs property of type URL. According to Google's structured data site, the sameAs property can be a single item or an array.
The docs on Schema.org do not mention whether sameAs can be a single item or an array. Is this just Google deviating from Schema.org? Or is it the case that all properties in Schema.org can be single items or arrays?

Every Schema.org property can have multiple values. It doesn’t necessarily make sense for some properties (e.g., birthDate), but it’s still allowed.
In JSON-LD:
"sameAs": ["/foo", "/bar"],
In Microdata:
<link itemprop="sameAs" href="/foo" />
<link itemprop="sameAs" href="/bar" />
In RDFa:
<link property="sameAs" href="/foo" />
<link property="sameAs" href="/bar" />
This doesn’t necessarily mean that Google (or any other consumer) supports this for every property, too. So when Google explicitly mentions this in their documentation, you can be sure that the respective search result feature works with multiple values.

Related

How to define multiple dietary restrictions in suitableForDiet field? [duplicate]

A Schema.org object of type Person can have a sameAs property of type URL. According to Google's structured data site, the sameAs property can be a single item or an array.
The docs on Schema.org do not mention whether sameAs can be a single item or an array. Is this just Google deviating from Schema.org? Or is it the case that all properties in Schema.org can be single items or arrays?
Every Schema.org property can have multiple values. It doesn’t necessarily make sense for some properties (e.g., birthDate), but it’s still allowed.
In JSON-LD:
"sameAs": ["/foo", "/bar"],
In Microdata:
<link itemprop="sameAs" href="/foo" />
<link itemprop="sameAs" href="/bar" />
In RDFa:
<link property="sameAs" href="/foo" />
<link property="sameAs" href="/bar" />
This doesn’t necessarily mean that Google (or any other consumer) supports this for every property, too. So when Google explicitly mentions this in their documentation, you can be sure that the respective search result feature works with multiple values.

How do I indicate a newer version of a "Dataset"?

I would like to include newer versions for a Dataset that has been superseded.
For example, Some dataset V1 has been replaced by Some dataset V2. The landing page for V1 no longer has data, but instead points to the landing page for V2.
How do I indicate a newer version of a Dataset in Schema.org markup?
Schema.org properties replacer and supersededBy are not recognized for an object of type Dataset.
Schema.org doesn’t provide a property to link a Dataset to an updated Dataset.
An unspecified relation might be conveyed by referencing them from the same DataCatalog. In some contexts it might also make sense to use isBasedOn to link the new one from the old one.
You can provide data about the datasets that could convey which one is the newest:
You can specify the version number of a dataset with the version property.
You can specify the creation/modification/publication dates of a dataset with the dateCreated, dateModified, and datePublished properties. (And if it makes sense in your context, maybe also expires.)
Example:
<article typeof="schema:Dataset" resource="/dataset/v1#this">
<link property="schema:url" href="/dataset/v1">
<link property="schema:includedInDataCatalog" typeof="schema:DataCatalog" href="/dataset#this">
<h2>
<span property="schema:name">Some dataset</span>
V<span property="schema:version">1</span>
</h2>
<time property="schema:datePublished">2017-05-30</time>
</article>
<article typeof="schema:Dataset" resource="/dataset/v2#this">
<link property="schema:url" href="/dataset/v2">
<link property="schema:includedInDataCatalog" typeof="schema:DataCatalog" href="/dataset#this">
<h2>
<span property="schema:name">Some dataset</span>
V<span property="schema:version">2</span>
</h2>
<time property="schema:datePublished">2018-01-22</time>
</article>
In case you don’t offer, nor need to say something about, nor need to reference older datasets, you could of course decide to have only one Dataset and update its dateModified property.

Proper way to use the 'publisher' property ("The attribute publisher.itemtype has an invalid value.")

When I attempt to validate my structured data using Google's Structured Data Testing tool, I get an error:
The attribute publisher.itemtype has an invalid value.
I am getting that on this line:
<meta itemprop="publisher" content="My Real Name Here" />
How do I provide a valid value for this property?
The expected value of the publisher property is another item (Organization or Person).
While Schema.org always allows to provide a string value (like you do), Google might require a certain value type for one of their search features (e.g., an Organization value for their Articles rich result for AMP HTML pages). If you don’t care about (or can’t qualify for) this feature, you can ignore the error in the SDTT.
The problems with using a string value: it’s not clear if the publisher is a person or an organization, and it’s not possible to provide additional data about the publisher.
If you want to provide an item, it could look like:
<div itemprop="publisher" itemscope itemtype="http://schema.org/Person">
<p itemprop="name">NewGuy</p>
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<p itemprop="name">NewGuy Inc.</p>
</div>

Microdata error: "The property http://xmlns.com/foaf/0.1/name is not recognized by Google"

The way I understand it, the Schema.org type called Product inherits from the type Thing. So why does this:
<meta itemscope="" itemtype="http://schema.org/Product" itemid="https://some.url" itemref="md25" />
<div class="field-item even" itemprop="description http://xmlns.com/foaf/0.1/description">
long description goes here
</div>
<meta itemprop="name http://xmlns.com/foaf/0.1/name" content="Blueair Pro L" id="md25" />
… fail, when I enter it in Google's testing tool?
I get error:
The property http://xmlns.com/foaf/0.1/name is not recognized by Google for an object of type Product.
But description is part of Thing and Product inherits from it. It even shows it on the Schema.org page here.
So why is this error being thrown?
The quoted message is about the property http://xmlns.com/foaf/0.1/name, not about the property http://schema.org/name or http://schema.org/description.
And it doesn’t say that it would be an error (in Microdata, it is valid to use absolute URLs as properties), it just says that Google doesn’t recognize it. Which is not surprising, because Google doesn’t document support for the FOAF vocabulary.
On a side note: You can’t use the meta with itemscope like that. You should use a div (or a more specific) element instead.

Creating a GeoPoint complex data type in Facebook Open Graph

I am attempting to create a GeoPoint type to my existing Object. Facebook's documentation here isn't exactly stellar - but what I went ahead and did was create a new property and named it location. I made it of type GeoPoint and required.
I then supply the following in my template:
<meta property="my-app:location:latitude" content="<%= #location.lat %>" />
<meta property="my-app:location:longitude" content="<%= #location.lng %>" />
Yet the debugger complains:
The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input property =>content pairs that were not seen in the parsed result: 'my-app:location:latitude => 40.134537901957735, my-app:location:longitude => -75.00853989318185'
How am I supposed to define this GeoPoint and how am I supposed to embed the lat/lng in my URL? This does not want to validate it any way I've tried.
I just ran the URL of an object I published via another app (Endomondo), but which contains GeoPoint data into the debug tool, and this is how they did it. Bear in mind it's an array in this case (it's a path for a cycle activity) so there were actually like 60 of these, but i think a single example would just be:
Meta Tag <meta property="endoapp:route:latitude" content="3x.xxxx" />
Meta Tag <meta property="endoapp:route:longitude" content="-12x.xxxx" />
Meta Tag <meta property="endoapp:route:altitude" content="0.01" />
Looking at your example, I think maybe the omitted altitude could be the problem?
Endomondo's example uses an array of points in the 'route' field, and one each for start and finish, which are endoapp:start:latitude, endoapp:start:longitude, etc
You should omit what you specified at
property="og:type", i.e. content="my-app"
if so then you should use property="location:latitude" etc (omit "my-app" prefix)