1

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
    }
]

}

4
  • This sounds familiar to a question I answered a while ago, this might be of some help. Let me know if it's what you're looking for or not: stackoverflow.com/questions/39128187/… Jan 5, 2021 at 20:42
  • Thank you for your help. I tried using "roles" to express the same behaviour (see original post edit), which I hope links the particular jobTitle (expressed as roleName) to the particular organization. Please let me know if it doesn't look right to you! Thanks again!
    – Karl Sykes
    Jan 7, 2021 at 12:53
  • Interesting approach - Having two nested "worksFor" seems odd, but it does pass validation on the structured data testing tool at least. Maybe the more important question is what your intention with JSON-LD is to begin with, if it's SEO related, it's tough to say if you'll benefit from this approach. Jan 7, 2021 at 20:07
  • I'm using it for making a data model for interoperability. I wanted to make the model using standardised vocabulary and be as self-describing as possible. Not sure if this is the best approach, but it's the best I could come up with.
    – Karl Sykes
    Jan 8, 2021 at 22:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.