schema-dts & schema-dts-gen v0.11.0
Changes in schema-dts & schema-dts-gen
Role
,OrganizationRole
and others are allowed to be use in place of all properties in Schema.org. See #143 & notes in #164-
This also corrects the "Role" type to be generic. A
Role
type (and its sub classes) is contextual in the context of the property it is used in. E.g.Role
in analumniOf
will have a nestedalumniOf
property, for example:import { Person, WithContext } from 'schema-dts'; const p: WithContext<Person> = { '@context': 'https://schema.org', '@type': 'Person', name: 'Delia Derbyshire', sameAs: 'http://en.wikipedia.org/wiki/Delia_Derbyshire', alumniOf: { '@type': 'OrganizationRole', alumniOf: { '@type': 'CollegeOrUniversity', name: 'University of Cambridge', sameAs: 'http://en.wikipedia.org/wiki/University_of_Cambridge' }, startDate: '1959' } };
-
See http://blog.schema.org/2014/06/introducing-role.html for more details
-
Diffs vs previous version of schema-dts: https://www.diffchecker.com/Q5wPQvi0