Skip to content

Commit

Permalink
Add metadata schema for InvenioRDM along with a test
Browse files Browse the repository at this point in the history
  • Loading branch information
markpatton committed May 16, 2024
1 parent 46fd602 commit f833b75
Show file tree
Hide file tree
Showing 3 changed files with 548 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"title": "InvenioRDM schema",
"description": "InvenioRDM-specific metadata requirements",
"$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/inveniordm.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"definitions": {
"form": {
"title": "InvenioRDM <br><p class='lead text-muted'>Deposit requirements for InvenioRDM</p>",
"type": "object",
"properties": {
"authors": {
"$ref": "global.json#/properties/authors"
}
},
"required": ["authors", "publicationDate"]
},
"options": {
"$ref": "global.json#/options"
}
},
"allOf": [
{
"$ref": "global.json#"
},
{
"$ref": "#/definitions/form"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,18 @@ void dereferenceJscholarTest() throws Exception {
assertEquals(expectedSchema.getSchema(), testSchema.getSchema());
}

@Test
void dereferenceInvenioRDMTest() throws Exception {
InputStream irdm_is = SchemaInstanceTest.class
.getResourceAsStream("/schemas/jhu/inveniordm.json");

InputStream expected_is = SchemaInstanceTest.class
.getResourceAsStream("/schemas/jhu/inveniordm_deref.json");

SchemaInstance testSchema = new SchemaInstance(map.readTree(irdm_is));
SchemaInstance expectedSchema = new SchemaInstance(map.readTree(expected_is));
SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class));
testSchema.dereference(testSchema.getSchema(), schemaFetcher);
assertEquals(expectedSchema.getSchema(), testSchema.getSchema());
}
}
Loading

0 comments on commit f833b75

Please sign in to comment.