1

I'm doing Schema.org for a character page for a TV show, and I'm having difficulty figuring out proper types.

This is what I have so far:

{
  "@context": "https://schema.org",
  "@type": "TVSeries",
  "name": "Show Name",
  "url": "URL of Character Page",
  "actor": {
                  "@type": "PerformanceRole",
                  "characterName": "Name of Character",
                  "image": {
                          "@type": "ImageObject",
                          "contentURL": "URL of Image"
                  }
          } 
  }

This is obviously just a template for developers to use, but I'm not sure if using type PerformanceRole under actor is the way to go. If it helps, the page is for the character, and includes a bio about the actor.

  • Why do you want to use schema. I'm not aware of anybody that uses this type of schema. – Stephen Ostermiller Mar 15 at 20:12
  • Because my boss told me to. – BAM Mar 15 at 22:00
  • I'd push back. I think your boss is wasting your time – Stephen Ostermiller Mar 15 at 22:19
  • @StephenOstermiller: If someone wants to make use of the data, they will make themselves familiar with the used vocabulary/ontology (or they will use a suitable ontology mapping) -- but given its popularity, it’s likely that they know the Schema.org terms relevant to their use case anyway. Linked (Open) Data is like an API, but with the huge benefit that consumers don’t have to learn each site’s/service’s different proprietary API (or even fall back to scraping) -- they can simply parse the RDF. – unor Mar 16 at 4:54
  • Are there browser extensions that will make that data useful or something? I can't find any. I've never seen any practical benefit to users from having schema data in your pages. – Stephen Ostermiller Mar 16 at 10:21
2

The PerformanceRole item also gets an actor property, so that you can provide an item for the Person that plays the character.

"actor": {
  "@type": "PerformanceRole",
  "characterName": "William Sherlock Scott Holmes",
  "actor": {
    "@type": "Person",
    "name": "Benedict Cumberbatch",
    "@id": "http://dbpedia.org/resource/Benedict_Cumberbatch"
  }
}

You can read more about how the Role types work in the announcement blog post.

For a page that is about a single character (instead of the show itself, or the list of all characters), it could be useful to convey this by using the mainEntityOfPage property on the PerformanceRole:

{
  "@context": "http://schema.org",
  "@type": "TVSeries",
  "name": "Sherlock",
  "url": "/series/sherlock",

  "actor": {
    "@type": "PerformanceRole",
    "characterName": "William Sherlock Scott Holmes",
    "actor": {
      "@type": "Person",
      "name": "Benedict Cumberbatch",
      "@id": "http://dbpedia.org/resource/Benedict_Cumberbatch"
    },
    "mainEntityOfPage": {
      "@type": "ItemPage",
      "url": "/series/sherlock/characters/sherlock-holmes"
    }
  }

}

(where /series/sherlock/characters/sherlock-holmes is the canonical URL of the current page)

  • Is there a reason why we wouldn't just use Person as the primary type and have the info trickle down from there? I think I'm just getting confused about why, when, and how to use mainEntityOfPage and mainEntity. – BAM Mar 18 at 23:24
  • @BAM: The top-level item (TVSeries in my snippet) does not necessarily represent the primary item (PerformanceRole in my snippet). With the mainEntity property (or its inverse, mainEntityOfPage) you can denote the primary item for a webpage. -- If your page is primarily about a character (instead of its actor), then I think PerformanceRole should be the primary item. You could probably model the JSON-LD in such a way that this item (or the Person) would also be the top-level item, but this wouldn’t change the semantics. – unor Mar 19 at 15:26
  • Thanks for assistance. I went through and found some of your old posts that discuss mainEntity and mainEntityOfPage and it definitely cleared some things up for me. Just so I'm clear, though: Is there a reason why you don't just do the following: "mainEntityOfPage": "Canonical URL of current page" Is it because the top-level type is TVSeries and not WebPage or CollectionPage? – BAM Mar 22 at 23:25
  • @BAM: You could do this. You would provide a URL value (which is one of the two expected values), while I’m providing a CreativeWork value (the other expected value), which allows me to state that the current page is an ItemPage (i.e., a page about a single item). -- By the way, I created the issue "Adding 'character' property to 'PerformanceRole'?", as I think the vocabulary is lacking in this aspect -- might be relevant for your data if something gets added to the vocabulary. – unor Mar 23 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.