Questions regarding the Schema.org validator

Hello Schema.org,

I have a few questions regarding the JSON-LD specifications and the
Schema.org validator.
I am working on the JSON-LD format and I noticed some mismatches between
what I understand of the specifications and what the validator is doing.
Chances are I just did not read the specifications correctly. However,
after having looked into it with attention, I still can't say if I am
mistaken or if the validator is doing a few things wrong.

My first question is about the validation of typed values using the
Schema.org vocabulary. The Schema.org vocabulary expects some precise types
for typed values as written in the JSON-LD documentation
<https://www.w3.org/TR/json-ld11/#specifying-the-type>. Therefore, from
what I understand of the specifications, the following document should be
invalid for the Schema.org vocabulary:

{
"@context": "https://schema.org",
"@type": "Organization",
"member": {
"@type": "WPSideBar",
"description": "1977"
}
}

Since the *member* <https://schema.org/member> property expects an
*Organization
<https://schema.org/Organization> *or a *Person* <https://schema.org/Person>
as its value, I expected this to be invalid since the *WPSideBar*
<https://schema.org/WPSideBar> type is not a child of any of these types.
However, when validating it with the Schema.org validator, this is
considered a valid type. So, maybe there is something I did not understand
about typed values?
And I can't understand why, if the above example is valid, the following
example is invalid :

{
"@context": "https://schema.org",
"@type": "Organization",
"member": {
"@type": "XPathType",
"description": "1977"
}
}

To me, both should be invalid. But if one is valid, the other probably
should be as well? This, or I missed something.



My second question is about specifying the type, as described here
<https://www.w3.org/TR/json-ld11/#specifying-the-type>. It is written that
the *@type *entry is optional and that the type may be inferred from its
properties. The specifications specifically write this about *node objects*..
So, to my understanding, this document should be valid :

{
"@context": "http://schema.org/",
"name": "Jane Doe",
"jobTitle": "Professor",
"telephone": "(425) 123-4567",
"url": "http://www.janedoe.com"
}

But it is not. However, the type is not required on typed values. So, maybe
the type is actually required on node objects but not on typed values?




Lastly, it is written in the specifications (here
<https://www.w3.org/TR/json-ld11/#specifying-the-type>) that

> In addition to setting the type of nodes, @type can also be used to set
> the type of a value to create a typed value. This use of @type is similar
> to that used to define the type of a node object, *but value objects are
> restricted to having just a single type*.


However, if I use the validator on the following JSON, it is considered a
valid JSON-LD document.

{
"@context": "https://schema.org",
"@type": "Organization",
"member": {
"@type": ["WPSideBar", "WPHeader"],
"description": "1977"
}
}

Shouldn't this document be invalid?

Considering my last 2 questions, I might be confused about the terminology.
However, I would be glad if you could enlighten me on these questions!

Sorry for this quite long email!

Respectfully,

Hédic Guibert

Received on Wednesday, 2 August 2023 23:07:54 UTC