Training#

A thematic type to describe potential training activities. In Schema.org a Course is a subtype of CreativeWork and LearningResource.

As defined from https://schema.org/Course:

Course: A description of an educational course which may be offered as distinct instances at which take place at different times or take place at different locations, or be offered through different media or modes of study. An educational course is a sequence of one or more educational events and/or creative works which aims to build knowledge, competence or ability of learners.

We can start by looking at a basic Course description.

Simple Course#

A basic course might simply present the name and description of the course along with a few other key properties.

 1{
2    "@context": {
3        "@vocab": "https://schema.org/"
4    },
5    "@id": "https://example.org/id/course/2",
6    "@type": "Course",
7    "courseCode": "SD100",
8    "name": "Structured Data",
9    "description": "An introduction to authoring JSON-LD documents for OIH",
10    "provider": {
11        "@type": "Organization",
12        "name": "Example University",
13        "@id": "https://grid.ac/institutes/grid.475727.4",
14        "description": "UN Department of Economic and Social Affairs Sustainable Development"
15    }
16}

Hide code cell source
import json
from pyld import jsonld
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils

with open("./graphs/course2.json") as dgraph:

context = {
"@vocab": "https://schema.org/",
}

compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)


Here we can see the emphasized line 7 and lines 10-15 highlighting some unique types.

courseCode: The courseCode is used to provide the ID used by the provider for this course.

provider: The provider is the organization offering the course. This property is from the CreativeWork supertype. In this case the provider may be of type Organization or Person. For Ocean InfoHub these would be described in the Experts and Institutions section.

Note

In this case you can see we use a simple @id in the provider property. You can see this same @id used in the Experts and Institutions section. By doing this, we connect this provider to the Organization described by that document.

As such these will be connected in the graph. So there is no need to duplicate the information here. This is a common graph pattern that allows us to simply connect resources. If there was no existing Organization or Person resource you could simply create one here. However, you may also find it useful to create a given resource and link to it in the graph.

Detailed Course#

There are a wide range of properties that can be used to describe a course. Many of these can be seen at the Course type as the properties from Course and properties from LearningResource.

We wont go into the details of each property here, but we will show a couple.

The example below present two.

 1{
2    "@context": {
3        "@vocab": "https://schema.org/",
4        "endDate": {
5            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
6        },
7        "startDate": {
8            "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
9        }
10    },
11    "@id": "https://example.org/id/course/2",
12    "@type": "Course",
13    "courseCode": "SD100",
14    "name": "Structured Data",
15    "description": "An introduction to authoring JSON-LD documents for OIH",
16    "teaches": "JSON-LD",
17    "provider": {
18        "@type": "Organization",
19        "name": "Example University",
20        "@id": "https://grid.ac/institutes/grid.475727.4",
21        "description": "UN Department of Economic and Social Affairs Sustainable Development"
22    },
23    "hasCourseInstance": [
24        {
25            "@type": "CourseInstance",
26            "courseMode": [
27                "MOOC1",
28                "online"
29            ],
30            "endDate": "2019-03-21",
31            "startDate": "2019-02-15",
32            "attendee": {
33                "@type": "Person",
34                "name": "Jane Doe",
35                "jobTitle": "Professor",
36                "telephone": "(425) 123-4567",
37                "url": "http://www.janedoe.com",
38                "identifier": {
39                    "@id": "ID_value_string",
40                    "@type": "PropertyValue",
41                    "propertyID": "This can be text or URL for an ID like ORCID",
43                    "description": "Optional description of the ID"
44                }
45            }
46        },
47        {
48            "@type": "CourseInstance",
49            "courseMode": [
50                "MOOC2",
51                "online"
52            ],
53            "endDate": "2019-05-21",
54            "startDate": "2019-04-15"
55        }
56    ]
57}

Hide code cell source
import json
from pyld import jsonld
import os, sys

currentdir = os.path.dirname(os.path.abspath(''))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from lib import jbutils

with open("./graphs/course1.json") as dgraph:

context = {
"@vocab": "https://schema.org/",
}

compacted = jsonld.compact(doc, context)
jbutils.show_graph(compacted)


Line 16 shows the teaches property. It should be noted while this propery can point to simple text, it is also possible to leverage DefinedTerm. This means a controlled vocabulary can be used to describe what the course teaches. Ocean InfoHub provides some more information and links to further information on defined term in the Keywords and Defined Terms section.

Lines 23-56 show using a hasCourseInstance property to show instances where this course is being taught. Also of note in this example are the lines 4-9 in the context where we can type the endDate and startDate as type dateTime. By doing this we must provide the dates in a format that is in line with the [XML Datatype] and in particular the ISO 8601 Data and Time Formats.

By doing this we can then later conduct searches on the graph that use date ranges to allow us to find courses, or any resources, that are being taught in a given time period.