From 2224f7c188422e2e1df4e14dc04d400d974468cd Mon Sep 17 00:00:00 2001 From: Adrian Pohl Date: Fri, 9 Oct 2020 15:06:43 +0200 Subject: [PATCH 1/2] Split up schema ...use links to raw files in branch as reference for testing. --- draft/schemas/Language.json | 193 ++++ draft/schemas/LocalizedString.json | 566 ++++++++++++ draft/schemas/about.json | 43 + draft/schemas/audience.json | 47 + draft/schemas/context-schema.json | 33 + draft/schemas/creator.json | 36 + draft/schemas/dateCreated.json | 11 + draft/schemas/description.json | 11 + draft/schemas/id.json | 11 + draft/schemas/image.json | 10 + draft/schemas/inLanguage.json | 10 + draft/schemas/isBasedOn.json | 14 + draft/schemas/learningResourceType.json | 40 + draft/schemas/license.json | 12 + draft/schemas/mainEntityOfPage.json | 57 ++ draft/schemas/name.json | 10 + draft/schemas/publisher.json | 36 + draft/schemas/schema.json | 1097 +---------------------- draft/schemas/type.json | 19 + 19 files changed, 1177 insertions(+), 1079 deletions(-) create mode 100644 draft/schemas/Language.json create mode 100644 draft/schemas/LocalizedString.json create mode 100644 draft/schemas/about.json create mode 100644 draft/schemas/audience.json create mode 100644 draft/schemas/context-schema.json create mode 100644 draft/schemas/creator.json create mode 100644 draft/schemas/dateCreated.json create mode 100644 draft/schemas/description.json create mode 100644 draft/schemas/id.json create mode 100644 draft/schemas/image.json create mode 100644 draft/schemas/inLanguage.json create mode 100644 draft/schemas/isBasedOn.json create mode 100644 draft/schemas/learningResourceType.json create mode 100644 draft/schemas/license.json create mode 100644 draft/schemas/mainEntityOfPage.json create mode 100644 draft/schemas/name.json create mode 100644 draft/schemas/publisher.json create mode 100644 draft/schemas/type.json diff --git a/draft/schemas/Language.json b/draft/schemas/Language.json new file mode 100644 index 0000000..564297e --- /dev/null +++ b/draft/schemas/Language.json @@ -0,0 +1,193 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/Language.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Language code", + "description": "An enumeration of ISO 639-1.conformant two-digit language codes.", + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mo", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "nvi", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "smi", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yo", + "za", + "zh", + "zu" + ] + } \ No newline at end of file diff --git a/draft/schemas/LocalizedString.json b/draft/schemas/LocalizedString.json new file mode 100644 index 0000000..11d775f --- /dev/null +++ b/draft/schemas/LocalizedString.json @@ -0,0 +1,566 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/LocalizedString.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Localized String", + "description": "A language-tagged string using JSON-LD \"language maps\", see https://www.w3.org/TR/json-ld/#language-maps", + "type": "object", + "properties": { + "aa": { + "type": "string" + }, + "ab": { + "type": "string" + }, + "ae": { + "type": "string" + }, + "af": { + "type": "string" + }, + "ak": { + "type": "string" + }, + "am": { + "type": "string" + }, + "an": { + "type": "string" + }, + "ar": { + "type": "string" + }, + "as": { + "type": "string" + }, + "av": { + "type": "string" + }, + "ay": { + "type": "string" + }, + "az": { + "type": "string" + }, + "ba": { + "type": "string" + }, + "be": { + "type": "string" + }, + "bg": { + "type": "string" + }, + "bh": { + "type": "string" + }, + "bi": { + "type": "string" + }, + "bm": { + "type": "string" + }, + "bn": { + "type": "string" + }, + "bo": { + "type": "string" + }, + "br": { + "type": "string" + }, + "bs": { + "type": "string" + }, + "ca": { + "type": "string" + }, + "ce": { + "type": "string" + }, + "ch": { + "type": "string" + }, + "co": { + "type": "string" + }, + "cr": { + "type": "string" + }, + "cs": { + "type": "string" + }, + "cu": { + "type": "string" + }, + "cv": { + "type": "string" + }, + "cy": { + "type": "string" + }, + "da": { + "type": "string" + }, + "de": { + "type": "string" + }, + "dv": { + "type": "string" + }, + "dz": { + "type": "string" + }, + "ee": { + "type": "string" + }, + "el": { + "type": "string" + }, + "en": { + "type": "string" + }, + "eo": { + "type": "string" + }, + "es": { + "type": "string" + }, + "et": { + "type": "string" + }, + "eu": { + "type": "string" + }, + "fa": { + "type": "string" + }, + "ff": { + "type": "string" + }, + "fi": { + "type": "string" + }, + "fj": { + "type": "string" + }, + "fo": { + "type": "string" + }, + "fr": { + "type": "string" + }, + "fy": { + "type": "string" + }, + "ga": { + "type": "string" + }, + "gd": { + "type": "string" + }, + "gl": { + "type": "string" + }, + "gn": { + "type": "string" + }, + "gu": { + "type": "string" + }, + "gv": { + "type": "string" + }, + "ha": { + "type": "string" + }, + "hi": { + "type": "string" + }, + "ho": { + "type": "string" + }, + "hr": { + "type": "string" + }, + "ht": { + "type": "string" + }, + "hu": { + "type": "string" + }, + "hy": { + "type": "string" + }, + "hz": { + "type": "string" + }, + "ia": { + "type": "string" + }, + "ie": { + "type": "string" + }, + "ig": { + "type": "string" + }, + "ii": { + "type": "string" + }, + "ik": { + "type": "string" + }, + "io": { + "type": "string" + }, + "is": { + "type": "string" + }, + "it": { + "type": "string" + }, + "iu": { + "type": "string" + }, + "ja": { + "type": "string" + }, + "jv": { + "type": "string" + }, + "ka": { + "type": "string" + }, + "kg": { + "type": "string" + }, + "ki": { + "type": "string" + }, + "kj": { + "type": "string" + }, + "kk": { + "type": "string" + }, + "kl": { + "type": "string" + }, + "km": { + "type": "string" + }, + "kn": { + "type": "string" + }, + "ko": { + "type": "string" + }, + "kr": { + "type": "string" + }, + "ks": { + "type": "string" + }, + "ku": { + "type": "string" + }, + "kv": { + "type": "string" + }, + "kw": { + "type": "string" + }, + "ky": { + "type": "string" + }, + "la": { + "type": "string" + }, + "lb": { + "type": "string" + }, + "lg": { + "type": "string" + }, + "li": { + "type": "string" + }, + "ln": { + "type": "string" + }, + "lo": { + "type": "string" + }, + "lt": { + "type": "string" + }, + "lu": { + "type": "string" + }, + "lv": { + "type": "string" + }, + "mg": { + "type": "string" + }, + "mh": { + "type": "string" + }, + "mi": { + "type": "string" + }, + "mk": { + "type": "string" + }, + "ml": { + "type": "string" + }, + "mn": { + "type": "string" + }, + "mo": { + "type": "string" + }, + "mr": { + "type": "string" + }, + "ms": { + "type": "string" + }, + "mt": { + "type": "string" + }, + "my": { + "type": "string" + }, + "na": { + "type": "string" + }, + "nb": { + "type": "string" + }, + "nd": { + "type": "string" + }, + "ne": { + "type": "string" + }, + "ng": { + "type": "string" + }, + "nl": { + "type": "string" + }, + "nn": { + "type": "string" + }, + "no": { + "type": "string" + }, + "nr": { + "type": "string" + }, + "nv": { + "type": "string" + }, + "nvi": { + "type": "string" + }, + "ny": { + "type": "string" + }, + "oc": { + "type": "string" + }, + "oj": { + "type": "string" + }, + "om": { + "type": "string" + }, + "or": { + "type": "string" + }, + "os": { + "type": "string" + }, + "pa": { + "type": "string" + }, + "pi": { + "type": "string" + }, + "pl": { + "type": "string" + }, + "ps": { + "type": "string" + }, + "pt": { + "type": "string" + }, + "qu": { + "type": "string" + }, + "rm": { + "type": "string" + }, + "rn": { + "type": "string" + }, + "ro": { + "type": "string" + }, + "ru": { + "type": "string" + }, + "rw": { + "type": "string" + }, + "sa": { + "type": "string" + }, + "sc": { + "type": "string" + }, + "sd": { + "type": "string" + }, + "se": { + "type": "string" + }, + "sg": { + "type": "string" + }, + "si": { + "type": "string" + }, + "sk": { + "type": "string" + }, + "sl": { + "type": "string" + }, + "sm": { + "type": "string" + }, + "smi": { + "type": "string" + }, + "sn": { + "type": "string" + }, + "so": { + "type": "string" + }, + "sq": { + "type": "string" + }, + "sr": { + "type": "string" + }, + "ss": { + "type": "string" + }, + "st": { + "type": "string" + }, + "su": { + "type": "string" + }, + "sv": { + "type": "string" + }, + "sw": { + "type": "string" + }, + "ta": { + "type": "string" + }, + "te": { + "type": "string" + }, + "tg": { + "type": "string" + }, + "th": { + "type": "string" + }, + "ti": { + "type": "string" + }, + "tk": { + "type": "string" + }, + "tl": { + "type": "string" + }, + "tn": { + "type": "string" + }, + "to": { + "type": "string" + }, + "tr": { + "type": "string" + }, + "ts": { + "type": "string" + }, + "tt": { + "type": "string" + }, + "tw": { + "type": "string" + }, + "ty": { + "type": "string" + }, + "ug": { + "type": "string" + }, + "uk": { + "type": "string" + }, + "ur": { + "type": "string" + }, + "uz": { + "type": "string" + }, + "ve": { + "type": "string" + }, + "vi": { + "type": "string" + }, + "vo": { + "type": "string" + }, + "wa": { + "type": "string" + }, + "wo": { + "type": "string" + }, + "xh": { + "type": "string" + }, + "yo": { + "type": "string" + }, + "za": { + "type": "string" + }, + "zh": { + "type": "string" + }, + "zu": { + "type": "string" + } + }, + "additionalProperties": false, + "suggested": [ + "de", + "en" + ] +} \ No newline at end of file diff --git a/draft/schemas/about.json b/draft/schemas/about.json new file mode 100644 index 0000000..a475caf --- /dev/null +++ b/draft/schemas/about.json @@ -0,0 +1,43 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/about.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Subject", + "description": "The subject of the learning resource, taken from Destatis classification", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Concept" + ] + }, + "id": { + "type": "string", + "format": "uri", + "pattern": "^https:\/\/w3id.org\/kim\/hochschulfaechersystematik\/.*" + }, + "inScheme": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "https://w3id.org/kim/hochschulfaechersystematik/scheme" + ] + } + } + }, + "prefLabel": { + "title": "The preferred label of the concept", + "description": "A localized string for prefLabel of a SKOS concept", + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/LocalizedString.json" + } + }, + "required": [ + "id" + ], + "_widget": "SkohubLookup" + } + } \ No newline at end of file diff --git a/draft/schemas/audience.json b/draft/schemas/audience.json new file mode 100644 index 0000000..e75313a --- /dev/null +++ b/draft/schemas/audience.json @@ -0,0 +1,47 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/audience.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Intended Audience", + "description": "The audience the educational resource is intended for.", + "type": "array", + "items": { + "type": "object", + "_widget": { + "type": "SkohubLookup", + "options": { + "url": "https://skohub.io/acka47/lrmi-audience-role/heads/master/purl.org/dcx/lrmi-vocabs/educationalAudienceRole/" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "Concept" + ] + }, + "id": { + "type": "string", + "format": "uri" + }, + "inScheme": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/" + ] + } + } + }, + "prefLabel": { + "title": "The preferred label of the concept", + "description": "A localized string for prefLabel of a SKOS concept", + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/LocalizedString.json" + } + }, + "required": [ + "id" + ] + } + } \ No newline at end of file diff --git a/draft/schemas/context-schema.json b/draft/schemas/context-schema.json new file mode 100644 index 0000000..40a9453 --- /dev/null +++ b/draft/schemas/context-schema.json @@ -0,0 +1,33 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/context-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSON-LD Context", + "description": "The JSON-LD context for the structured resource descriptions", + "type": "array", + "minItems": 2, + "items": [ + { + "type": "string", + "format": "uri", + "enum": [ + "https://w3id.org/kim/lrmi-profile/draft/context.jsonld" + ] + }, + { + "type": "object", + "properties": { + "@language": { + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/Language.json" + } + }, + "additionalProperties": false, + "required": [ + "@language" + ] + } + ], + "additionalItems": true, + "_display": { + "className": "hidden" + } + } \ No newline at end of file diff --git a/draft/schemas/creator.json b/draft/schemas/creator.json new file mode 100644 index 0000000..84773af --- /dev/null +++ b/draft/schemas/creator.json @@ -0,0 +1,36 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/creator.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Creator", + "description": "The creator(s) of the learning resource", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Type", + "type": "string", + "enum": [ + "Person", + "Organization" + ] + }, + "id": { + "title": "URL", + "type": "string", + "format": "uri" + }, + "name": { + "title": "Name", + "type": "string", + "_display": { + "placeholder": "The creator's name" + } + } + }, + "required": [ + "name", + "type" + ] + } + } \ No newline at end of file diff --git a/draft/schemas/dateCreated.json b/draft/schemas/dateCreated.json new file mode 100644 index 0000000..b16c720 --- /dev/null +++ b/draft/schemas/dateCreated.json @@ -0,0 +1,11 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/dateCreated.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Creation Date", + "description": "The creation date", + "type": "string", + "format": "date", + "_display": { + "placeholder": "YYYY-MM-DD" + } + } \ No newline at end of file diff --git a/draft/schemas/description.json b/draft/schemas/description.json new file mode 100644 index 0000000..33a80d7 --- /dev/null +++ b/draft/schemas/description.json @@ -0,0 +1,11 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/description.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Description", + "description": "A description of the learning resource", + "type": "string", + "_display": { + "rows": 5, + "placeholder": "A short description of the resource" + } +} \ No newline at end of file diff --git a/draft/schemas/id.json b/draft/schemas/id.json new file mode 100644 index 0000000..07a945b --- /dev/null +++ b/draft/schemas/id.json @@ -0,0 +1,11 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/id.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "URL", + "description": "The URL/URI of the resource", + "type": "string", + "format": "uri", + "_display": { + "placeholder": "The URL of the resource" + } +} \ No newline at end of file diff --git a/draft/schemas/image.json b/draft/schemas/image.json new file mode 100644 index 0000000..c1b890c --- /dev/null +++ b/draft/schemas/image.json @@ -0,0 +1,10 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/image.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Image", + "type": "string", + "format": "uri", + "_display": { + "placeholder": "A link to an image of the resource" + } +} \ No newline at end of file diff --git a/draft/schemas/inLanguage.json b/draft/schemas/inLanguage.json new file mode 100644 index 0000000..56e3ddf --- /dev/null +++ b/draft/schemas/inLanguage.json @@ -0,0 +1,10 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/inLanguage.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Language", + "description": "The language of the learning resource", + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/Language.json", + "_display": { + "placeholder": "The language of the resource" + } + } \ No newline at end of file diff --git a/draft/schemas/isBasedOn.json b/draft/schemas/isBasedOn.json new file mode 100644 index 0000000..ed37461 --- /dev/null +++ b/draft/schemas/isBasedOn.json @@ -0,0 +1,14 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/isBasedOn.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Based on", + "description": "Resources the described learning resources derived from.", + "type": "array", + "items": { + "type": "string", + "format": "uri", + "_display": { + "placeholder": "The URL of a resource this OER is based on" + } + } + } \ No newline at end of file diff --git a/draft/schemas/learningResourceType.json b/draft/schemas/learningResourceType.json new file mode 100644 index 0000000..035b49a --- /dev/null +++ b/draft/schemas/learningResourceType.json @@ -0,0 +1,40 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/learningResourceType.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Learning Resource Type", + "description": "The learning resource type of the resouce, taken from the controlled HCRT list." + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Concept" + ] + }, + "id": { + "type": "string", + "format": "uri", + "pattern": "^https:\/\/w3id.org\/kim\/hcrt\/.*" + }, + "inScheme": { + "type": "object", + "properties": { + "id": { + "type": "string", + "enum": [ + "https://w3id.org/kim/hcrt/scheme" + ] + } + } + }, + "prefLabel": { + "title": "The preferred label of the concept", + "description": "A localized string for prefLabel of a SKOS concept", + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/LocalizedString.json" + } + }, + "required": [ + "id" + ], + "_widget": "SkohubLookup" + } \ No newline at end of file diff --git a/draft/schemas/license.json b/draft/schemas/license.json new file mode 100644 index 0000000..22e7126 --- /dev/null +++ b/draft/schemas/license.json @@ -0,0 +1,12 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/license.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "License", + "description": "A link to a CreativeCommons license", + "type": "string", + "format": "uri", + "pattern": "^https:\/\/creativecommons.org\/(licenses|licences|publicdomain)\/.*", + "_display": { + "placeholder": "URL of the Creative Commons license" + } +} \ No newline at end of file diff --git a/draft/schemas/mainEntityOfPage.json b/draft/schemas/mainEntityOfPage.json new file mode 100644 index 0000000..8fe26b5 --- /dev/null +++ b/draft/schemas/mainEntityOfPage.json @@ -0,0 +1,57 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/mainEntityOfPage.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Metadata/Structured descriptions", + "description": "This object contains metametadata, i.e. information about the structured description(s) of the OER and its source(s).", + "type": "array", + "_display": { + "className": "hidden" + }, + "items": { + "type": "object", + "properties": { + "id": { + "title": "URL of the metadata", + "type": "string", + "format": "uri" + }, + "type": { + "type": "string" + }, + "provider": { + "title": "Metadata provider", + "description": "Quelle, von der die strukturierte Beschreibung (=Metadaten) zu dieser Ressource zur Verfügung gestellt werden.", + "type": "object", + "properties": { + "id": { + "title": "URI für den Provider", + "type": "string", + "format": "uri" + }, + "type": { + "title": "Typ", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "id" + ] + }, + "dateCreated": { + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/dateCreated.json" + }, + "dateModified": { + "title": "Date of last modification of the metadata", + "type": "string", + "format": "date" + } + }, + "required": [ + "id" + ] + } + } \ No newline at end of file diff --git a/draft/schemas/name.json b/draft/schemas/name.json new file mode 100644 index 0000000..5a3d67b --- /dev/null +++ b/draft/schemas/name.json @@ -0,0 +1,10 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/name.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Title", + "description": "The title of the lerarning resource", + "type": "string", + "_display": { + "rows": 2 + } +} \ No newline at end of file diff --git a/draft/schemas/publisher.json b/draft/schemas/publisher.json new file mode 100644 index 0000000..2573af2 --- /dev/null +++ b/draft/schemas/publisher.json @@ -0,0 +1,36 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/publisher.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Publisher", + "description": "The publisher of the educational resource", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "title": "Type", + "type": "string", + "enum": [ + "Organization" + ] + }, + "id": { + "title": "URL", + "description": "The URL/URI of the publisher, preferably from GND, Wikidata or RoR.", + "type": "string", + "format": "uri" + }, + "name": { + "title": "Name", + "type": "string", + "_display": { + "placeholder": "The publisher's name" + } + } + }, + "required": [ + "name", + "type" + ] + } + } \ No newline at end of file diff --git a/draft/schemas/schema.json b/draft/schemas/schema.json index 005ec8f..9e17a9f 100644 --- a/draft/schemas/schema.json +++ b/draft/schemas/schema.json @@ -10,1118 +10,57 @@ }, "properties": { "@context": { - "type": "array", - "minItems": 2, - "items": [ - { - "type": "string", - "format": "uri", - "enum": [ - "https://w3id.org/kim/lrmi-profile/draft/context.jsonld" - ] - }, - { - "type": "object", - "properties": { - "@language": { - "$ref": "#/definitions/Language" - } - }, - "additionalProperties": false, - "required": [ - "@language" - ] - } - ], - "additionalItems": true, - "_display": { - "className": "hidden" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/context-schema.json" }, "id": { - "title": "URL", - "type": "string", - "format": "uri", - "_display": { - "placeholder": "The URL of the resource" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/id.json" }, "type": { - "title": "Type", - "type": "string", - "default": "CreativeWork", - "enum": [ - "AudioObject", - "Book", - "Course", - "CreativeWork", - "DataDownload", - "ImageObject", - "PresentationDigitalDocument", - "SoftwareApplication", - "VideoObject" - ] + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/type.json" }, "name": { - "title": "Title", - "type": "string", - "_display": { - "rows": 2 - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/name.json" }, "creator": { - "title": "Creator", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "title": "Type", - "type": "string", - "enum": [ - "Person", - "Organization" - ] - }, - "id": { - "title": "URL", - "type": "string", - "format": "uri" - }, - "name": { - "title": "Name", - "type": "string", - "_display": { - "placeholder": "The creator's name" - } - } - }, - "required": [ - "name", - "type" - ] - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/creator.json" }, "description": { - "title": "Description", - "type": "string", - "_display": { - "rows": 5, - "placeholder": "A short description of the resource" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/description.json" }, "about": { - "title": "Subject", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "Concept" - ] - }, - "id": { - "type": "string", - "format": "uri", - "pattern": "^https:\/\/w3id.org\/kim\/hochschulfaechersystematik\/.*" - }, - "inScheme": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "https://w3id.org/kim/hochschulfaechersystematik/scheme" - ] - } - } - }, - "prefLabel": { - "title": "The preferred label of the concept", - "description": "A localized string for prefLabel of a SKOS concept", - "$ref": "#/definitions/LocalizedString" - } - }, - "required": [ - "id" - ], - "_widget": "SkohubLookup" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/about.json" }, "license": { - "title": "License", - "type": "string", - "format": "uri", - "pattern": "^https:\/\/creativecommons.org\/(licenses|licences|publicdomain)\/.*", - "_display": { - "placeholder": "URL of the Creative Commons license" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/license.json" }, "image": { - "title": "Image", - "type": "string", - "format": "uri", - "_display": { - "placeholder": "A link to an image of the resource" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/image.json" }, "dateCreated": { - "title": "Creation Date", - "type": "string", - "format": "date", - "_display": { - "placeholder": "YYYY-MM-DD" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/dateCreated.json" }, "inLanguage": { - "title": "Language", - "$ref": "#/definitions/Language", - "_display": { - "placeholder": "The language of the resource" - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/inLanguage.json" }, "publisher": { - "title": "Publisher", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "title": "Type", - "type": "string", - "enum": [ - "Organization" - ] - }, - "id": { - "title": "URL", - "type": "string", - "format": "uri" - }, - "name": { - "title": "Name", - "type": "string", - "_display": { - "placeholder": "The publisher's name" - } - } - }, - "required": [ - "name", - "type" - ] - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/publisher.json" }, "learningResourceType": { - "title": "Learning Resource Type", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "Concept" - ] - }, - "id": { - "type": "string", - "format": "uri", - "pattern": "^https:\/\/w3id.org\/kim\/hcrt\/.*" - }, - "inScheme": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "https://w3id.org/kim/hcrt/scheme" - ] - } - } - }, - "prefLabel": { - "title": "The preferred label of the concept", - "description": "A localized string for prefLabel of a SKOS concept", - "$ref": "#/definitions/LocalizedString" - } - }, - "required": [ - "id" - ], - "_widget": "SkohubLookup" + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/learningResourceType.json" }, "audience": { - "title": "Intended Audience", - "type": "array", - "items": { - "type": "object", - "_widget": { - "type": "SkohubLookup", - "options": { - "url": "https://skohub.io/acka47/lrmi-audience-role/heads/master/purl.org/dcx/lrmi-vocabs/educationalAudienceRole/" - } - }, - "properties": { - "type": { - "type": "string", - "enum": [ - "Concept" - ] - }, - "id": { - "type": "string", - "format": "uri" - }, - "inScheme": { - "type": "object", - "properties": { - "id": { - "type": "string", - "enum": [ - "http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/" - ] - } - } - }, - "prefLabel": { - "title": "The preferred label of the concept", - "description": "A localized string for prefLabel of a SKOS concept", - "$ref": "#/definitions/LocalizedString" - } - }, - "required": [ - "id" - ] - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/audience.json" }, "isBasedOn": { - "title": "Based on", - "type": "array", - "items": { - "type": "string", - "format": "uri", - "_display": { - "placeholder": "The URL of a resource this OER is based on" - } - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/isBasedOn.json" }, "mainEntityOfPage": { - "title": "Metadata/Structured descriptions", - "description": "This object contains metametadata, i.e. information about the structured description(s) of the OER and its source(s).", - "type": "array", - "_display": { - "className": "hidden" - }, - "items": { - "type": "object", - "properties": { - "id": { - "title": "URL of the metadata", - "type": "string", - "format": "uri" - }, - "type": { - "type": "string" - }, - "provider": { - "title": "Metadata provider", - "description": "Quelle, von der die strukturierte Beschreibung (=Metadaten) zu dieser Ressource zur Verfügung gestellt werden.", - "type": "object", - "properties": { - "id": { - "title": "URI für den Provider", - "type": "string", - "format": "uri" - }, - "type": { - "title": "Typ", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "id" - ] - }, - "dateCreated": { - "title": "Creation Date of the metadata", - "type": "string", - "format": "date" - }, - "dateModified": { - "title": "Date of last modification of the metadata", - "type": "string", - "format": "date" - } - }, - "required": [ - "id" - ] - } + "$ref": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/mainEntityOfPage.json" } }, "required": [ "@context", "id", "name" - ], - "definitions": { - "Language": { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bh", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mo", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "nvi", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "smi", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yo", - "za", - "zh", - "zu" - ] - }, - "LocalizedString": { - "title": "Localized String", - "description": "A language-tagged string using JSON-LD \"language maps\", see https://www.w3.org/TR/json-ld/#language-maps", - "type": "object", - "properties": { - "aa": { - "type": "string" - }, - "ab": { - "type": "string" - }, - "ae": { - "type": "string" - }, - "af": { - "type": "string" - }, - "ak": { - "type": "string" - }, - "am": { - "type": "string" - }, - "an": { - "type": "string" - }, - "ar": { - "type": "string" - }, - "as": { - "type": "string" - }, - "av": { - "type": "string" - }, - "ay": { - "type": "string" - }, - "az": { - "type": "string" - }, - "ba": { - "type": "string" - }, - "be": { - "type": "string" - }, - "bg": { - "type": "string" - }, - "bh": { - "type": "string" - }, - "bi": { - "type": "string" - }, - "bm": { - "type": "string" - }, - "bn": { - "type": "string" - }, - "bo": { - "type": "string" - }, - "br": { - "type": "string" - }, - "bs": { - "type": "string" - }, - "ca": { - "type": "string" - }, - "ce": { - "type": "string" - }, - "ch": { - "type": "string" - }, - "co": { - "type": "string" - }, - "cr": { - "type": "string" - }, - "cs": { - "type": "string" - }, - "cu": { - "type": "string" - }, - "cv": { - "type": "string" - }, - "cy": { - "type": "string" - }, - "da": { - "type": "string" - }, - "de": { - "type": "string" - }, - "dv": { - "type": "string" - }, - "dz": { - "type": "string" - }, - "ee": { - "type": "string" - }, - "el": { - "type": "string" - }, - "en": { - "type": "string" - }, - "eo": { - "type": "string" - }, - "es": { - "type": "string" - }, - "et": { - "type": "string" - }, - "eu": { - "type": "string" - }, - "fa": { - "type": "string" - }, - "ff": { - "type": "string" - }, - "fi": { - "type": "string" - }, - "fj": { - "type": "string" - }, - "fo": { - "type": "string" - }, - "fr": { - "type": "string" - }, - "fy": { - "type": "string" - }, - "ga": { - "type": "string" - }, - "gd": { - "type": "string" - }, - "gl": { - "type": "string" - }, - "gn": { - "type": "string" - }, - "gu": { - "type": "string" - }, - "gv": { - "type": "string" - }, - "ha": { - "type": "string" - }, - "hi": { - "type": "string" - }, - "ho": { - "type": "string" - }, - "hr": { - "type": "string" - }, - "ht": { - "type": "string" - }, - "hu": { - "type": "string" - }, - "hy": { - "type": "string" - }, - "hz": { - "type": "string" - }, - "ia": { - "type": "string" - }, - "ie": { - "type": "string" - }, - "ig": { - "type": "string" - }, - "ii": { - "type": "string" - }, - "ik": { - "type": "string" - }, - "io": { - "type": "string" - }, - "is": { - "type": "string" - }, - "it": { - "type": "string" - }, - "iu": { - "type": "string" - }, - "ja": { - "type": "string" - }, - "jv": { - "type": "string" - }, - "ka": { - "type": "string" - }, - "kg": { - "type": "string" - }, - "ki": { - "type": "string" - }, - "kj": { - "type": "string" - }, - "kk": { - "type": "string" - }, - "kl": { - "type": "string" - }, - "km": { - "type": "string" - }, - "kn": { - "type": "string" - }, - "ko": { - "type": "string" - }, - "kr": { - "type": "string" - }, - "ks": { - "type": "string" - }, - "ku": { - "type": "string" - }, - "kv": { - "type": "string" - }, - "kw": { - "type": "string" - }, - "ky": { - "type": "string" - }, - "la": { - "type": "string" - }, - "lb": { - "type": "string" - }, - "lg": { - "type": "string" - }, - "li": { - "type": "string" - }, - "ln": { - "type": "string" - }, - "lo": { - "type": "string" - }, - "lt": { - "type": "string" - }, - "lu": { - "type": "string" - }, - "lv": { - "type": "string" - }, - "mg": { - "type": "string" - }, - "mh": { - "type": "string" - }, - "mi": { - "type": "string" - }, - "mk": { - "type": "string" - }, - "ml": { - "type": "string" - }, - "mn": { - "type": "string" - }, - "mo": { - "type": "string" - }, - "mr": { - "type": "string" - }, - "ms": { - "type": "string" - }, - "mt": { - "type": "string" - }, - "my": { - "type": "string" - }, - "na": { - "type": "string" - }, - "nb": { - "type": "string" - }, - "nd": { - "type": "string" - }, - "ne": { - "type": "string" - }, - "ng": { - "type": "string" - }, - "nl": { - "type": "string" - }, - "nn": { - "type": "string" - }, - "no": { - "type": "string" - }, - "nr": { - "type": "string" - }, - "nv": { - "type": "string" - }, - "nvi": { - "type": "string" - }, - "ny": { - "type": "string" - }, - "oc": { - "type": "string" - }, - "oj": { - "type": "string" - }, - "om": { - "type": "string" - }, - "or": { - "type": "string" - }, - "os": { - "type": "string" - }, - "pa": { - "type": "string" - }, - "pi": { - "type": "string" - }, - "pl": { - "type": "string" - }, - "ps": { - "type": "string" - }, - "pt": { - "type": "string" - }, - "qu": { - "type": "string" - }, - "rm": { - "type": "string" - }, - "rn": { - "type": "string" - }, - "ro": { - "type": "string" - }, - "ru": { - "type": "string" - }, - "rw": { - "type": "string" - }, - "sa": { - "type": "string" - }, - "sc": { - "type": "string" - }, - "sd": { - "type": "string" - }, - "se": { - "type": "string" - }, - "sg": { - "type": "string" - }, - "si": { - "type": "string" - }, - "sk": { - "type": "string" - }, - "sl": { - "type": "string" - }, - "sm": { - "type": "string" - }, - "smi": { - "type": "string" - }, - "sn": { - "type": "string" - }, - "so": { - "type": "string" - }, - "sq": { - "type": "string" - }, - "sr": { - "type": "string" - }, - "ss": { - "type": "string" - }, - "st": { - "type": "string" - }, - "su": { - "type": "string" - }, - "sv": { - "type": "string" - }, - "sw": { - "type": "string" - }, - "ta": { - "type": "string" - }, - "te": { - "type": "string" - }, - "tg": { - "type": "string" - }, - "th": { - "type": "string" - }, - "ti": { - "type": "string" - }, - "tk": { - "type": "string" - }, - "tl": { - "type": "string" - }, - "tn": { - "type": "string" - }, - "to": { - "type": "string" - }, - "tr": { - "type": "string" - }, - "ts": { - "type": "string" - }, - "tt": { - "type": "string" - }, - "tw": { - "type": "string" - }, - "ty": { - "type": "string" - }, - "ug": { - "type": "string" - }, - "uk": { - "type": "string" - }, - "ur": { - "type": "string" - }, - "uz": { - "type": "string" - }, - "ve": { - "type": "string" - }, - "vi": { - "type": "string" - }, - "vo": { - "type": "string" - }, - "wa": { - "type": "string" - }, - "wo": { - "type": "string" - }, - "xh": { - "type": "string" - }, - "yo": { - "type": "string" - }, - "za": { - "type": "string" - }, - "zh": { - "type": "string" - }, - "zu": { - "type": "string" - } - }, - "additionalProperties": false, - "suggested": [ - "de", - "en" - ] - } - } -} + ] +} \ No newline at end of file diff --git a/draft/schemas/type.json b/draft/schemas/type.json new file mode 100644 index 0000000..a955ccf --- /dev/null +++ b/draft/schemas/type.json @@ -0,0 +1,19 @@ +{ + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/id.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Type", + "description": "The type (rdf:type / @type) of the learning resource, taken from sub-classes of sdo:CreativeWork.", + "type": "string", + "default": "CreativeWork", + "enum": [ + "AudioObject", + "Book", + "Course", + "CreativeWork", + "DataDownload", + "ImageObject", + "PresentationDigitalDocument", + "SoftwareApplication", + "VideoObject" + ] +} \ No newline at end of file From e134e203249c8a6b7027978c61ec453094003528 Mon Sep 17 00:00:00 2001 From: Adrian Pohl Date: Fri, 9 Oct 2020 15:29:28 +0200 Subject: [PATCH 2/2] Adjust test script (somebody will have to fix it properly later) --- draft/schemas/learningResourceType.json | 2 +- draft/schemas/type.json | 2 +- test.sh | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/draft/schemas/learningResourceType.json b/draft/schemas/learningResourceType.json index 035b49a..5835c46 100644 --- a/draft/schemas/learningResourceType.json +++ b/draft/schemas/learningResourceType.json @@ -2,7 +2,7 @@ "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/learningResourceType.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Learning Resource Type", - "description": "The learning resource type of the resouce, taken from the controlled HCRT list." + "description": "The learning resource type of the resouce, taken from the controlled HCRT list.", "type": "object", "properties": { "type": { diff --git a/draft/schemas/type.json b/draft/schemas/type.json index a955ccf..2b063ca 100644 --- a/draft/schemas/type.json +++ b/draft/schemas/type.json @@ -1,5 +1,5 @@ { - "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/id.json", + "$id": "https://raw.githubusercontent.com/dini-ag-kim/lrmi-profile/23-modularize/draft/schemas/type.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Type", "description": "The type (rdf:type / @type) of the learning resource, taken from sub-classes of sdo:CreativeWork.", diff --git a/test.sh b/test.sh index c118176..5bc4b5f 100644 --- a/test.sh +++ b/test.sh @@ -6,13 +6,13 @@ set -e for version in "draft"; do echo "Testing version: $version" - for schema_file in `ls $version/schemas`; do - echo "Testing $schema_file" - schema_name=$(echo "$schema_file" | cut -f 1 -d '.') - ajv test -s $version/schemas/$schema_file -d "$version/examples/valid/*.json" --valid - ajv test -s $version/schemas/$schema_file -d "$version/examples/invalid/*.json" --invalid - echo "" - done +# for ` $version/schemas/schema.json`; do +# echo "Testing $schema_file" +# schema_name=$(echo "$schema_file" | cut -f 1 -d '.') + ajv test -s $version/schemas/schema.json -r "$version/schemas/*.json" -d "$version/examples/valid/*.json" --valid + ajv test -s $version/schemas/schema.json -r "$version/schemas/*.json" -d "$version/examples/invalid/*.json" --invalid +# echo "" +# done done if [ $? -eq 0 ]