You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"@context": {"@version": 1.1,"schema": "http://schema.org/","name": "schema:name","body": "schema:articleBody","words": "schema:wordCount","post": {"@id": "schema:blogPost","@container": "@id","@type": "schema:BlogPosting"// Here!}},"@id": "http://example.com/","@type": "schema:Blog","name": "World Financial News","post": {"http://example.com/posts/1/en": {"body": "World commodities were up today with heavy trading of crude oil...","words": 1539},"http://example.com/posts/1/de": {"body": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl...","@type": "schema:BlogPosting",// Here!"words": 1204},"http://example.com/posts/2/en": "hello"// Here!}}
The expanded form includes the @type for the simple key-value pair "http://example.com/posts/2/en": "hello", but not for "http://example.com/posts/1/en":
[{"@id": "http://example.com/","@type": ["http://schema.org/Blog"],"http://schema.org/name": [{"@value": "World Financial News"}],"http://schema.org/blogPost": [{"@type": ["http://schema.org/BlogPosting"// Here!],"http://schema.org/articleBody": [{"@value": "Die Werte an Warenbörsen stiegen im Sog eines starken Handels von Rohöl..."}],"http://schema.org/wordCount": [{"@value": 1204}],"@id": "http://example.com/posts/1/de"},{"http://schema.org/articleBody": [{"@value": "World commodities were up today with heavy trading of crude oil..."}],"http://schema.org/wordCount": [{"@value": 1539}],"@id": "http://example.com/posts/1/en"// Not Here!},{"@type": "http://schema.org/BlogPosting",// Here!"@value": "hello","@id": "http://example.com/posts/2/en"}]}]
@type is manually added for "http://example.com/posts/1/de" for the sake of comparison, which produces the expected result IMHO.
Is this my wrong understanding or is it missing from the expansion algorithm?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Yup, this is a common misunderstanding unfortunately. One that I have had in the past from reading the specs! You can't add an @type value into a context where the type is a class, and thus have the class added to the triples. That level of transformation of content is outside of the scope of JSON-LD in its currently chartered work.
See also: #76 and #31. Similarly #7 and #15 are transformations, though not around @type.
Building on the example from the specs with 3 changes marked by
// Here!
:Open in playground
The expanded form includes the
@type
for the simple key-value pair"http://example.com/posts/2/en": "hello"
, but not for"http://example.com/posts/1/en"
:@type
is manually added for"http://example.com/posts/1/de"
for the sake of comparison, which produces the expected result IMHO.Is this my wrong understanding or is it missing from the expansion algorithm?
Thanks in advance.
The text was updated successfully, but these errors were encountered: