Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JSON-LD conformation to BioSchemas profile #483

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inst/templates/metadata-template.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{=<% %>=}}
{
"@context": "https://schema.org",
"@type": "TrainingMaterial",
"@type": "LearningResource",
"@id": "<% url %>",
"dct:conformsTo": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE",
"http://purl.org/dc/terms/conformsTo": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE",
"description": "<% desc %><% ^desc %>A Carpentries Lesson teaching foundational data and coding skills to researchers worldwide<% /desc %>",
"keywords": "<% keywords %><% ^keywords %>software,data,lesson,The Carpentries<% /keywords %>",
"name": "<% &pagetitle %>",
"creativeWorkStatus": "active",
"creativeWorkStatus": "Active",
"url": "<% url %>",
"identifier": "<% url %>",
<% #date %>"dateCreated": "<% created %>",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/utils-metadata.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# metadata can be initialised with custom items added

"{\n \"@context\": \"https://schema.org\",\n \"@type\": \"TrainingMaterial\",\n \"@id\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"dct:conformsTo\": \"https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE\",\n \"description\": \"A Carpentries Lesson teaching foundational data and coding skills to researchers worldwide\",\n \"keywords\": \"software, data, lesson, The Carpentries\",\n \"name\": \"The Importance of Being Ernest Scared Stupid\",\n \"creativeWorkStatus\": \"active\",\n \"url\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"identifier\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"dateCreated\": \"2022-02-01\",\n \"dateModified\": \"2022-02-08\",\n \"datePublished\": \"2022-02-09\"\n}\n"
"{\n \"@context\": \"https://schema.org\",\n \"@type\": \"LearningResource\",\n \"@id\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"http://purl.org/dc/terms/conformsTo\": \"https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE\",\n \"description\": \"A Carpentries Lesson teaching foundational data and coding skills to researchers worldwide\",\n \"keywords\": \"software, data, lesson, The Carpentries\",\n \"name\": \"The Importance of Being Ernest Scared Stupid\",\n \"creativeWorkStatus\": \"Active\",\n \"url\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"identifier\": \"https://zkamvar.github.io/lesson-example/vern.html\",\n \"dateCreated\": \"2022-02-01\",\n \"dateModified\": \"2022-02-08\",\n \"datePublished\": \"2022-02-09\"\n}\n"

2 changes: 1 addition & 1 deletion tests/testthat/test-build_lesson.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ test_that("sitemap exists", {


test_that("Metadata is recorded as the correct type", {
expect_match(metadata_json, "\"@type\": \"TrainingMaterial\"", fixed = TRUE)
expect_match(metadata_json, "\"@type\": \"LearningResource\"", fixed = TRUE)
})

test_that("Lesson websites contains metadata", {
Expand Down