5. Bioschemas with Wordpress
Bioschemas profiles for training resources
Many training related resources will include pages describing tutorials or courses. As such, they are marked up using the following three profiles:
TrainingMaterial
: A profile describing training materials in life sciences, it can be used on its own (as it happens with the Bioschemas tutorials) or in combination with aCourseInstance
.Course
: A profile describing a course from a generic point of view, i.e., the learning objectives of a course rather than where and when it is delivered.CourseInstance
: A profile describing a particular instance of a course, i.e., an edition of a course that is scheduled for specific dates and happening in a specific location (that of course can be online or on-site, virtual or real).
Note that the CourseInstance
profile is used in tandem with the Course
profile, i.e., a CourseInstance
does not exist without a Course
but a Course
can exist without a CourseInstance
(there are no current offerings of the course).
Setup of the Wordpress CMS
Configuration of the Bioschemas Profile as Schema template
- Install the RankMath SEO and RankMth SEO Pro plugins.
- After successfull installation, in the RankMath menu, go to
Schema templates
. - Click on
Add New Schema
- Click on
Import
in the Schema Generator dialogue - Select the
JSON-LD/Custom Code
option in the dropdown of theImport Schema Code from
field. - Copy and paste the template below in the empty
Custom JSON-LD Code
field. - Click on the
Process Code
- TODO: Click on
Use
- Check the
Display Conditions
field to potentially exclude certainPost types
of the Wordpress system
Template:
{
"@context": "https://schema.org",
"@graph": {
"@type": "LearningResource",
"@id": "%url%",
"dct:conformsTo": {
"@type": "CreativeWork",
"@id": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE"
},
"name": "%seo_title%",
"url": "%url%",
"description": "%seo_description%",
"keywords": [
"AlphaFold Database (13181)",
"second keyword",
"third keyword"
],
"author": [
{
"@type": "Person",
"name": "%post_author%"
},
{
"@type": "Person",
"name": "Alexander Botzki | https://orcid.org/0000-0001-6691-4233"
}
],
"contributor": [
{
"@type": "Person",
"name": "Kenneth Hoste"
}
],
"audience": [
{
"@type": "Audience",
"audienceType": "Life scientists with programming skills"
}
],
"about": [
{
"@type": "DefinedTerm",
"@id": "http://edamontology.org/topic_2814",
"inDefinedTermSet": "http://edamontology.org",
"name": "Protein structure analysis",
"url": "http://edamontology.org/topic_2814"
},
{
"@type": "DefinedTerm",
"@id": "http://edamontology.org/topic_3474",
"inDefinedTermSet": "http://edamontology.org",
"name": "Machine learning",
"url": "http://edamontology.org/topic_3474"
},
{
"@type": "DefinedTerm",
"@id": "http://edamontology.org/topic_0082",
"inDefinedTermSet": "http://edamontology.org",
"name": "Structure prediction",
"url": "http://edamontology.org/topic_0082"
}
],
"license": "https://spdx.org/licenses/CC-BY-NC-SA-4.0.html",
"educationalLevel": "intermediate",
"dateCreated": "%date%",
"learningResourceType": "hands-on tutorial",
"inLanguage": "en-GB",
"version": "1.0"
}
}
Associate the Bioschemas Profile to Post Types
- TODO: check whether this part is necessary or can be stepped over due to unselection of
Post types
in the Sitemap step - After successfull installation, in the RankMath menu, go to
Schema templates
. - Click on
Add New Schema
Configure the Sitemap for your Wordpress system
- Check whether the sitemap option needs to be activated in the General configuration of the RankMath plugins.
- In the RankMath menu, go to
Sitemap Settings
. - In the
General
section, the URL to the sitemap is displayed:Your sitemap index can be found here: https://your.url.org/sitemap_index.xml
- Manually check all the sections on the left side of the displayed website from
HTML Sitemap
over allPost Types
andTaxonomies
. Unselect the slider for all non-relevant Post types and Taxonomies. - Verify the URL whether all relevant links to the pages are shown.
HTML code for a training material page
{
"@context":"https://schema.org/",
"@type":"LearningResource",
"@id": "https://example.com/training-material/12345",
"dct:conformsTo":{
"@type":"CreativeWork",
"@id":"https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE"
},
"audience":[
{
"@type":"Audience",
"name":"(Markup provider, Markup consumer) WebMaster, people deploying GitHub pages"
}
],
"description":"This guide will show you how to do add Schema.org markup to a GitHub Pages site.",
"keywords":"schema.org, TeSS, GitHub pages",
"name":"Adding Schema.org to a GitHub Pages site",
"about":[{"@id":"https://schema.org"},{"@id":"http://edamontology.org/topic_0089"}],
"author":[
{
"@type":"Person",
"name":"Niall Beard",
"@id":"https://orcid.org/0000-0002-2627-0231",
"url":"https://bioschemas.org/people/NiallBeard"
}
],
"educationalLevel":"beginner",
"identifier": "http://dx.doi.org/12349302",
"inLanguage": "en-UK",
"contributor":[
{
"@type":"Person",
"name":"Alasdair Gray",
"@id":"https://bioschemas.org/people/AlasdairGray",
"url":"https://bioschemas.org/people/AlasdairGray"
}
],
"teaches": [
"The student will be able to recall shell commands",
"The student will be able to write code to copy files",
"The student will be able to discover new commands on their own"
],
"dateModified":"2021-07-22",
"license":"CC-BY 4.0",
"version":2.0
}
TODO: demonstrate tools to edit JSON-LD object template
In the example code, replace insert bioschemas annotation here
by the JSON-LD object and save the HTML file.
1.2 HTML code for a training course page
The rather elaborate annotation according to Bioschemas profiles Course/CourseInstance
looks like this. Note that it is using the annotation for the associated training material, too. This annotation is added via the property hasPart
.
{
"@context":"https://schema.org/",
"@type":"Course",
"http://purl.org/dc/terms/conformsTo":{
"@type":"CreativeWork",
"@id":"https://bioschemas.org/profiles/Course/1.0-RELEASE"
},
"description":"Bioschemas Tutorial at SWAT4HCLS Leiden",
"keywords":"Bioschemas, SWAT4HCLS, Schema validation, Harvesting markup, Deploying markup",
"name":"Bioschemas - Deploying and Harvesting Markup",
"hasPart":[
{"@type":"LearningResource",
"@id":"https://dx.doi.org/10.4126/FRL01-006432243",
"http://purl.org/dc/terms/conformsTo":{
"@type":"CreativeWork",
"@id":"https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE"
},
"description":"Bioschemas Tutorial at SWAT4HCLS Leiden",
"keywords":"Bioschemas, SWAT4HCLS, Schema validation, Harvesting markup, Deploying markup",
"name":"Bioschemas - Deploying and Harvesting Markup"
}
],
"hasCourseInstance":[
{
"@type":"CourseInstance",
"http://purl.org/dc/terms/conformsTo":{
"@type":"CreativeWork",
"@id":"https://bioschemas.org/profiles/CourseInstance/0.8-DRAFT-2020_10_06"
},
"courseMode":"online",
"location":"Virtual, and Fletcher Wellness-Hotel, Leiden, The Netherlands",
"startDate":"2022-01-10",
"endDate":"2022-01-10",
"inLanguage":"en",
"url":"https://www.swat4ls.org/workshops/leiden2022/",
"instructor":[
{
"@type":"Person",
"name":"Alban Gaignard",
"@id":"https://bioschemas.org/people/AlbanGaignard",
"url":"https://bioschemas.org/people/AlbanGaignard"
},{
"@type":"Person",
"name":"Leyla Jael Castro",
"@id":"https://bioschemas.org/people/LeylaGarcia",
"url":"https://bioschemas.org/people/LeylaGarcia"
},{
"@type":"Person",
"name":"Alasdair Gray",
"@id":"https://bioschemas.org/people/AlasdairGray",
"url":"https://bioschemas.org/people/AlasdairGray"
}
]
}
]
}
TODO: add explanation of the various properties and reference the extensive documentation of the Bioschemas profile.
1.3 Validate the annotation
Validate the individual page with the schema.org validator by pasting the URL into the Fetch URL tab. The validation procedure will indicate if you have used non-existing properties of the Bioschemas profile. If error messages are returned, have a look at the troubleshooting section below.
TODO: Add image from TeSS course