openactive / modelling-opportunity-data

OpenActive Modelling Opportunity Data specification
https://www.openactive.io/modelling-opportunity-data/
Other
6 stars 6 forks source link

Use @type and @id #219

Open nickevansuk opened 5 years ago

nickevansuk commented 5 years ago

Proposer

ODI

Background

When the specifications were first created, the underlying JSON-LD structure was simplified by aliasing @type to type and @id to id.

Although this initially provided a minor simplification for implementations, as the tooling and implementations have now become more sophisticated this has caused challenges for implementations that leverage existing JSON-LD based libraries (e.g. Schema.NET), and situations where data is being serialised for consumption by e.g. Google for SEO (e.g. the Dataset Sites), where proper JSON-LD form is expected.

Proposal

For the next minor version of the modelling specification, we should move towards a recommendation of @type and @id, while still supporting type and id for backward compatibility. We should also adopt the same for the Open Booking specification.

Note as the modelling specification currently allows for either to be used, and simply preferences type and id, this is not a breaking change.

Example

<script type="application/ld+json">
{
  "@context": "https://openactive.io",
  "@type": "Organization",
  "@id": "http://api.example.com/organization",
  "url": "http://www.example.com",
  "name": "Unlimited Ball Bearings Corp."
}
</script>
nickevansuk commented 4 years ago

Relevant points from the summary of the W3C call on 12 Feb 2020: