I would like to know how to represent repeating attributes using JSON-LD (recommended by Google) and Schema.org specifications. For example, how should we represent an Article
with N Comment
s (N > 1)?
It is allowed to have an array as comment
value like my example below. Seems yes as Google testing tool likes it.
But it is allowed to use a flat @graph
representation instead? How? I have to evolve a site and this representation could be easier to implement.
I imagine that both are allowed? Then how to choose?
My example:
<script type="application/ld+json">
{
"@context" : "http:\/\/schema.org",
"@type" : "Article",
"url" : "https:\/\/exemple.com/article?id=1234",
"author" :{"@type" : "Person","name" : "Didier"},
"image" : "https:\/\/exemple.com/article.jpg",
"mainEntityOfPage" : "https:\/\/exemple.com",
"dateModified" : "2018-06-14T19:50:02+02:00",
"datePublished" : "2018-06-14T19:50:02+02:00",
"publisher" : {"@type" : "Organization","name" : "exemple.com", "logo" : {"@type" : "ImageObject", "url" : "https:\/\/exemple.com\/logo.png"}},
"headline" : "my article",
"text" : "blah blah",
"commentCount" : 2,
"comment" : [{
"author" : {"@type" : "Person", "name" : "Didier"},
"text" : "comment first!!",
"dateCreated" : "2018-06-14T21:40:00+02:00"
},{
"author" : {"@type" : "Person", "name" : "Robert"},
"text" : "second comment",
"dateCreated" : "2018-06-14T23:23:00+02:00"
}]
}
</script>