I am struggling with using references in json-ld with schema.org.
I am trying to represent a person and a list of employments they've had at various organizations, where the person's job title is different for every organization where they've worked.
Schema.org Person
has a property jobTitle
and the Organization
type has a property employee
. I'm wanting to point the employee
property in Organization
to the top level same Person
object for all the Organization
objects using @id
. Can I then add the specific jobTitle
property together with the @id
, sort of like inheritance in OO-programming? If this doesn't work, would you have suggestions for a more sensible structure?
"@type": "Person",
"@id": "toplevelperson",
"givenName": null,
.
.
.
"worksFor": [
{
"@type": "Organization",
"name": "aaaa",
.
.
.
"employee": {
"@id": "toplevelperson",
"jobTitle": "Painter"
}
}
EDIT: I attempted a solution using EmployeeRole type with property roleName similar to example 2 for OrganizationRole example 2 https://schema.org/OrganizationRole.
{
"@context": "https://schema.org",
"@type": "Person",
"@id": "topLevelPerson",
"givenName": null,
.
.
.
"worksFor": [
{
"@type": "EmployeeRole",
"worksFor" {
"@type": "Organization",
"name": null,
.
.
.
"email": null,
"telephone": null,
"employee": {
"@id": "topLevelPerson"
}
},
"roleName": null,
"startDate": null,
"endDate": null
}
]
}