diff --git a/examples/projects/valid/alma2lobid.json b/examples/project/valid/alma2lobid.json similarity index 71% rename from examples/projects/valid/alma2lobid.json rename to examples/project/valid/alma2lobid.json index 3fbdbfb0..3cd5fc6b 100644 --- a/examples/projects/valid/alma2lobid.json +++ b/examples/project/valid/alma2lobid.json @@ -1,7 +1,9 @@ { "@context": "https://schema.org/", "id": "https://github.com/hbz/lobid-resources/milestone/1", - "type": "Project", + "type": [ + "Project" + ], "name": { "de": "lobid/Alma-Migration", "en": "lobid/Alma Migration" @@ -10,5 +12,10 @@ "en": "Switch lobid-resources ETL and indexing from Aleph to Alma Marc21 XML", "de": "Umstieg von Aleph- auf Alma-MARC21-Daten bei Transformation und Indexierung für lobid-resources" }, - "url": "https://github.com/hbz/lobid-resources/milestone/1" + "url": "https://github.com/hbz/lobid-resources/milestone/1", + "enhances": [ + { + "id": "https://lobid.org" + } + ] } \ No newline at end of file diff --git a/examples/projects/valid/lrmi-profile.json b/examples/project/valid/lrmi-profile.json similarity index 94% rename from examples/projects/valid/lrmi-profile.json rename to examples/project/valid/lrmi-profile.json index a71487df..069d2357 100644 --- a/examples/projects/valid/lrmi-profile.json +++ b/examples/project/valid/lrmi-profile.json @@ -1,7 +1,9 @@ { "@context": "https://schema.org/", "id": "https://github.com/dini-ag-kim/lrmi-profile", - "type": "Project", + "type": [ + "Project" + ], "name": { "de": "LRMI-Metadatenprofil", "en": "LRMI Metadata Profile" diff --git a/examples/project/valid/metafacture-fix.json b/examples/project/valid/metafacture-fix.json new file mode 100644 index 00000000..c554abe4 --- /dev/null +++ b/examples/project/valid/metafacture-fix.json @@ -0,0 +1,21 @@ +{ + "@context": "https://schema.org/", + "id": "https://github.com/metafacture/metafacture-fix", + "type": [ + "Project" + ], + "name": { + "de": "Metafacture-Fix", + "en": "Metafacture-Fix" + }, + "description": { + "en": "Implementation of the Fix language for Metafacture as an alternative to configuring data transformations with Metamorph", + "de": "Das Projekt entwickelt und implementiert FIX als Metafacture Sprache. Diese soll als Alternative zu Metamorph für Datentransformation eingesetzt werden." + }, + "url": "https://github.com/metafacture/metafacture-fix", + "enhances": [ + { + "id": "https://metafacture.org" + } + ] +} \ No newline at end of file diff --git a/examples/projects/valid/metafacture-playground.json b/examples/project/valid/metafacture-playground.json similarity index 53% rename from examples/projects/valid/metafacture-playground.json rename to examples/project/valid/metafacture-playground.json index 3a49459f..48268521 100644 --- a/examples/projects/valid/metafacture-playground.json +++ b/examples/project/valid/metafacture-playground.json @@ -1,13 +1,21 @@ { "@context": "https://schema.org/", "id": "https://github.com/metafacture/metafacture-playground", - "type": "Project", + "type": [ + "Project" + ], "name": { "de": "Metafacture Playground", "en": "Metafacture Playground" }, "description": { - "en": "This projects aims to provide a web application to play around with Metafactures languages Fix and Flux." + "en": "This projects aims to provide a web application to play around with Metafactures languages Fix and Flux.", + "de": "Dieses Projekt entwickelt eine Web-Applikation, mit der man interaktiv die Metafacture-Sprachen Fix und Flux austesten kann." }, - "url": "https://github.com/metafacture/metafacture-playground" + "url": "https://github.com/metafacture/metafacture-playground", + "enhances": [ + { + "id": "https://metafacture.org" + } + ] } \ No newline at end of file diff --git a/examples/projects/valid/oersi.json b/examples/project/valid/oersi.json similarity index 72% rename from examples/projects/valid/oersi.json rename to examples/project/valid/oersi.json index f79a74bc..4c1488d9 100644 --- a/examples/projects/valid/oersi.json +++ b/examples/project/valid/oersi.json @@ -1,18 +1,22 @@ { "@context": "https://schema.org/", "id": "https://oersi.de", - "type": "Project", + "type": [ + "Project" + ], "name": { "de": "OER Search Index", "en": "OER Search Index" }, - "alternateName": { - "de": "OERSI", - "en": "OERSI" - }, + "alternateName": [ + "OERSI" + ], "description": { "de": "Ein gemeinsames Projekt der TIB Hannover und des hbz zum Aufbau eines offenen Suchindex für Bildungsressourcen", "en": "Common project by TIB Hannover and hbz to create an open search index for educational resources" }, - "url": "https://oersi.de" + "url": "https://oersi.de", + "isBasedOn": { + "id": "https://metafacture.org" + } } \ No newline at end of file diff --git a/examples/projects/valid/rpb.json b/examples/project/valid/rpb.json similarity index 94% rename from examples/projects/valid/rpb.json rename to examples/project/valid/rpb.json index d7a60fe9..e7df37ac 100644 --- a/examples/projects/valid/rpb.json +++ b/examples/project/valid/rpb.json @@ -1,7 +1,9 @@ { "@context": "https://schema.org/", "id": "https://github.com/hbz/rpb", - "type": "Project", + "type": [ + "Project" + ], "name": { "de": "Rheinland-Pfälzische Bibliographie", "en": "Bibliography of Rhineland-Platinate" diff --git a/examples/projects/valid/metafacture-fix.json b/examples/projects/valid/metafacture-fix.json deleted file mode 100644 index 6e51fd49..00000000 --- a/examples/projects/valid/metafacture-fix.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "@context": "https://schema.org/", - "id": "https://github.com/metafacture/metafacture-fix", - "type": "Project", - "name": { - "de": "Metafacture-Fix", - "en": "Metafacture-Fix" - }, - "description": { - "en": "Implementation of the Fix language for Metafacture as an alternative to configuring data transformations with Metamorph" - }, - "url": "https://github.com/metafacture/metafacture-fix" -} \ No newline at end of file diff --git a/schemas/enhances.json b/schemas/enhances.json new file mode 100644 index 00000000..515f9742 --- /dev/null +++ b/schemas/enhances.json @@ -0,0 +1,20 @@ +{ + "$id": "resource:/enhances.json", + "title": "product", + "description": "Schema to describe a product at lobid.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "$ref": "resource:/id.json" + }, + "name": { + "$ref": "resource:/name.json" + } + }, + "required": [ + "id" + ] + } +} \ No newline at end of file diff --git a/schemas/project.json b/schemas/project.json new file mode 100644 index 00000000..d7482dde --- /dev/null +++ b/schemas/project.json @@ -0,0 +1,49 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "resource:/project.json", + "title": "Project", + "description": "Schema to describe a project at lobid.", + "type": "object", + "properties": { + "id": { + "$ref": "resource:/id.json" + }, + "type": { + "type": "array", + "items": { + "type": "string", + "const": "Project" + } + }, + "alternateName": { + "$ref": "resource:/alternateName.json" + }, + "description": { + "$ref": "resource:/description.json" + }, + "name": { + "$ref": "resource:/name.json" + }, + "image": { + "$ref": "resource:/image.json" + }, + "startDate": { + "$ref": "resource:/startDate.json" + }, + "endDate": { + "$ref": "resource:/endDate.json" + }, + "enhances": { + "$ref": "resource:/enhances.json" + }, + "membership": { + "$ref": "resource:/membership.json" + } + }, + "required": [ + "id", + "name", + "type", + "description" + ] +} \ No newline at end of file diff --git a/test.sh b/test.sh index 66401073..7411dcc5 100644 --- a/test.sh +++ b/test.sh @@ -10,6 +10,8 @@ ajv test -s schemas/group.json -r "schemas/*.json" -d "examples/group/valid/*.js ajv test -s schemas/group.json -r "schemas/*.json" -d "examples/group/invalid/*.json" --invalid ajv test -s schemas/publication.json -r "schemas/*.json" -d "examples/publication/valid/*.json" --valid ajv test -s schemas/publication.json -r "schemas/*.json" -d "examples/publication/invalid/*.json" --invalid +ajv test -s schemas/project.json -r "schemas/*.json" -d "examples/project/valid/*.json" --valid +ajv test -s schemas/project.json -r "schemas/*.json" -d "examples/project/invalid/*.json" --invalid if [ $? -eq 0 ] then