Package Definition (h5p.json)
This page describes which properties that can be used in the h5p.json file, and which are optional.
Mandatory properties
The h5p.json file includes metadata and library dependencies for H5P content packages.
Mandatory fields should always be included in the h5p.json file. The following fields are mandatory:
- title - textual name
- mainLibrary - library name
- language - standard language
- preloadedDependencies - library dependencies
- embedTypes - embed container for library
title
The title of the H5P would typically be used on pages displaying it, and in system administration lists. This can be any valid string.
"title": "My Greeting card",
mainLibrary
The main H5P library for this content. This library will be initialized with the content data from the content folder.
"mainLibrary": "H5P.Boardgame",
language
A standard language code. We are using the ISO-639-1 to classify all supported languages. This is a two-letter code, for example 'en' for English. A list of ISO-639-1 codes can be found at Wikipedia. Set "und" for language neutral content.
"language": "und"
preloadedDependencies
Libraries that are used by this content type and needs to be preloaded for this content type to work. The dependencies are listed as objects with machineName, majorVersion, and minorVersion.
This field must at least contain the main library of the package.
"preloadedDependencies": [ { "machineName": "H5P.Boardgame", "majorVersion": 1, "minorVersion": 1 } ]
embedTypes
List of possible embedding methods for the H5P. Specify one or both of "div" and "iframe".
"embedTypes": ["div"]
Optional properties
The optional fields of the h5p.json file can be included, and should be included where applicable to make the library as informative as possible. The following properties are optional for the h5p.json file:
authors
The name and role of the content authors. Example:
"authors": [ { "name": "fnoks", "role": "Author" }, { "name": "Polly Ester", "role": "Originator" } ],
Valid values for "role" are:
- "Author"
- "Editor"
- "Licensee"
- "Originator"
source
The source (a URL) of the licensed material.
license
A code for the content license. The following license codes are recognized:
- "CC-BY" (wiki page for all Creative Commons licenses)
- "CC BY-SA"
- "CC BY-ND"
- "CC BY-NC"
- "CC BY-NC-SA"
- "CC CC-BY-NC-CD"
- "CC0 1.0"
- "GNU GPL"
- "PD"
- "ODC PDDL"
- "CC PDM"
- "C"
- "U" (Undisclosed)
licenseVersion
The version of the license above as a string. Possible values for CC licenses are:
- "1.0"
- "2.0"
- "2.5"
- "3.0"
- "4.0"
Possible values for the GNU GPL license are:
- "v1"
- "v2"
- "v3"
Possible values for the PD license are:
- "-"
- "CCO 1.0"
- "CC PDM"
licenseExtras
Any additional information about the license
yearFrom
If a license is valid for a certain period of time, this represents the start year (as a string).
yearTo
If a license is valid for a certain period of time, this represents the end year (as a string).
changes
The changelog. An example:
"changes": [ { "date": "02-07-19 11:27:00", "author": "fnoks", "log": "Initial version" } ]
authorComments
Comments for the editor of the content. This text will not be published as a part of copyright info.
A complete example
{ "title": "Fill in the blanks", "language": "en", "mainLibrary": "H5P.Blanks", "embedTypes": [ "div" ], "authors": [ { "name": "fnoks", "role": "Author" } ], "source": "https://example.org", "license": "CC BY-SA", "licenseVersion": "4.0", "licenseExtras": "Extra license information is found here", "yearFrom": "1950", "yearTo": "2050", "changes": [ { "date": "02-07-19 11:27:00", "author": "fnoks", "log": "Initial version" } ], "authorComments": "Author comments", "preloadedDependencies": [ { "machineName": "H5P.Blanks", "majorVersion": "1", "minorVersion": "0" } ] }
Comments
ralokt
Tue, 01/14/2020 - 18:49
Permalink
Author roles
What do the different roles mean? In particular, what is the difference between an author, an editor and an originator?
If there is an open source project I'd like to create an H5P content type for, what roles should the original authors and I have, respectively?
ralokt
Thu, 01/30/2020 - 12:58
Permalink
Re: Author roles
I guess I am going with the MARC relator definitions - please correct me if something else was intended.
For anyone who may have the same question in the future, the MARC definitions as found here [1]:
A person, family, or organization responsible for creating a work that is primarily textual in content, regardless of media type (e.g., printed text, spoken word, electronic text, tactile text) or genre (e.g., poems, novels, screenplays, blogs). Use also for persons, etc., creating a new work by paraphrasing, rewriting, or adapting works by another creator such that the modification has substantially changed the nature and content of the original or changed the medium of expression
A person, family, or organization contributing to a resource by revising or elucidating the content, e.g., adding an introduction, notes, or other critical matter. An editor may also prepare a resource for production, publication, or distribution. For major revisions, adaptations, etc., that substantially change the nature and content of the original work, resulting in a new work, see author
A person or organization who is an original recipient of the right to print or publish
A person or organization performing the work, i.e., the name of a person or organization associated with the intellectual content of the work. This category does not include the publisher or personal affiliation, or sponsor except where it is also the corporate author
I also assume that that makes the original author of the open source project the originator, and me the editor?
[1] https://www.loc.gov/marc/relators/relaterm.html
ralokt
Thu, 01/30/2020 - 13:03
Permalink
Licenses not in list (MIT, AGPL)
How should I deal with licenses that are not in the list? Specify "U" for now?
It strikes me as weird that the MIT license is not included, given that H5P itself is (mostly) MIT licensed.
Would it be appropriate to specify the AGPL v3 in the following way?
(...)license: "GPL",
licenseVersion: "v3",
licenseExtras: "AGPL",
(...)
bkihm
Tue, 05/25/2021 - 10:29
Permalink
On the Library Definition MIT is used as an example
According to the library definition documentation page MIT is also a possible value:
https://h5p.org/library-definition#liblicense
On this page they say also that the same license codes can be used as in the h5p.json license.
So the list is not complete at h5p.json license page?
bkihm
Tue, 05/25/2021 - 10:30
Permalink
On the Library Definition MIT is used as an example
According to the library definition documentation page MIT is also a possible value:
https://h5p.org/library-definition#liblicense
On this page they say also that the same license codes can be used as in the h5p.json license.
So the list is not complete at h5p.json license page?
bkihm
Tue, 05/25/2021 - 10:31
Permalink
On the Library Definition MIT is used as an example
According to the library definition documentation page MIT is also a possible value:
https://h5p.org/library-definition#liblicense
On this page they say also that the same license codes can be used as in the h5p.json license.
So the list is not complete at h5p.json license page?