From 854cc118b391898f650691bd09cbd2ab8fea6202 Mon Sep 17 00:00:00 2001
From: Vuillaume <thomas.vuillaume@lapp.in2p3.fr>
Date: Mon, 27 Sep 2021 08:36:16 +0000
Subject: [PATCH] Update .zenodo.json with complete schema from
 https://zenodo.org/schemas/records/record-v1.0.0.json

---
 eossr/metadata/schema/.zenodo.json  | 1138 +++++++++++++++++++++++++--
 eossr/metadata/schema/__init__.py   |   11 +
 eossr/metadata/schema/codemeta.json |  146 ++--
 eossr/metadata/tests/test_schema.py |   10 +
 setup.py                            |    7 +-
 5 files changed, 1198 insertions(+), 114 deletions(-)
 create mode 100644 eossr/metadata/schema/__init__.py
 create mode 100644 eossr/metadata/tests/test_schema.py

diff --git a/eossr/metadata/schema/.zenodo.json b/eossr/metadata/schema/.zenodo.json
index 91889f9d..5d0dfeb1 100644
--- a/eossr/metadata/schema/.zenodo.json
+++ b/eossr/metadata/schema/.zenodo.json
@@ -1,46 +1,1096 @@
 {
-  "title": "For details check https://developers.zenodo.org/#representation.",
-  "upload_type": "software",
-  "access_right": "open",
-  "publication_date": "YYYY-MM-DD",
-  "communities": [{"identifier": "escape2020"}],
-  "grants": [{"id": "10.13039/501100000780::824064"}],
-  "creators": [
-    {"name": "Name and Surname",
-      "affiliation": "Institute, Center",
-      "orcid": "0000-0000-0000-0000"}
+  "$schema": "http://json-schema.org/draft-04/schema#",
+  "additionalProperties": false,
+  "definitions": {
+    "contributor_person_or_org": {
+      "additionalProperties": false,
+      "properties": {
+        "affiliation": {
+          "description": "Affiliation for the purpose of this specific record.",
+          "type": "string"
+        },
+        "familyname": {
+          "description": "Family name of person if known.",
+          "type": "string"
+        },
+        "givennames": {
+          "description": "Given names of person if known.",
+          "type": "string"
+        },
+        "gnd": {
+          "description": "Gemeinsame Normdatei identifier for creator.",
+          "type": "string"
+        },
+        "name": {
+          "description": "Full name of person or organisation. Personal name format: family, given.",
+          "type": "string"
+        },
+        "orcid": {
+          "description": "ORCID identifier for creator.",
+          "type": "string"
+        },
+        "type": {
+          "enum": [
+            "ContactPerson",
+            "DataCollector",
+            "DataCurator",
+            "DataManager",
+            "Distributor",
+            "Editor",
+            "HostingInstitution",
+            "Other",
+            "Producer",
+            "ProjectLeader",
+            "ProjectManager",
+            "ProjectMember",
+            "RegistrationAgency",
+            "RegistrationAuthority",
+            "RelatedPerson",
+            "Researcher",
+            "ResearchGroup",
+            "RightsHolder",
+            "Sponsor",
+            "Supervisor",
+            "WorkPackageLeader"
+          ],
+          "type": "string"
+        }
+      },
+      "required": [
+        "name",
+        "type"
+      ],
+      "type": "object"
+    },
+    "person_or_org": {
+      "additionalProperties": false,
+      "properties": {
+        "affiliation": {
+          "description": "Affiliation for the purpose of this specific record.",
+          "type": "string"
+        },
+        "familyname": {
+          "description": "Family name of person if known.",
+          "type": "string"
+        },
+        "givennames": {
+          "description": "Given names of person if known.",
+          "type": "string"
+        },
+        "gnd": {
+          "description": "Gemeinsame Normdatei identifier for creator.",
+          "type": "string"
+        },
+        "name": {
+          "description": "Full name of person or organisation. Personal name format: family, given.",
+          "type": "string"
+        },
+        "orcid": {
+          "description": "ORCID identifier for creator.",
+          "type": "string"
+        }
+      },
+      "required": [
+        "name"
+      ],
+      "type": "object"
+    },
+    "relation": {
+      "description": "Relation type.",
+      "enum": [
+        "isCitedBy",
+        "cites",
+        "isSupplementTo",
+        "isSupplementedBy",
+        "isContinuedBy",
+        "continues",
+        "isDescribedBy",
+        "describes",
+        "hasMetadata",
+        "isMetadataFor",
+        "isNewVersionOf",
+        "isPreviousVersionOf",
+        "isPartOf",
+        "hasPart",
+        "isReferencedBy",
+        "references",
+        "isDocumentedBy",
+        "documents",
+        "isCompiledBy",
+        "compiles",
+        "isVariantFormOf",
+        "isOrignialFormOf",
+        "isIdenticalTo",
+        "isReviewedBy",
+        "reviews",
+        "isDerivedFrom",
+        "isSourceOf",
+        "requires",
+        "isRequiredBy",
+        "isObsoletedBy",
+        "obsoletes",
+        "isPublishedIn"
+      ],
+      "type": "string"
+    },
+    "scheme": {
+      "description": "Persistent identifier scheme.",
+      "enum": [
+        "ads",
+        "ark",
+        "arxiv",
+        "bioproject",
+        "biosample",
+        "doi",
+        "ean13",
+        "ean8",
+        "ensembl",
+        "genome",
+        "gnd",
+        "hal",
+        "handle",
+        "isbn",
+        "isni",
+        "issn",
+        "istc",
+        "lsid",
+        "orcid",
+        "pmcid",
+        "pmid",
+        "purl",
+        "refseq",
+        "sra",
+        "uniprot",
+        "url",
+        "urn",
+        "swh",
+        "ascl"
+      ],
+      "type": "string"
+    }
+  },
+  "id": "http://zenodo.org/schemas/records/record-v1.0.0.json",
+  "properties": {
+    "$schema": {
+      "type": "string"
+    },
+    "_buckets": {
+      "properties": {
+        "deposit": {
+          "description": "UUID of the deposit bucket.",
+          "type": "string"
+        },
+        "extra_formats": {
+          "description": "UUID of the extra formats bucket.",
+          "type": "string"
+        },
+        "record": {
+          "description": "UUID of the record bucket.",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "_deposit": {
+      "description": "Internal deposit metadata.",
+      "name": "_deposit",
+      "properties": {
+        "created_by": {
+          "description": "ID of user that created the deposit.",
+          "name": "created_by",
+          "title": "Creator",
+          "type": "integer"
+        },
+        "id": {
+          "description": "Identifier of the deposit - usually the value of corresponding 'depid'-type PID.",
+          "name": "id",
+          "title": "Persistent Identifier of the deposit",
+          "type": "string"
+        },
+        "owners": {
+          "description": "Owners of the deposit (a list of user's IDs).",
+          "items": [
+            {
+              "type": "integer"
+            }
+          ],
+          "name": "owners",
+          "title": "Owners",
+          "type": "array"
+        },
+        "pid": {
+          "description": "Identifier of the published record - usually the type and value of a 'recid'-type PID of the corresponding published record.",
+          "name": "pid",
+          "properties": {
+            "revision_id": {
+              "description": "ID of the RecordMetadata revision. Used for record merging.",
+              "title": "Record Revision ID",
+              "type": "integer"
+            },
+            "type": {
+              "description": "Type of the PID, in correspondece with PID's 'pid_type' property.",
+              "title": "PID Type",
+              "type": "string"
+            },
+            "value": {
+              "description": "Value of the PID, in correspondece with PID's 'pid_value' property.",
+              "title": "PID Value",
+              "type": "string"
+            }
+          },
+          "title": "Persistent identifier of the published record",
+          "type": "object"
+        },
+        "status": {
+          "description": "Status of the deposit, either 'draft' or 'published'.",
+          "enum": [
+            "draft",
+            "published"
+          ],
+          "name": "status",
+          "title": "Status",
+          "type": "string"
+        }
+      },
+      "required": [
+        "id"
+      ],
+      "title": "Deposit",
+      "type": "object"
+    },
+    "_files": {
+      "description": "List of files attached to the record.",
+      "items": {
+        "description": "Describes the information of a single file in the record.",
+        "properties": {
+          "bucket": {
+            "description": "UUID of the bucket to which this file is assigned.",
+            "type": "string"
+          },
+          "checksum": {
+            "description": "Checksum the file. Starts with '<algorithm>:' prefix, e.g.: 'md5:1234abcd...'",
+            "type": "string"
+          },
+          "file_id": {
+            "description": "UUID of the FileInstance object.",
+            "type": "string"
+          },
+          "key": {
+            "description": "Key (filename) of the file.",
+            "type": "string"
+          },
+          "previewer": {
+            "description": "Identifier for previewer needed to preview this file.",
+            "type": "string"
+          },
+          "size": {
+            "description": "Size of the file in bytes.",
+            "type": "integer"
+          },
+          "type": {
+            "description": "File type extension.",
+            "type": "string"
+          },
+          "version_id": {
+            "description": "UUID of the ObjectVersion object.",
+            "type": "string"
+          }
+        },
+        "required": [
+          "bucket",
+          "checksum",
+          "file_id",
+          "key",
+          "size",
+          "type",
+          "version_id"
+        ],
+        "title": "File schema.",
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "_internal": {
+      "additionalProperties": false,
+      "description": "Metadata for internal use only.",
+      "properties": {
+        "comments": {
+          "description": "Comments for internal purposes.",
+          "items": {
+            "additionalProperties": false,
+            "properties": {
+              "comment": {
+                "description": "Comment.",
+                "type": "string"
+              },
+              "timestamp": {
+                "description": "ISO8601 formatted date time stamp.",
+                "type": "string"
+              },
+              "user_id": {
+                "description": "User making the comment.",
+                "type": "string"
+              }
+            },
+            "required": [
+              "timestamp",
+              "user_id",
+              "comment"
+            ],
+            "type": "object"
+          },
+          "type": "array"
+        },
+        "source": {
+          "additionalProperties": false,
+          "description": "Information related to initial source of acquisition.",
+          "properties": {
+            "agents": {
+              "items": {
+                "additionalProperties": false,
+                "properties": {
+                  "email": {
+                    "type": "string"
+                  },
+                  "name": {
+                    "type": "string"
+                  },
+                  "role": {
+                    "enum": [
+                      "uploader"
+                    ],
+                    "type": "string"
+                  },
+                  "user_id": {
+                    "anyOf": [
+                      {
+                        "type": "string"
+                      },
+                      {
+                        "type": "null"
+                      }
+                    ]
+                  },
+                  "username": {
+                    "type": "string"
+                  }
+                },
+                "type": "object"
+              },
+              "type": "array"
+            },
+            "legacy_deposit_id": {
+              "anyOf": [
+                {
+                  "type": "string"
+                },
+                {
+                  "type": "null"
+                }
+              ]
+            }
+          },
+          "type": "object"
+        }
+      },
+      "type": "object"
+    },
+    "_oai": {
+      "additionalProperties": false,
+      "description": "OAI-PMH specific information.",
+      "properties": {
+        "id": {
+          "description": "OAI-PMH record identifier.",
+          "type": "string"
+        },
+        "sets": {
+          "description": "OAI-PMH sets for record.",
+          "items": {
+            "type": "string"
+          },
+          "type": "array"
+        },
+        "updated": {
+          "description": "Last OAI-PMH set update (ISO8601 formatted timestamp)",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "access_conditions": {
+      "description": "Conditions under which access is given if record is restricted.",
+      "title": "Access conditions",
+      "type": "string"
+    },
+    "access_right": {
+      "default": "open",
+      "description": "Access right for record.",
+      "enum": [
+        "open",
+        "embargoed",
+        "restricted",
+        "closed"
+      ],
+      "type": "string"
+    },
+    "alternate_identifiers": {
+      "description": "Alternate identifiers for record.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "identifier": {
+            "description": "Identifier of research output.",
+            "type": "string"
+          },
+          "scheme": {
+            "description": "Persistent identifier scheme.",
+            "enum": [
+              "ads",
+              "ark",
+              "arxiv",
+              "bioproject",
+              "biosample",
+              "doi",
+              "ean13",
+              "ean8",
+              "ensembl",
+              "genome",
+              "gnd",
+              "hal",
+              "handle",
+              "isbn",
+              "isni",
+              "issn",
+              "istc",
+              "lsid",
+              "orcid",
+              "pmcid",
+              "pmid",
+              "purl",
+              "refseq",
+              "sra",
+              "uniprot",
+              "url",
+              "urn",
+              "swh",
+              "ascl"
+            ],
+            "type": "string"
+          },
+          "resource_type": {
+            "additionalProperties": false,
+            "description": "Record resource type.",
+            "properties": {
+              "subtype": {
+                "description": "Specific resource type.",
+                "type": "string"
+              },
+              "type": {
+                "default": "publication",
+                "description": "General resource type.",
+                "type": "string"
+              }
+            },
+            "type": "object"
+          }
+        },
+        "required": [
+          "identifier",
+          "scheme"
+        ],
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "communities": {
+      "description": "List of community identifiers.",
+      "items": {
+        "type": "string"
+      },
+      "type": "array"
+    },
+    "conceptdoi": {
+      "description": "Digital Object Identifier (DOI).",
+      "type": "string"
+    },
+    "conceptrecid": {
+      "description": "Invenio record identifier (integer).",
+      "type": "string"
+    },
+    "contributors": {
+      "description": "Contributors in order of importance.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "affiliation": {
+            "description": "Affiliation for the purpose of this specific record.",
+            "type": "string"
+          },
+          "familyname": {
+            "description": "Family name of person if known.",
+            "type": "string"
+          },
+          "givennames": {
+            "description": "Given names of person if known.",
+            "type": "string"
+          },
+          "gnd": {
+            "description": "Gemeinsame Normdatei identifier for creator.",
+            "type": "string"
+          },
+          "name": {
+            "description": "Full name of person or organisation. Personal name format: family, given.",
+            "type": "string"
+          },
+          "orcid": {
+            "description": "ORCID identifier for creator.",
+            "type": "string"
+          },
+          "type": {
+            "enum": [
+              "ContactPerson",
+              "DataCollector",
+              "DataCurator",
+              "DataManager",
+              "Distributor",
+              "Editor",
+              "HostingInstitution",
+              "Other",
+              "Producer",
+              "ProjectLeader",
+              "ProjectManager",
+              "ProjectMember",
+              "RegistrationAgency",
+              "RegistrationAuthority",
+              "RelatedPerson",
+              "Researcher",
+              "ResearchGroup",
+              "RightsHolder",
+              "Sponsor",
+              "Supervisor",
+              "WorkPackageLeader"
+            ],
+            "type": "string"
+          }
+        },
+        "required": [
+          "name",
+          "type"
+        ],
+        "type": "object"
+      },
+      "title": "Contributors",
+      "type": "array"
+    },
+    "creators": {
+      "description": "Creators of record in order of importance.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "affiliation": {
+            "description": "Affiliation for the purpose of this specific record.",
+            "type": "string"
+          },
+          "familyname": {
+            "description": "Family name of person if known.",
+            "type": "string"
+          },
+          "givennames": {
+            "description": "Given names of person if known.",
+            "type": "string"
+          },
+          "gnd": {
+            "description": "Gemeinsame Normdatei identifier for creator.",
+            "type": "string"
+          },
+          "name": {
+            "description": "Full name of person or organisation. Personal name format: family, given.",
+            "type": "string"
+          },
+          "orcid": {
+            "description": "ORCID identifier for creator.",
+            "type": "string"
+          }
+        },
+        "required": [
+          "name"
+        ],
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "custom": {
+      "type": "object",
+      "additionalProperties": {
+        "type": "array",
+        "items": {
+          "oneOf": [
+            {"type": "string"},
+            {"type": "number"},
+            {
+              "type": "object",
+              "additionalProperties": false,
+              "properties": {
+              	"subject": {"type": "array", "items": {"type": "string"}},
+                "object": {"type": "array", "items": {"type": "string"}}
+              }
+            }
+          ]
+        }
+      },
+      "description": "Custom metadata"
+    },
+    "dates": {
+      "description": "Date interval.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "description": {
+            "description": "Description of the date interval.",
+            "type": "string"
+          },
+          "end": {
+            "description": "End date.",
+            "type": "string"
+          },
+          "start": {
+            "description": "Start date.",
+            "type": "string"
+          },
+          "type": {
+            "description": "Type of the date interval.",
+            "enum": [
+              "Collected",
+              "Valid",
+              "Withdrawn"
+            ]
+          }
+        },
+        "required": [
+          "type"
+        ],
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "description": {
+      "description": "Description/abstract for record.",
+      "type": "string"
+    },
+    "doi": {
+      "description": "Digital Object Identifier (DOI).",
+      "type": "string"
+    },
+    "embargo_date": {
+      "description": "Embargo date of record (ISO8601 formatted date).",
+      "title": "Embargo Date",
+      "type": "string"
+    },
+    "grants": {
+      "description": "Source of grants/awards which have funded all or part of this particular record.",
+      "items": {
+        "title": "Grant",
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "imprint": {
+      "additionalProperties": false,
+      "properties": {
+        "isbn": {
+          "type": "string"
+        },
+        "place": {
+          "type": "string"
+        },
+        "publisher": {
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "journal": {
+      "additionalProperties": false,
+      "description": "Journal in which this record is published.",
+      "properties": {
+        "issue": {
+          "description": "Journal issue.",
+          "title": "Journal issue",
+          "type": "string"
+        },
+        "pages": {
+          "description": "Journal page(s).",
+          "title": "Journal page(s)",
+          "type": "string"
+        },
+        "title": {
+          "description": "Journal title.",
+          "title": "Journal title",
+          "type": "string"
+        },
+        "volume": {
+          "description": "Journal volume.",
+          "title": "Journal volume",
+          "type": "string"
+        },
+        "year": {
+          "description": "Journal year.",
+          "title": "Journal year",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "keywords": {
+      "description": "Free text keywords.",
+      "items": {
+        "title": "Keyword",
+        "type": "string"
+      },
+      "title": "Keywords",
+      "type": "array"
+    },
+    "language": {
+      "description": "ISO 639-3 language code.",
+      "type": "string"
+    },
+    "license": {
+      "description": "License for embargoed/open access content.",
+      "title": "License",
+      "type": "object"
+    },
+    "locations": {
+      "description": "Geographical location.",
+      "items": {
+        "properties": {
+          "description": {
+            "description": "Place of the location",
+            "type": "string"
+          },
+          "lat": {
+            "description": "Latitude of the location.",
+            "type": "number"
+          },
+          "lon": {
+            "description": "Longitude of the location.",
+            "type": "number"
+          },
+          "place": {
+            "description": "Description of the location",
+            "type": "string"
+          }
+        },
+        "required": [
+          "place"
+        ],
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "meeting": {
+      "description": "Associated meeting.",
+      "properties": {
+        "acronym": {
+          "title": "Acronym",
+          "type": "string"
+        },
+        "dates": {
+          "title": "Dates",
+          "type": "string"
+        },
+        "place": {
+          "title": "Place",
+          "type": "string"
+        },
+        "session": {
+          "title": "Session",
+          "type": "string"
+        },
+        "session_part": {
+          "title": "Part of session",
+          "type": "string"
+        },
+        "title": {
+          "title": "Title",
+          "type": "string"
+        },
+        "url": {
+          "title": "URL",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "method": {
+      "description": "Information about the used Method",
+      "type": "string"
+    },
+    "notes": {
+      "description": "Additional notes for record.",
+      "title": "Additional notes",
+      "type": "string"
+    },
+    "owners": {
+      "description": "List of user ids that are record as owner of record.",
+      "items": {
+        "type": "number"
+      },
+      "type": "array"
+    },
+    "part_of": {
+      "additionalProperties": false,
+      "description": "For parts of books and reports.",
+      "properties": {
+        "pages": {
+          "title": "Pages",
+          "type": "string"
+        },
+        "title": {
+          "title": "Title",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "publication_date": {
+      "description": "Record publication date (IS8601-formatted). EDTF support to be added for field.",
+      "type": "string"
+    },
+    "recid": {
+      "description": "Invenio record identifier (integer).",
+      "type": "number"
+    },
+    "references": {
+      "description": "Raw textual references when identifier is not known.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "raw_reference": {
+            "type": "string"
+          }
+        },
+        "title": "Reference",
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "related_identifiers": {
+      "description": "Related research outputs.",
+      "items": {
+        "properties": {
+          "identifier": {
+            "description": "Identifier of research output.",
+            "type": "string"
+          },
+          "relation": {
+            "description": "Relation type.",
+            "enum": [
+              "isCitedBy",
+              "cites",
+              "isSupplementTo",
+              "isSupplementedBy",
+              "isContinuedBy",
+              "continues",
+              "isDescribedBy",
+              "describes",
+              "hasMetadata",
+              "isMetadataFor",
+              "isNewVersionOf",
+              "isPreviousVersionOf",
+              "isPartOf",
+              "hasPart",
+              "isReferencedBy",
+              "references",
+              "isDocumentedBy",
+              "documents",
+              "isCompiledBy",
+              "compiles",
+              "isVariantFormOf",
+              "isOrignialFormOf",
+              "isIdenticalTo",
+              "isReviewedBy",
+              "reviews",
+              "isDerivedFrom",
+              "isSourceOf",
+              "requires",
+              "isRequiredBy",
+              "isObsoletedBy",
+              "obsoletes",
+              "isPublishedIn"
+            ],
+            "type": "string"
+          },
+          "scheme": {
+            "description": "Persistent identifier scheme.",
+            "enum": [
+              "ads",
+              "ark",
+              "arxiv",
+              "bioproject",
+              "biosample",
+              "doi",
+              "ean13",
+              "ean8",
+              "ensembl",
+              "genome",
+              "gnd",
+              "hal",
+              "handle",
+              "isbn",
+              "isni",
+              "issn",
+              "istc",
+              "lsid",
+              "orcid",
+              "pmcid",
+              "pmid",
+              "purl",
+              "refseq",
+              "sra",
+              "uniprot",
+              "url",
+              "urn",
+              "swh",
+              "ascl"
+            ],
+            "type": "string"
+          },
+          "resource_type": {
+            "additionalProperties": false,
+            "description": "Record resource type.",
+            "properties": {
+              "subtype": {
+                "description": "Specific resource type.",
+                "type": "string"
+              },
+              "type": {
+                "default": "publication",
+                "description": "General resource type.",
+                "type": "string"
+              }
+            },
+            "type": "object"
+          }
+        },
+        "required": [
+          "identifier",
+          "relation",
+          "scheme"
+        ],
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "resource_type": {
+      "additionalProperties": false,
+      "description": "Record resource type.",
+      "properties": {
+        "openaire_subtype": {
+          "description": "OpenAIRE-specific resource type.",
+          "type": "string"
+        },
+        "subtype": {
+          "description": "Specific resource type.",
+          "type": "string"
+        },
+        "type": {
+          "default": "publication",
+          "description": "General resource type.",
+          "type": "string"
+        }
+      },
+      "required": [
+        "type"
+      ],
+      "type": "object"
+    },
+    "subjects": {
+      "description": "Subjects from specific vocabularies.",
+      "items": {
+        "additionalProperties": false,
+        "properties": {
+          "identifier": {
+            "description": "Subjects term identifier.",
+            "type": "string"
+          },
+          "scheme": {
+            "description": "Identifier scheme.",
+            "type": "string"
+          },
+          "term": {
+            "description": "Subject term value.",
+            "type": "string"
+          }
+        },
+        "type": "object"
+      },
+      "type": "array"
+    },
+    "thesis": {
+      "additionalProperties": false,
+      "properties": {
+        "supervisors": {
+          "description": "Supervisors of thesis in order of importance.",
+          "items": {
+            "additionalProperties": false,
+            "properties": {
+              "affiliation": {
+                "description": "Affiliation for the purpose of this specific record.",
+                "type": "string"
+              },
+              "familyname": {
+                "description": "Family name of person if known.",
+                "type": "string"
+              },
+              "givennames": {
+                "description": "Given names of person if known.",
+                "type": "string"
+              },
+              "gnd": {
+                "description": "Gemeinsame Normdatei identifier for creator.",
+                "type": "string"
+              },
+              "name": {
+                "description": "Full name of person or organisation. Personal name format: family, given.",
+                "type": "string"
+              },
+              "orcid": {
+                "description": "ORCID identifier for creator.",
+                "type": "string"
+              }
+            },
+            "required": [
+              "name"
+            ],
+            "type": "object"
+          },
+          "type": "array"
+        },
+        "university": {
+          "description": "Awarding university in case of a thesis.",
+          "type": "string"
+        }
+      },
+      "type": "object"
+    },
+    "title": {
+      "description": "Record title.",
+      "type": "string"
+    },
+    "version": {
+      "description": "Record version tag.",
+      "type": "string"
+    }
+  },
+  "required": [
+    "recid",
+    "resource_type",
+    "publication_date",
+    "title",
+    "creators",
+    "description",
+    "access_right"
   ],
-  "description": "",
-  "license": "",
-  "doi": "",
-  "prereserve_doi": "",
-  "keywords": [],
-  "notes": "",
-  "related_identifiers": "",
-  "contributors": [{}],
-  "references": [],
-  "version": "",
-  "language": "",
-  "journal_title": "",
-  "journal_volume": "",
-  "journal_issue": "",
-  "journal_pages": "",
-  "conference_title": "",
-  "conference_acronym": "",
-  "conference_dates": "",
-  "conference_place": "",
-  "conference_url": "",
-  "conference_session": "",
-  "conference_session_part": "",
-  "imprint_publisher": "",
-  "imprint_isbn": "",
-  "imprint_place": "",
-  "partof_title": "",
-  "partof_pages": "",
-  "thesis_supervisors": "",
-  "thesis_university": "",
-  "subjects": "",
-  "locations": [{}],
-  "dates": [{}],
-  "method": ""
-}
\ No newline at end of file
+  "title": "Zenodo Record Schema v1.0.0",
+  "type": "object"
+}
diff --git a/eossr/metadata/schema/__init__.py b/eossr/metadata/schema/__init__.py
new file mode 100644
index 00000000..bbbc908a
--- /dev/null
+++ b/eossr/metadata/schema/__init__.py
@@ -0,0 +1,11 @@
+import json
+import pkg_resources
+
+
+def codemeta():
+    return json.load(pkg_resources.resource_stream(__name__, 'codemeta.json'))
+
+
+
+def zenodo():
+    return json.load(pkg_resources.resource_stream(__name__, '.zenodo.json'))
\ No newline at end of file
diff --git a/eossr/metadata/schema/codemeta.json b/eossr/metadata/schema/codemeta.json
index 12127a97..d92b82bb 100644
--- a/eossr/metadata/schema/codemeta.json
+++ b/eossr/metadata/schema/codemeta.json
@@ -1,70 +1,80 @@
 {
-  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
-  "@type": "SoftwareSourceCode",
-  "funder": [
-    {
-      "@type": "Organization",
-      "name": "ESCAPE: European Science Cluster of Astronomy & Particle physics ESFRI research infrastructures",
-      "funder": {
-        "@type": "Organization",
-        "@id": "https://doi.org/10.13039/501100000780",
-        "name": "European Commission"
-      }
-    }
-  ],
-  "funding": "824064",
-  "applicationCategory": "",
-  "applicationSubCategory": "",
-  "author": [],
-  "buildInstructions": "",
-  "citation": "",
-  "codeRepository": "",
-  "contIntegration": "",
-  "contributor": [],
-  "copyrightHolder": "",
-  "copyrightYear": "",
-  "creator": {},
-  "dateCreated": "",
-  "dateModified": "",
-  "datePublished": "",
-  "description": "",
-  "developmentStatus": "",
-  "downloadUrl": "",
-  "editor": {},
-  "embargoDate": "",
-  "encoding": "",
-  "fileFormat": "",
-  "fileSize": "",
-  "hasPart": "",
-  "identifier": "",
-  "installUrl": "",
-  "isAccessibleForFree": "",
-  "isPartOf": "",
-  "issueTracker": "",
-  "keywords": "",
-  "license": "",
-  "maintainer": {},
-  "memoryRequirements": "",
-  "name": "",
-  "operatingSystem": "",
-  "permissions": "",
-  "position": "",
-  "processorRequirements": "",
-  "producer": "",
-  "programmingLanguage": [],
-  "provider": "",
-  "publisher": "",
-  "readme": "",
-  "referencePublication": "",
-  "relatedLink": "",
-  "releaseNotes": "",
-  "runtimePlatform": "",
-  "sameAs": "",
-  "softwareHelp": "",
-  "softwareRequirements": [],
-  "softwareVersion": "",
-  "sponsor": {},
-  "storageRequirements": "",
-  "supportingData": "",
-  "targetProduct": ""
+  "@context": {
+      "type": "@type",
+      "id": "@id",
+      "schema":"http://schema.org/",
+      "codemeta": "https://codemeta.github.io/terms/",
+      "Organization": {"@id": "schema:Organization"},
+      "Person": {"@id": "schema:Person"},
+      "SoftwareSourceCode": {"@id": "schema:SoftwareSourceCode"},
+      "SoftwareApplication": {"@id": "schema:SoftwareApplication"},
+      "Text": {"@id": "schema:Text"},
+      "URL": {"@id": "schema:URL"},
+      "address": { "@id": "schema:address"},
+      "affiliation": { "@id": "schema:affiliation"},
+      "applicationCategory": { "@id": "schema:applicationCategory", "@type": "@id"},
+      "applicationSubCategory": { "@id": "schema:applicationSubCategory", "@type": "@id"},
+      "citation": { "@id": "schema:citation"},
+      "codeRepository": { "@id": "schema:codeRepository", "@type": "@id"},
+      "contributor": { "@id": "schema:contributor"},
+      "copyrightHolder": { "@id": "schema:copyrightHolder"},
+      "copyrightYear": { "@id": "schema:copyrightYear"},
+      "creator": { "@id": "schema:creator"},
+      "dateCreated": {"@id": "schema:dateCreated", "@type": "schema:Date" },
+      "dateModified":  {"@id": "schema:dateModified", "@type": "schema:Date" },
+      "datePublished":  {"@id": "schema:datePublished", "@type": "schema:Date" },
+      "description": { "@id": "schema:description"},
+      "downloadUrl": { "@id": "schema:downloadUrl", "@type": "@id"},
+      "email": { "@id": "schema:email"},
+      "editor": { "@id": "schema:editor"},
+      "encoding": { "@id": "schema:encoding"},
+      "familyName": { "@id": "schema:familyName"},
+      "fileFormat": { "@id": "schema:fileFormat", "@type": "@id"},
+      "fileSize": { "@id": "schema:fileSize"},
+      "funder": { "@id": "schema:funder"},
+      "givenName": { "@id": "schema:givenName"},
+      "hasPart": { "@id": "schema:hasPart" },
+      "identifier": { "@id": "schema:identifier", "@type": "@id"},
+      "installUrl": { "@id": "schema:installUrl", "@type": "@id"},
+      "isAccessibleForFree": { "@id": "schema:isAccessibleForFree"},
+      "isPartOf":  { "@id": "schema:isPartOf"},
+      "keywords": { "@id": "schema:keywords"},
+      "license": { "@id": "schema:license", "@type": "@id"},
+      "memoryRequirements": { "@id": "schema:memoryRequirements", "@type": "@id"},
+      "name": { "@id": "schema:name"},
+      "operatingSystem": { "@id": "schema:operatingSystem"},
+      "permissions": { "@id": "schema:permissions"},
+      "position": { "@id": "schema:position"},
+      "processorRequirements": { "@id": "schema:processorRequirements"},
+      "producer": { "@id": "schema:producer"},
+      "programmingLanguage": { "@id": "schema:programmingLanguage"},
+      "provider": { "@id": "schema:provider"},
+      "publisher": { "@id": "schema:publisher"},
+      "relatedLink": { "@id": "schema:relatedLink", "@type": "@id"},
+      "releaseNotes": { "@id": "schema:releaseNotes", "@type": "@id"},
+      "runtimePlatform": { "@id": "schema:runtimePlatform"},
+      "sameAs": { "@id": "schema:sameAs", "@type": "@id"},
+      "softwareHelp": { "@id": "schema:softwareHelp"},
+      "softwareRequirements": { "@id": "schema:softwareRequirements", "@type": "@id"},
+      "softwareVersion": { "@id": "schema:softwareVersion"},
+      "sponsor": { "@id": "schema:sponsor"},
+      "storageRequirements": { "@id": "schema:storageRequirements", "@type": "@id"},
+      "supportingData": { "@id": "schema:supportingData"},
+      "targetProduct": { "@id": "schema:targetProduct"},
+      "url": { "@id": "schema:url", "@type": "@id"},
+      "version": { "@id": "schema:version"},
+
+      "author": { "@id": "schema:author", "@container": "@list" },
+
+      "softwareSuggestions": { "@id": "codemeta:softwareSuggestions", "@type": "@id"},
+      "contIntegration": { "@id": "codemeta:contIntegration", "@type": "@id"},
+      "buildInstructions": { "@id": "codemeta:buildInstructions", "@type": "@id"},
+      "developmentStatus": { "@id": "codemeta:developmentStatus", "@type": "@id"},
+      "embargoDate": { "@id":"codemeta:embargoDate", "@type": "schema:Date" },
+      "funding": { "@id": "codemeta:funding" },
+      "readme": { "@id":"codemeta:readme", "@type": "@id" },
+      "issueTracker": { "@id":"codemeta:issueTracker", "@type": "@id" },
+      "referencePublication": { "@id": "codemeta:referencePublication", "@type": "@id"},
+      "maintainer": { "@id": "codemeta:maintainer" }
+  }
 }
\ No newline at end of file
diff --git a/eossr/metadata/tests/test_schema.py b/eossr/metadata/tests/test_schema.py
new file mode 100644
index 00000000..a6b67519
--- /dev/null
+++ b/eossr/metadata/tests/test_schema.py
@@ -0,0 +1,10 @@
+from eossr.metadata import schema
+
+
+def test_codemeta():
+    meta = schema.codemeta()
+    assert meta['@context']['codemeta'] == "https://codemeta.github.io/terms/"
+
+def test_zenodo():
+    meta = schema.zenodo()
+    assert meta['$schema'] == 'http://json-schema.org/draft-04/schema#'
\ No newline at end of file
diff --git a/setup.py b/setup.py
index bc827db0..353cd982 100644
--- a/setup.py
+++ b/setup.py
@@ -29,8 +29,11 @@ setup(
     scripts=['eossr/scripts/parse_last_release_git.sh'],
     tests_require=['pytest'],
     author='Thomas Vuillaume & Enrique Garcia',
-    author_email='vuillaume<at>lapp.in2p3.fr',
+    author_email='vuillaume@lapp.in2p3.fr',
     url='https://gitlab.in2p3.fr/escape2020/wp3/eossr',
     license='MIT',
-    entry_points=entry_points
+    entry_points=entry_points,
+    package_data={
+        'eossr': ['metadata/schema/.zenodo.json', 'metadata/schema/codemeta.json']
+    }
 )
-- 
GitLab