Schema.org JSON-LD reference

You can identify a node by giving it a URI, specified in the @id keyword. This URI can be used to reference that node.

See the section “Node Identifiers” in the JSON-LD spec.

So your main event could get the URI http://example.com/2016-04-21#main-event:

<script type="application/ld+json">
{
  "@id": "http://example.com/2016-04-21#main-event",
  "@context": "http://schema.org",
  "@type": "Event",
  "name": "MainEvent",
  "startDate": "2016-04-21T12:00"
}
</script>

and you could give this URI as the value for the sub event’s superEvent property:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Event",
  "name": "SubEvent",
  "startDate": "2016-04-21T12:00",
  "superEvent": { "@id": "http://example.com/2016-04-21#main-event" }
}
</script>

(You could of course give your sub event an @id, too. This would allow you and others to identify/reference this sub event.)

Leave a Comment