forked from D-Net/dnet-hadoop
[Dump Schemas] changed the schema of the dumped result according to the modifications in the bestAccessRight type
This commit is contained in:
parent
43cae4ad88
commit
6595135a1a
|
@ -1,33 +1,6 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"AccessRight":{
|
||||
"type":"object",
|
||||
"properties":{
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": "Label for the access mode"
|
||||
},
|
||||
"openAccessRoute":{
|
||||
"type":"string",
|
||||
"enum":[
|
||||
"gold",
|
||||
"green",
|
||||
"hybrid",
|
||||
"bronze"
|
||||
],
|
||||
"description":"The type of OpenAccess applied to the result"
|
||||
},
|
||||
"scheme": {
|
||||
"type": "string",
|
||||
"description": "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ControlledField": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
@ -94,14 +67,21 @@
|
|||
}
|
||||
},
|
||||
"bestaccessright":{
|
||||
"allOf":[
|
||||
{
|
||||
"$ref":"#/definitions/AccessRight"
|
||||
"type":"object",
|
||||
"properties":{
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
},
|
||||
{
|
||||
"description":"The openest access right associated to the manifestations of this research results"
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": "Label for the access mode"
|
||||
},
|
||||
"scheme": {
|
||||
"type": "string",
|
||||
"description": "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"codeRepositoryUrl": {
|
||||
"type": "string",
|
||||
|
@ -255,27 +235,30 @@
|
|||
"type":"object",
|
||||
"properties":{
|
||||
"accessright":{
|
||||
"allOf":[
|
||||
{
|
||||
"$ref":"#/definitions/AccessRight"
|
||||
"type":"object",
|
||||
"properties":{
|
||||
"code": {
|
||||
"type": "string",
|
||||
"description": "COAR access mode code: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
},
|
||||
{
|
||||
"description":"The accessright of this instance. One result may have multiple instances, each with a different accessright"
|
||||
"label": {
|
||||
"type": "string",
|
||||
"description": "Label for the access mode"
|
||||
},
|
||||
"openAccessRoute":{
|
||||
"type":"string",
|
||||
"enum":[
|
||||
"gold",
|
||||
"green",
|
||||
"hybrid",
|
||||
"bronze"
|
||||
],
|
||||
"description":"The type of OpenAccess applied to the result"
|
||||
},
|
||||
"scheme": {
|
||||
"type": "string",
|
||||
"description": "Scheme of reference for access right code. Always set to COAR access rights vocabulary: http://vocabularies.coar-repositories.org/documentation/access_rights/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"alternateIdentifier":{
|
||||
"description":"All the identifiers associated to the result other than the authoritative ones",
|
||||
"type":"array",
|
||||
"items":{
|
||||
"allOf":[
|
||||
{
|
||||
"$ref":"#/definitions/ControlledField"
|
||||
},
|
||||
{
|
||||
"description":"Description of alternateIdentifier"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"articleprocessingcharge":{
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.github.victools.jsonschema.generator.*;
|
|||
|
||||
import eu.dnetlib.dhp.schema.dump.oaf.graph.*;
|
||||
|
||||
@Disabled
|
||||
//@Disabled
|
||||
class GenerateJsonSchema {
|
||||
|
||||
@Test
|
||||
|
@ -21,7 +21,7 @@ class GenerateJsonSchema {
|
|||
configBuilder.forFields().withDescriptionResolver(field -> "Description of " + field.getDeclaredName());
|
||||
SchemaGeneratorConfig config = configBuilder.build();
|
||||
SchemaGenerator generator = new SchemaGenerator(config);
|
||||
JsonNode jsonSchema = generator.generateSchema(Relation.class);
|
||||
JsonNode jsonSchema = generator.generateSchema(GraphResult.class);
|
||||
|
||||
System.out.println(jsonSchema.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue