Skip to content

Commit

Permalink
refactor: ♻️ update codemeta 3.0 schema
Browse files Browse the repository at this point in the history
  • Loading branch information
slugb0t committed Dec 17, 2024
1 parent f248b24 commit 6f2cadc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 90 deletions.
126 changes: 36 additions & 90 deletions validator/codemeta-schema.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
{
"title": "Codemeta.json Schema",
"description": "This schema is used to validate the codemeta.json files.",
"description": "This schema is used to validate a subset of Codemeta",
"type": "object",
"additionalProperties": false,
"required": [
"@context",
"name",
"author",
"description"
],
"properties": {
"@context": {
"type": "string",
"description": "The JSON-LD context for codemeta.",
"enum": [
"https://doi.org/10.5063/schema/codemeta-2.0",
"https://w3id.org/codemeta/3.0"
]
},
"@type": {
"type": "string",
"description": "The type of the software package.",
"enum": [
"SoftwareSourceCode"
]
},
"name": {
"type": "string",
"description": "The name of the software package.",
Expand All @@ -32,34 +30,19 @@
"oneOf": [
{
"type": "object",
"description": "Person or Organization (common to 2.0 and 3.0)",
"properties": {
"id": {
"type": "string",
"description": "The URI of the author."
},
"type": {
"type": "string",
"description": "Type of the entity (Person or Organization)",
"description": "Organization or Person",
"enum": [
"Person",
"Organization"
"Organization",
"Person"
]
},
"affiliation": {
"type": "object",
"description": "The affiliation of the author.",
"properties": {
"name": {
"type": "string",
"description": "The name of the affiliation."
},
"type": {
"type": "string",
"description": "Organization or Person"
}
}
},
"email": {
"type": "string",
"description": "The email address of the author."
Expand All @@ -72,81 +55,49 @@
"type": "string",
"description": "The given name of the author.",
"minLength": 1
},
"affiliation": {
"type": "object",
"description": "The affiliation of the author.",
"properties": {
"name": {
"type": "string",
"description": "The name of the affiliation."
},
"type": {
"type": "string"
}
}
}
},
"required": [
"type"
]
}
},
{
"type": "object",
"description": "Role (3.0 format)",
"description": "Object representing roles of the author.",
"required": ["type", "schema:author", "roleName"],
"properties": {
"type": {
"type": "string",
"description": "The type of the role.",
"enum": [
"Role"
]
"enum": ["Role"],
"description": "The type of the author role."
},
"schema:author": {
"type": "string",
"description": "The URI of the author."
"description": "Will match with the author's id."
},
"roleName": {
"type": "string",
"description": "The role name."
},
"startDate": {
"type": "string",
"format": "date",
"description": "Start date of the role."
"description": "The name of the author role."
},
"endDate": {
"type": "string",
"format": "date",
"description": "End date of the role."
}
},
"required": [
"type",
"schema:author"
]
},
{
"type": "object",
"description": "Role (2.0 format)",
"properties": {
"type": {
"type": "string",
"description": "The type of the role.",
"enum": [
"schema:Role"
]
},
"schema:author": {
"type": "string",
"description": "The URI of the author."
},
"schema:roleName": {
"type": "string",
"description": "The role name."
"description": "The end date of the author role."
},
"schema:startDate": {
"type": "string",
"format": "date",
"description": "Start date of the role."
},
"schema:endDate": {
"startDate": {
"type": "string",
"format": "date",
"description": "End date of the role."
"description": "The start date of the author role."
}
},
"required": [
"type",
"schema:author"
]
}
}
]
}
Expand Down Expand Up @@ -177,7 +128,7 @@
},
"contributor": {
"type": "array",
"description": "The authors of the software package.",
"description": "The contributors of the software package.",
"items": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -219,10 +170,6 @@
}
}
},
"contIntegration": {
"type": "string",
"description": "The continuous integration service used for the software."
},
"codemeta:continuousIntegration": {
"type": "object",
"description": "The continuous integration service used for the software.",
Expand Down Expand Up @@ -377,6 +324,5 @@
"type": "string",
"description": "The type of software."
}
},
"required": ["@context", "author", "name", "license"]
}
}
4 changes: 4 additions & 0 deletions validator/codemeta-schema2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
"type": "string",
"description": "The URL of the code repository"
},
"contIntegration": {
"type": "string",
"description": "The URL of the continuous integration system"
},
"dateCreated": {
"type": "string",
"description": "The date the software was created"
Expand Down

0 comments on commit 6f2cadc

Please sign in to comment.