seoschema.orgjson-ldstructured-data

JSON-LD for multiple pages (Course Intro page & Lesson pages) that make up a course


I'm unsure how to mark-up my pages that make up a course. Let's say I have the following pages, where the first in each group is a Course Introduction page, and each of the following is a single Lesson Page within the course. All the pages together technically make up the entire course. The course is completely online, and you go at your own pace.

www.myeducationalsite.com/course-1
www.myeducationalsite.com/course-1/lesson-1
www.myeducationalsite.com/course-1/lesson-2
www.myeducationalsite.com/course-1/lesson-3

www.myeducationalsite.com/course-2
www.myeducationalsite.com/course-2/lesson-1
www.myeducationalsite.com/course-2/lesson-2

I am using the Course object from schema.org to describe the Course Introduction page, but I was unsure which object type to use for the Lesson pages.

I'm also unsure how to describe their relationships. The hasCourseInstance property didn't seem to be what I need, but maybe I'm misunderstanding. I understand I can use hasPart and isPartOf to describe relationships, but I was unsure what @type to even use on the Lesson pages.

How can I use JSON-LD to describe the relationship of the pages that make up the Course?


Solution

  • Browsing the schema.org site tells that the hasPart relationship points to a CreativeWork, the most relevant sub-class of which for your use-case might perhaps be LearningResource:

    The LearningResource type can be used to indicate CreativeWorks (whether physical or digital) that have a particular and explicit orientation towards learning, education, skill acquisition, and other educational purposes.

    So perhaps something along these lines?

    [
      {
        "@context": "https://schema.org/",
        "@id": "https://www.myeducationalsite.com/course-1",
        "@type": "Course",
        "hasPart": [
          {
            "@type": "LearningResource",
            "@id": "https://www.myeducationalsite.com/course-1/lesson-1"
          },
          {
            "@type": "LearningResource",
            "@id": "https://www.myeducationalsite.com/course-1/lesson-2"
          },
          {
            "@type": "LearningResource",
            "@id": "https://www.myeducationalsite.com/course-1/lesson-3"
          }
        ]
      },
      {
        "@context": "https://schema.org/",
        "@id": "https://www.myeducationalsite.com/course-2",
        "@type": "Course",
        "hasPart": [
          {
            "@type": "LearningResource",
            "@id": "https://www.myeducationalsite.com/course-2/lesson-1"
          },
          {
            "@type": "LearningResource",
            "@id": "https://www.myeducationalsite.com/course-2/lesson-2"
          }
         ]
      }
    ]
    

    Here is a link to JSON-LD Playground for the above.