diff --git a/pass-core-main/pom.xml b/pass-core-main/pom.xml index cd503175..4f17bafd 100644 --- a/pass-core-main/pom.xml +++ b/pass-core-main/pom.xml @@ -56,12 +56,6 @@ ${project.parent.version} - - org.eclipse.pass - pass-core-metadataschema-service - ${project.parent.version} - - org.eclipse.pass pass-core-usertoken diff --git a/pass-core-main/src/main/java/org/eclipse/pass/main/Main.java b/pass-core-main/src/main/java/org/eclipse/pass/main/Main.java index 3860d0ba..b66fbbe1 100644 --- a/pass-core-main/src/main/java/org/eclipse/pass/main/Main.java +++ b/pass-core-main/src/main/java/org/eclipse/pass/main/Main.java @@ -29,8 +29,7 @@ @EnableScheduling @EnableJms @ComponentScan(basePackages = {"org.eclipse.pass", "org.eclipse.pass.doi.service", - "org.eclipse.pass.file.service", "org.eclipse.pass.user", "org.eclipse.pass.metadataschema", - "org.eclipse.pass.policy.service"}) + "org.eclipse.pass.file.service", "org.eclipse.pass.user", "org.eclipse.pass.policy.service"}) @EntityScan(basePackages = { "org.eclipse.pass.object.model" }) public class Main { /** diff --git a/pass-core-main/src/test/java/org/eclipse/pass/metadataschema/MetadataSchemaServiceTest.java b/pass-core-main/src/test/java/org/eclipse/pass/metadataschema/MetadataSchemaServiceTest.java deleted file mode 100644 index 786c0bb1..00000000 --- a/pass-core-main/src/test/java/org/eclipse/pass/metadataschema/MetadataSchemaServiceTest.java +++ /dev/null @@ -1,277 +0,0 @@ -package org.eclipse.pass.metadataschema; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Arrays; -import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.yahoo.elide.RefreshableElide; -import okhttp3.Call; -import okhttp3.Credentials; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import org.eclipse.pass.main.SimpleIntegrationTest; -import org.eclipse.pass.object.PassClient; -import org.eclipse.pass.object.model.IntegrationType; -import org.eclipse.pass.object.model.Repository; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; - -public class MetadataSchemaServiceTest extends SimpleIntegrationTest { - private final String credentials = Credentials.basic(BACKEND_USER, BACKEND_PASSWORD); - private final OkHttpClient httpClient = new OkHttpClient(); - private Long repo1Id; - private Long repo2Id; - private Long repo3Id; - private Long repo4Id; - private Long repo5Id; - private Long repo6Id; - - @Autowired - protected RefreshableElide refreshableElide; - - @BeforeAll - public void setupRepos() throws IOException { - repo1Id = setupRepo1(); - repo2Id = setupRepo2(); - repo3Id = setupRepo3(); //contains missing schema to test error handling - repo4Id = setupRepo4(); //contains bad schema to test error handling - repo5Id = setupRepo5(); //contains schemas with merge conflict to test error handling - repo6Id = setupRepo6(); - } - - @Test - public void testSchemaControllerOneRepoWithMergeTrue() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo6Id.toString() + "&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.OK.value()); - assertThat(response.body()).isNotNull(); - InputStream expected_schema_json = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/expected_jscholarship_common_merge.json"); - ObjectMapper map = new ObjectMapper(); - JsonNode expected = map.readTree(expected_schema_json); - JsonNode actual = map.readTree(response.body().string()); - assertEquals(expected, actual); - } - - @Test - public void testSchemaControllerOneRepoWithMergeFalse() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo1Id.toString() + "&merge=false"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.OK.value()); - assertThat(response.body()).isNotNull(); - InputStream expected_schema1_json = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema1.json"); - InputStream expected_schema2_json = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema2.json"); - InputStream expected_schema3_json = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema3.json"); - ObjectMapper map = new ObjectMapper(); - JsonNode expected1 = map.readTree(expected_schema1_json); - JsonNode expected2 = map.readTree(expected_schema2_json); - JsonNode expected3 = map.readTree(expected_schema3_json); - ArrayNode expected_array = map.createArrayNode(); - expected_array.add(expected1); - expected_array.add(expected2); - expected_array.add(expected3); - JsonNode actual = map.readTree(response.body().string()); - assertEquals(expected_array, actual); - } - - @Test - public void testSchemaControllerTwoRepoWithMergeTrue() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo1Id.toString() + "," - + repo2Id.toString() + "&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.OK.value()); - assertThat(response.body()).isNotNull(); - InputStream expected_schema_json = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/example_merged_dereferenced.json"); - ObjectMapper map = new ObjectMapper(); - JsonNode expected = map.readTree(expected_schema_json); - ArrayNode expected_array = map.createArrayNode(); - expected_array.add(expected); - JsonNode actual = map.readTree(response.body().string()); - assertEquals(expected_array, actual); - } - - @Test - public void testSchemaControllerTwoRepoWithMergeFalse() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo1Id.toString() + "," - + repo2Id.toString() + "&merge=false"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.OK.value()); - assertThat(response.body()).isNotNull(); - InputStream expected_schema_json1 = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema1.json"); - InputStream expected_schema_json2 = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema2.json"); - InputStream expected_schema_json3 = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema3.json"); - InputStream expected_schema_json4 = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema4.json"); - InputStream expected_schema_json5 = MetadataSchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/schema_to_deref_expected.json"); - ObjectMapper map = new ObjectMapper(); - JsonNode expected1 = map.readTree(expected_schema_json1); - JsonNode expected2 = map.readTree(expected_schema_json2); - JsonNode expected3 = map.readTree(expected_schema_json3); - JsonNode expected4 = map.readTree(expected_schema_json4); - JsonNode expected5 = map.readTree(expected_schema_json5); - ArrayNode expected_array = map.createArrayNode(); - expected_array.add(expected1); - expected_array.add(expected2); - expected_array.add(expected3); - expected_array.add(expected4); - expected_array.add(expected5); - JsonNode actual = map.readTree(response.body().string()); - assertEquals(expected_array, actual); - } - - @Test - public void testSchemaControllerWithNoEntityId() throws Exception { - String url = getBaseUrl() + "schema?entityIds=&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.BAD_REQUEST.value()); - assertThat(response.body()).isNotNull(); - } - - @Test - public void testSchemaControllerWithMissingLocalSchema() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo3Id.toString() + "&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value()); - assertThat(response.body()).isNotNull(); - } - - @Test - public void testSchemaControllerWithBadLocalSchema() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo4Id.toString() + "&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value()); - assertThat(response.body()).isNotNull(); - } - - @Test - public void testSchemaControllerWithMergeConflict() throws Exception { - String url = getBaseUrl() + "schema?entityIds=" + repo5Id.toString() + "&merge=true"; - Request okHttpRequest = new Request.Builder() - .url(url).header("Authorization", credentials) - .build(); - Call call = httpClient.newCall(okHttpRequest); - Response response = call.execute(); - - assertThat(response.code()).isEqualTo(HttpStatus.CONFLICT.value()); - assertThat(response.body()).isNotNull(); - } - - private Long setupRepo1() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/schema1.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema2.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema3.json")); - return createRepo("1", IntegrationType.WEB_LINK, schemas, "nih-repository"); - } - - private Long setupRepo2() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/schema3.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema4.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema_to_deref.json")); - return createRepo("2", IntegrationType.WEB_LINK, schemas, "nih-repository"); - } - - private Long setupRepo3() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/schema2.json"), - URI.create("https://example.com/metadata-schemas/jhu/MissingSchema.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema_to_deref.json")); - return createRepo("3", IntegrationType.WEB_LINK, schemas, "nih-repository"); - } - - private Long setupRepo4() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/schema2.json"), - URI.create("https://example.com/metadata-schemas/jhu/bad_schema.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema_to_deref.json")); - return createRepo("4", IntegrationType.WEB_LINK, schemas, "nih-repository"); - } - - private Long setupRepo5() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/schema_merge_conflict1.json"), - URI.create("https://example.com/metadata-schemas/jhu/schema_merge_conflict2.json")); - return createRepo("5", IntegrationType.WEB_LINK, schemas, "nih-repository"); - } - - private Long setupRepo6() throws IOException { - List schemas = Arrays.asList( - URI.create("https://example.com/metadata-schemas/jhu/jscholarship.json"), - URI.create("https://example.com/metadata-schemas/jhu/common.json")); - return createRepo("6", IntegrationType.FULL, schemas, "j10p-repository"); - } - - private Long createRepo(String repoNum, IntegrationType integrationType, List schemas, String repoKey) - throws IOException { - Repository repository = new Repository(); - repository.setName("Test Repository " + repoNum); - repository.setDescription("Repository " + repoNum + " - merge conflict schema"); - repository.setUrl(URI.create("https://example.com/repository" + repoNum)); - repository.setAgreementText("Repository " + repoNum + " agreement text"); - repository.setIntegrationType(integrationType); - repository.setSchemas(schemas); - repository.setRepositoryKey(repoKey); - - try (PassClient passClient = PassClient.newInstance(refreshableElide)) { - passClient.createObject(repository); - } - - return repository.getId(); - } - -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/bad_schema.json b/pass-core-main/src/test/resources/schemas/jhu/bad_schema.json deleted file mode 100644 index 5a99eb0e..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/bad_schema.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "http://example.org/metadata-schemas/schemas/jhu/foo", - "title": "foo", - "": "foo schema", - "$comment": "one", - "a": "1", - "x": { - "title" - "description": "a letter", - "$comment": "displays good", - "type": "letter" - }, - "array": ["a", "b", "c"], - "aa": "b", - "cc": ["d" "e"] -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/common.json b/pass-core-main/src/test/resources/schemas/jhu/common.json deleted file mode 100644 index 2c09ee78..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/common.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "title": "JHU common schema", - "description": "Enumerates the common properties required by most repositories", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/common.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "type": "object", - "title": "Publication Details

Please provide additional information about your article/manuscript below. If DOI was provided in the initial step of the submission, the metadata associated with that DOI was found and used to prepopulatethis form.

Fields that are not editable were populated using metadata associated with the provided DOI.

", - "$comment": "These properties are intended to be displayed in an Alpaca form", - "properties": { - "title": { - "$ref": "global.json#/properties/title" - }, - "journal-title": { - "$ref": "global.json#/properties/journal-title" - }, - "volume": { - "$ref": "global.json#/properties/volume" - }, - "issue": { - "$ref": "global.json#/properties/issue" - }, - "issns": { - "$ref": "global.json#/properties/issns" - }, - "publisher": { - "$ref": "global.json#/properties/publisher" - }, - "publicationDate": { - "$ref": "global.json#/properties/publicationDate" - }, - "abstract": { - "$ref": "global.json#/properties/abstract" - }, - "authors": { - "$ref": "global.json#/properties/authors" - }, - "under-embargo": { - "$ref": "global.json#/properties/under-embargo" - }, - "Embargo-end-date": { - "$ref": "global.json#/properties/Embargo-end-date" - } - }, - "dependencies": { - "Embargo-end-date": ["under-embargo"] - }, - "options": { - "$ref": "global.json#/options" - } - } - } -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/example_merged_basic.json b/pass-core-main/src/test/resources/schemas/jhu/example_merged_basic.json deleted file mode 100644 index 2ce9b49a..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/example_merged_basic.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "a": "1", - "b": "2", - "c": "3", - "d": "4", - "x": { - "title": "x", - "$comment": "displays nicely", - "description": "an awesome letter", - "type": "letter" - }, - "array": ["a", "b", "c", "d", "e", "f"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e", "f", {"g": "h"}], - "aa": "b", - "cc": ["d", "e", "f", "g"], - "h": { - "i": "j", - "k": ["l", "m", "m'"], - "n": { - "o": "p", - "q": "r" - } - } -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/example_merged_dereferenced.json b/pass-core-main/src/test/resources/schemas/jhu/example_merged_dereferenced.json deleted file mode 100644 index d14af742..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/example_merged_dereferenced.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "a": "1", - "b": "2", - "c": "3", - "d": "4", - "x": { - "title": "x", - "$comment": "displays nicely", - "description": "an awesome letter", - "type": "letter" - }, - "array": ["a", "b", "c", "d", "e", "f"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e", "f", {"g": "h"}], - "aa": "b", - "cc": ["d", "e", "f", "g"], - "h": { - "i": "j", - "k": ["l", "m", "m'"], - "n": { - "o": "p", - "q": "r" - } - }, - "copySchemaName": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "schema1_title": "X", - "schema2_x": { - "title": "x", - "description": "an awesome letter", - "$comment": "displays nicely", - "type": "letter" - }, - "schema3_array": ["c", "d", "e"], - "schema4_complexarray": ["e", "f", {"g": "h"}], - "schema4_hk": ["l", "m", "m'"] -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json b/pass-core-main/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json deleted file mode 100644 index 459cc13a..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json +++ /dev/null @@ -1,704 +0,0 @@ -[ - { - "allOf": [ - { - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "description": "Defines all possible metadata fields for PASS deposit", - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - }, - "properties": { - "$schema": { - "description": "The JSON schema that applies to the resulting metadata blob", - "title": "JSON schema", - "type": "string" - }, - "Embargo-end-date": { - "description": "Date at which the article or manuscript may be made public", - "format": "date", - "title": "Embargo end date", - "type": "string" - }, - "abstract": { - "description": "The abstract of the article or manuscript being submitted", - "title": "Abstract", - "type": "string" - }, - "agent_information": { - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "title": "User agent (browser) name", - "type": "string" - }, - "version": { - "title": "User agent (browser) version", - "type": "string" - } - }, - "title": "User agent (browser) information", - "type": "object" - }, - "agreements": { - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "patternProperties": { - "^.+$": { - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}", - "description": "Text or link agreed to for the given repository key", - "title": "Agreement", - "type": "string" - } - }, - "title": "Agreements to deposit conditions", - "type": "object" - }, - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - }, - "doi": { - "description": "The DOI of the individual article or manuscript submitted", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "type": "string" - }, - "hints": { - "additionalProperties": false, - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "properties": { - "collection-tags": { - "items": { - "type": "string" - }, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "type": "array", - "uniqueItems": true - } - }, - "title": "Hints provided by the UI to backend services", - "type": "object" - }, - "issns": { - "description": "List of ISSN numbers with optional publication type", - "items": { - "properties": { - "issn": { - "title": "ISSN ", - "type": "string" - }, - "pubType": { - "enum": [ - "Print", - "Online" - ], - "title": "publication type", - "type": "string" - } - }, - "title": "ISSN info", - "type": "object" - }, - "title": "ISSN information for the manuscript's journal", - "type": "array", - "uniqueItems": true - }, - "issue": { - "description": "Issue number of the journal this article or manuscript was submitted to", - "title": "Journal issue", - "type": "string" - }, - "journal-NLMTA-ID": { - "description": "NLM identifier for a journal", - "title": "NTMLA", - "type": "string" - }, - "journal-title": { - "description": "Title of the journal the individual article or manuscript was submitted to", - "title": "Journal title", - "type": "string" - }, - "journal-title-short": { - "description": "Short journal title from CrossRef", - "title": "Short journal title", - "type": "string" - }, - "publicationDate": { - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'", - "description": "Publication date of the journal or article this manuscript was submitted to", - "title": "Publication Date", - "type": "string" - }, - "publisher": { - "description": "Publisher of the journal this article or manuscript was submitted to", - "title": "Publisher", - "type": "string" - }, - "title": { - "description": "The title of the individual article or manuscript that was submitted", - "title": "Article / Manuscript Title", - "type": "string" - }, - "under-embargo": { - "$comment": "This should probably be a boolean", - "description": "Indicates wither the article or manuscript is under embargo", - "title": "Under Embargo", - "type": "string" - }, - "volume": { - "description": "journal volume this article or manuscript was published in", - "title": "Journal Volume", - "type": "string" - } - }, - "required": [ - "$schema", - "title", - "journal-title" - ], - "title": "JHU global schema", - "type": "object" - }, - { - "properties": { - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - } - }, - "required": [ - "authors" - ], - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object" - } - ], - "definitions": { - "form": { - "$comment": "These properties are intended to be displayed in an Alpaca form", - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - }, - "properties": { - "Embargo-end-date": { - "description": "Date at which the article or manuscript may be made public", - "format": "date", - "title": "Embargo end date", - "type": "string" - }, - "abstract": { - "description": "The abstract of the article or manuscript being submitted", - "title": "Abstract", - "type": "string" - }, - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - }, - "issns": { - "description": "List of ISSN numbers with optional publication type", - "items": { - "properties": { - "issn": { - "title": "ISSN ", - "type": "string" - }, - "pubType": { - "enum": [ - "Print", - "Online" - ], - "title": "publication type", - "type": "string" - } - }, - "title": "ISSN info", - "type": "object" - }, - "title": "ISSN information for the manuscript's journal", - "type": "array", - "uniqueItems": true - }, - "issue": { - "description": "Issue number of the journal this article or manuscript was submitted to", - "title": "Journal issue", - "type": "string" - }, - "journal-title": { - "description": "Title of the journal the individual article or manuscript was submitted to", - "title": "Journal title", - "type": "string" - }, - "publicationDate": { - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'", - "description": "Publication date of the journal or article this manuscript was submitted to", - "title": "Publication Date", - "type": "string" - }, - "publisher": { - "description": "Publisher of the journal this article or manuscript was submitted to", - "title": "Publisher", - "type": "string" - }, - "title": { - "description": "The title of the individual article or manuscript that was submitted", - "title": "Article / Manuscript Title", - "type": "string" - }, - "under-embargo": { - "$comment": "This should probably be a boolean", - "description": "Indicates wither the article or manuscript is under embargo", - "title": "Under Embargo", - "type": "string" - }, - "volume": { - "description": "journal volume this article or manuscript was published in", - "title": "Journal Volume", - "type": "string" - } - }, - "required": [ - "authors" - ], - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object" - }, - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - } - }, - "type": "object" - } -] diff --git a/pass-core-main/src/test/resources/schemas/jhu/global.json b/pass-core-main/src/test/resources/schemas/jhu/global.json deleted file mode 100644 index ae1ba87f..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/global.json +++ /dev/null @@ -1,298 +0,0 @@ -{ - "title": "JHU global schema", - "description": "Defines all possible metadata fields for PASS deposit", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "$schema", - "title", - "journal-title" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "title": "JSON schema", - "description": "The JSON schema that applies to the resulting metadata blob" - }, - "agreements": { - "type": "object", - "title": "Agreements to deposit conditions", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "patternProperties": { - "^.+$": { - "type": "string", - "title": "Agreement", - "description": "Text or link agreed to for the given repository key", - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}" - } - } - }, - "abstract": { - "type": "string", - "title": "Abstract", - "description": "The abstract of the article or manuscript being submitted" - }, - "agent_information": { - "type": "object", - "title": "User agent (browser) information", - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "type": "string", - "title": "User agent (browser) name" - }, - "version": { - "type": "string", - "title": "User agent (browser) version" - } - } - }, - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - }, - "doi": { - "type": "string", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "description": "The DOI of the individual article or manuscript submitted" - }, - "Embargo-end-date": { - "type": "string", - "format": "date", - "title": "Embargo end date", - "description": "Date at which the article or manuscript may be made public" - }, - "hints": { - "type": "object", - "title": "Hints provided by the UI to backend services", - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "additionalProperties": false, - "properties": { - "collection-tags": { - "type": "array", - "uniqueItems": true, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "items": { - "type": "string" - } - } - } - }, - "journal-NLMTA-ID": { - "type": "string", - "title": "NTMLA", - "description": "NLM identifier for a journal" - }, - "journal-title": { - "type": "string", - "title": "Journal title", - "description": "Title of the journal the individual article or manuscript was submitted to" - }, - "journal-title-short": { - "type": "string", - "title": "Short journal title", - "description": "Short journal title from CrossRef" - }, - "issue": { - "type": "string", - "title": "Journal issue", - "description": "Issue number of the journal this article or manuscript was submitted to" - }, - "issns": { - "type": "array", - "title": "ISSN information for the manuscript's journal", - "description": "List of ISSN numbers with optional publication type", - "uniqueItems": true, - "items": { - "type": "object", - "title": "ISSN info", - "properties": { - "issn": { - "type": "string", - "title": "ISSN " - }, - "pubType": { - "type": "string", - "title": "publication type", - "enum": ["Print", "Online"] - } - } - } - }, - "publisher": { - "type": "string", - "title": "Publisher", - "description": "Publisher of the journal this article or manuscript was submitted to" - }, - "publicationDate": { - "type": "string", - "title": "Publication Date", - "description": "Publication date of the journal or article this manuscript was submitted to", - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'" - }, - "title": { - "type": "string", - "title": "Article / Manuscript Title", - "description": "The title of the individual article or manuscript that was submitted" - }, - "under-embargo": { - "type": "string", - "title": "Under Embargo", - "description": "Indicates wither the article or manuscript is under embargo", - "$comment": "This should probably be a boolean" - }, - "volume": { - "type": "string", - "title": "Journal Volume", - "description": "journal volume this article or manuscript was published in" - } - }, - "dependencies": { - "Embargo-end-date": ["under-embargo"] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title (required)", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title (required)", - "placeholder": "Enter the journal title", - "hidden": false, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID (optional)", - "placeholder": "nlmta", - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "fieldClass": "", - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date (optional)", - "hidden": false, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "placeholder": "dd/mm/yyyy", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "MM/DD/YY", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/jscholarship.json b/pass-core-main/src/test/resources/schemas/jhu/jscholarship.json deleted file mode 100644 index 64cd158b..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/jscholarship.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "title": "JScholarship schema", - "description": "JScholarship-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/jscholarship.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "$ref": "global.json#/properties/authors" - } - }, - "required": ["authors"] - }, - "options": { - "$ref": "global.json#/options" - } - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/form" - } - ] -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/nihms.json b/pass-core-main/src/test/resources/schemas/jhu/nihms.json deleted file mode 100644 index 64ef1a6c..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/nihms.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "title": "NIHMS schema", - "description": "NIHMS-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/nihms.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "NIH Manuscript Submission System (NIHMS)

The following metadata fields will be part of the NIHMS submission.

", - "type": "object", - "properties": { - "journal-NLMTA-ID": { - "$ref": "global.json#/properties/journal-NLMTA-ID" - }, - "issns": { - "$ref": "global.json#/properties/issns" - } - } - }, - "prerequisites": { - "anyOf": [ - {"$ref": "#/definitions/nlmta_present"}, - {"$ref": "#/definitions/issn_present"} - ] - }, - "issn_present": { - "type": "object", - "properties": { - "issns": { - "type": "array", - "contains": { - "type": "object", - "required": [ - "issn", - "pubType" - ], - "properties": { - "issn": { - "type": "string" - }, - "pubType": { - "type": "string" - } - } - } - } - } - }, - "nlmta_present": { - "type": "object", - "required": [ - "journal-NLMTA-ID" - ], - "properties": { - "journal-NLMTA-ID": { - "$ref": "global.json#/properties/journal-NLMTA-ID" - } - } - }, - "options": { - "$ref": "global.json#/options" - } - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/prerequisites" - }, - { - "$ref": "#/definitions/form" - } - ] -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema1.json b/pass-core-main/src/test/resources/schemas/jhu/schema1.json deleted file mode 100644 index 19d4492c..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/foo", - "title": "foo", - "description": "foo schema", - "$comment": "one", - "a": "1", - "x": { - "title": "X", - "description": "a letter", - "$comment": "displays good", - "type": "letter" - }, - "array": ["a", "b", "c"], - "aa": "b", - "cc": ["d", "e"] -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema2.json b/pass-core-main/src/test/resources/schemas/jhu/schema2.json deleted file mode 100644 index 5c3101c7..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema2", - "title": "bar", - "description": "bar schema", - "$comment": "two", - "b": "2", - "x": { - "title": "x", - "description": "an awesome letter", - "$comment": "displays nicely", - "type": "letter" - }, - "array": ["b", "c", "d"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e"], - "aa": "b", - "cc": ["e", "f", "g"] -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema3.json b/pass-core-main/src/test/resources/schemas/jhu/schema3.json deleted file mode 100644 index 641405a4..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema3", - "title": "test", - "description": "test schema", - "$comment": "three", - "c": "3", - "array": ["c", "d", "e"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "f"], - "h": { - "i": "j", - "k": ["l", "m"], - "n": { - "o": "p" - } - } -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema4.json b/pass-core-main/src/test/resources/schemas/jhu/schema4.json deleted file mode 100644 index 4942ff5f..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema4.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema4", - "title": "example", - "description": "example schema", - "$comment": "four", - "d": "4", - "array": ["d", "e", "f"], - "complexarray": ["e", "f", {"g": "h"}], - "h": { - "k": ["l", "m", "m'"], - "n": { - "q": "r" - } - } -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema5.json b/pass-core-main/src/test/resources/schemas/jhu/schema5.json deleted file mode 100644 index 35219cdc..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/jhu/schema", - "$id": "http://example.org/example/schemas/schema4", - "cycleref": "#/cycleref", - "loop_ref": {"$ref": "schema6.json#/loopref"} -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema6.json b/pass-core-main/src/test/resources/schemas/jhu/schema6.json deleted file mode 100644 index 380b4420..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema6.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/jhu/schema_to_dereference", - "$id": "http://example.org/example/schemas/deref_err", - "loop_ref": {"$ref": "schema5.json#/loopref"} -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict1.json b/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict1.json deleted file mode 100644 index 19d4492c..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/foo", - "title": "foo", - "description": "foo schema", - "$comment": "one", - "a": "1", - "x": { - "title": "X", - "description": "a letter", - "$comment": "displays good", - "type": "letter" - }, - "array": ["a", "b", "c"], - "aa": "b", - "cc": ["d", "e"] -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict2.json b/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict2.json deleted file mode 100644 index 1b1c1f03..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema_merge_conflict2.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/foo", - "title": "foo", - "description": "foo schema", - "$comment": "one", - "a": "1", - "x": { - "title": "X", - "description": "a letter", - "$comment": "displays good", - "type": "letter" - }, - "array": { - "title": "Not Array" - }, - "aa": "b", - "cc": ["d", "e"] -} diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref.json b/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref.json deleted file mode 100644 index dc4fa682..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref", - "copySchemaName": {"$ref": "#/$schema"}, - "schema1_title": {"$ref": "schema1.json#/x/title"}, - "schema2_x": {"$ref": "schema2.json#/x"}, - "schema3_array": {"$ref": "schema3.json#/array"}, - "schema4_complexarray": {"$ref": "schema4.json#/complexarray"}, - "schema4_hk": {"$ref": "schema4.json#/h/k"} -} \ No newline at end of file diff --git a/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref_expected.json b/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref_expected.json deleted file mode 100644 index 044672ef..00000000 --- a/pass-core-main/src/test/resources/schemas/jhu/schema_to_deref_expected.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref", - "copySchemaName": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "schema1_title": "X", - "schema2_x": { - "title": "x", - "description": "an awesome letter", - "$comment": "displays nicely", - "type": "letter" - }, - "schema3_array": ["c", "d", "e"], - "schema4_complexarray": ["e", "f", {"g": "h"}], - "schema4_hk": ["l", "m", "m'"] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/pom.xml b/pass-core-metadataschema-service/pom.xml deleted file mode 100644 index 84dabcb0..00000000 --- a/pass-core-metadataschema-service/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.eclipse.pass - pass-core - 2.2.0-SNAPSHOT - - - pass-core-metadataschema-service - - - - - - - org.slf4j - slf4j-api - - - ch.qos.logback - logback-classic - - - org.eclipse.pass - pass-core-object-service - ${project.version} - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - prepare-agent - - prepare-agent - - - - - - - - \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/MergeFailException.java b/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/MergeFailException.java deleted file mode 100644 index 87ce6e41..00000000 --- a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/MergeFailException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -/** - * Custom class exception thrown when a merge fails. - */ -public class MergeFailException extends RuntimeException { - private static final long serialVersionUID = 1L; - - /** - * Constructor class for MergeFailException. - * @param errorMessage The error message. - */ - public MergeFailException(String errorMessage) { - super(errorMessage); - } -} diff --git a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/PassSchemaServiceController.java b/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/PassSchemaServiceController.java deleted file mode 100644 index 96223048..00000000 --- a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/PassSchemaServiceController.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * RestController implementation class PassSchemaServiceController. This class handles the web - * request handling of POST requests from the client. It interacts with the SchemaService class, which handles - * the business logic of retrieving, sorting, and merging the metadata schemas. - * - * @see SchemaService - */ -@RestController -public class PassSchemaServiceController { - private static final Logger LOG = LoggerFactory.getLogger(PassSchemaServiceController.class); - - private final SchemaService schemaService; - - /** - * Constructor for PassSchemaServiceController - * @param schemaService the service responsible for managing schemas - */ - public PassSchemaServiceController(SchemaService schemaService) { - this.schemaService = schemaService; - } - - /** - * Handle GET requests by invoking the SchemaService to handle the business - * logic of generating a merged schema from the list of relevant repository - * schemas to a PASS submission - * - * @param entityIds A comma-separated list of repository entity IDs - * @param mergeSchemaOpt A boolean value indicating whether to merge schemas or return individual schemas - * @throws IOException if the request cannot be read or schema cannot be merged - * @return a merged schema in JSON format or a set of individual schemas in JSON format - */ - @GetMapping("/schema") - public ResponseEntity getSchema(@RequestParam("entityIds") String entityIds, - @RequestParam("merge") String mergeSchemaOpt) throws IOException { - if (entityIds == null || entityIds.isEmpty()) { - LOG.error("No entityIds provided"); - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("No entityIds provided"); - } - if (mergeSchemaOpt == null || mergeSchemaOpt.isEmpty()) { - mergeSchemaOpt = "false"; - } - List repository_list = Arrays.asList(entityIds.split(",")); - - ObjectMapper objectMapper = new ObjectMapper(); - ArrayNode responseArray = objectMapper.createArrayNode(); - - //front-end will first attempt to merge schemas, if that fails, it will attempt to retrieve individual schemas - if (mergeSchemaOpt.equalsIgnoreCase("true")) { - try { - JsonNode mergedSchema = schemaService.getMergedSchema(repository_list); - responseArray.add(mergedSchema); - } catch (IllegalArgumentException | IOException e) { - LOG.error("Failed to parse schemas", e); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to parse schemas"); - } catch (MergeFailException e) { - LOG.error("Failed to merge schemas", e); - return ResponseEntity.status(HttpStatus.CONFLICT).body("Failed to merge schemas"); - } - } else { - List individual_schemas; - try { - individual_schemas = schemaService.getIndividualSchemas(repository_list); - for (JsonNode schema : individual_schemas) { - responseArray.add(schema); - } - } catch (IllegalArgumentException | URISyntaxException | IOException e) { - LOG.error("Failed to retrieve individual schemas", e); - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) - .body("Failed to retrieve individual schemas"); - } - } - - String jsonResponse = objectMapper.writeValueAsString(responseArray); - HttpHeaders headers = new HttpHeaders(); - //APPLICATION_JSON_UTF8 is deprecated and APPLICATION_JSON is preferred, will be interpreted as UTF-8 - headers.setContentType(MediaType.APPLICATION_JSON); - return ResponseEntity.ok().headers(headers).body(jsonResponse); - } - -} diff --git a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaFetcher.java b/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaFetcher.java deleted file mode 100644 index 214c2088..00000000 --- a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaFetcher.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StreamCorruptedException; -import java.net.URI; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.yahoo.elide.RefreshableElide; -import org.eclipse.pass.object.PassClient; -import org.eclipse.pass.object.model.Repository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -/** - * Fetches the schemas from a list of repository URIs and creates a corresponding list of SchemaInstance objects. - * In order to fetch the schemas properly they need to have the following structure in the schema URL: - * repositoryId/metadata-schemas/institution/schema_name.json. When the schemas are fetched the schemas instantiated - * as a SchemaInstance and then dereferenced. Schemas are located in the Resources /schemas directory and grouped by - * their respective institution folder e.g. JHU, Harvard, etc. Adding a new institution needs to be done in the schemas - * directory. - * - * @see SchemaInstance - */ -@Component -public class SchemaFetcher { - private static final Logger LOG = LoggerFactory.getLogger(SchemaFetcher.class); - - private final RefreshableElide refreshableElide; - private final ConcurrentHashMap localSchemaCache = new ConcurrentHashMap<>(); - - /** - * Constructor for SchemaFetcher - * @param refreshableElide A refreshable Elide instance - */ - public SchemaFetcher(RefreshableElide refreshableElide) { - this.refreshableElide = refreshableElide; - } - - /** - * Get all SchemaInstance objects corresponding to the repository URIs - * - * @param entityIds a list of entity IDs - * @return an ArrayList of relevant JsonNode objects - * @throws IOException if the schemas cannot be fetched - */ - List getSchemas(List entityIds) throws IOException { - List schemas = new ArrayList<>(); - List schema_instances = new ArrayList<>(); - - for (String entityId : entityIds) { - List repository_schemas; - repository_schemas = getRepositorySchemas(entityId); - for (JsonNode schema : repository_schemas) { - if (!schemas.contains(schema)) { - schemas.add(schema); - } - } - } - - //order schema dependencies - for (SchemaInstance s : schema_instances) { - for (SchemaInstance k: schema_instances) { - s.updateOrderDeps(k); - } - } - - // dereference each of the schemas - only perform after ordering dependencies - for (JsonNode schema : schemas) { - SchemaInstance s = new SchemaInstance(schema); - s.dereference(s.getSchema(), this); - schema_instances.add(s); - } - - //sort schemas - Collections.sort(schema_instances); - - schemas = new ArrayList<>(); - for (SchemaInstance s : schema_instances) { - schemas.add(s.getSchema()); - } - - return schemas; - } - - /** - * Get the local schema from the path. If the schema is already in the cache, return the cached schema. - * Otherwise, read the schema from the path and add it to the cache. - * - * @param path the path to the local schema - * @return the local schema - * @throws IOException if the schema cannot be found or is corrupted - */ - JsonNode getLocalSchema(String path) throws IOException { - ObjectMapper objmapper = new ObjectMapper(); - if (localSchemaCache.containsKey(path)) { - JsonNode cacheSchema = localSchemaCache.get(path); - return cacheSchema.deepCopy(); - } - - try { - InputStream schema_json = SchemaFetcher.class.getResourceAsStream(path); - JsonNode schema = objmapper.readTree(schema_json); - localSchemaCache.put(path, schema.deepCopy()); - return schema.deepCopy(); - } catch (StreamCorruptedException | NullPointerException e) { - LOG.error("Schema not found at " + path, e); - throw new IOException("Schema not found at " + path, e); - } - } - - /** - * Gets the Repository PASS entity at the URI and generates the corresponding - * SchemaInstance objects - * - * @param entityId the repository ID - * @return an Arraylist of schemas from the repository - * @throws IOException if the repository cannot be found. - */ - private List getRepositorySchemas(String entityId) throws IOException { - List repository_schemas = new ArrayList<>(); - try (PassClient passClient = PassClient.newInstance(refreshableElide)) { - Repository repo = passClient.getObject(Repository.class, Long.parseLong(entityId)); - if (Objects.isNull(repo)) { - throw new IOException("Repository not found at ID: " + entityId); - } - List schema_uris = repo.getSchemas(); - for (URI schema_uri : schema_uris) { - repository_schemas.add(getSchemaFromUri(schema_uri)); - } - } - return repository_schemas; - } - - /** - * Gets the schema at the URI and creates a corresponding SchemaInstance object - * - * @param schemaUri URI of the schema - * @return SchemaInstance schema at URI - * @throws IOException if the schema cannot be fetched - */ - private JsonNode getSchemaFromUri(URI schemaUri) throws IOException { - // Given the schema's $id url, go to the corresponding local json file - // by loading it as a resource stream based on the last 2 parts of the $id - // Create a SchemaInstance object from the json file and return it - String path = schemaUri.getPath(); - String[] path_segments = path.split("/metadata-schemas"); - String path_to_schema = "/schemas" + path_segments[path_segments.length - 1]; - return getLocalSchema(path_to_schema); - } -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaInstance.java b/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaInstance.java deleted file mode 100644 index 3972a292..00000000 --- a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaInstance.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The SchemaInstance class represents a schema map, read from a schema URI that is fetched by the - * SchemaFetcher class. It contains the schema map, as well as a map of dependencies of the schema - * - * @see SchemaFetcher - */ -public class SchemaInstance implements Comparable { - private static final Logger LOG = LoggerFactory.getLogger(SchemaInstance.class); - - private final JsonNode schema; - private final HashMap deps = new HashMap<>(); - private final HashMap refs = new HashMap<>(); - private final String keyRef = "$ref"; - private final String schema_name; - private final String schema_dir; - - // all dependencies of a schema on other schemas, as well as dependencies of the - // schemas with "greater" value than the given schema - private static final Map> orderedDeps = new HashMap<>(); - - /** - * Constructor for SchemaInstance - * @param schema the JSON schema that represents a PASS metadata requirements - */ - public SchemaInstance(JsonNode schema) { - this.schema = schema; - String[] schema_tkns = schema.get("$id").asText().split("/"); - schema_name = schema_tkns[schema_tkns.length - 1]; - schema_dir = schema_tkns[schema_tkns.length - 3] + "/" + schema_tkns[schema_tkns.length - 2]; - findRefs(schema, ""); - findDeps(); - } - - /** - * Sort schemas based on the following rules: If one schema is referenced by - * another in a $ref, then that schema appears before the other For schemas that - * are independent of one another, the one with the greatest number of form - * properties appears before those that have fewer. If two schemas have no - * dependencies and have the same number of properties, the one that appears - * first in the initial list will be first in the result. - * - * @param compareSchema the schema that is being compared to this schema - * @return int 0 if the schemas are equal, -1 if this schema should appear before the schema that is being compared - * to it, 1 if this schema should appear after the schema that is being compared to it - */ - @Override - public int compareTo(SchemaInstance compareSchema) { - // first check if this schema is referenced by schema s; if it is, then this schema should appear before s; - // ie. less than s - if (checkIfReferenced(compareSchema.getName(), schema_name) && - !checkIfReferenced(schema_name, compareSchema.getName())) { - return -1; - } // vice versa - if (checkIfReferenced(schema_name, compareSchema.getName()) - && !checkIfReferenced(compareSchema.getName(), schema_name)) { - return 1; - } - - // for schemas independent of each other, the one with the most form properties should appear first - int this_properties = countFormProperties(); - int s_properties = compareSchema.countFormProperties(); - if (this_properties > s_properties) { - return -1; - } else if (this_properties < s_properties) { - return 1; - } - return 0; - } - - // - /** - * Update the dependencies of the schema that is being compared to this schema. If the schema that is being - * compared to this schema is referenced by this schema, then the dependencies of this schema should be - * updated to include the dependencies of the schema that is being compared to this schema. - * - * @param compareSchema the schema that is being compared to this schema - */ - public void updateOrderDeps(SchemaInstance compareSchema) { - // for schemas independent of each other, the one with the most form properties should appear first - if (!checkIfReferenced(schema_name, compareSchema.getName())) { - int thisProperties = countFormProperties(); - int compareSchemaProperties = compareSchema.countFormProperties(); - if (thisProperties > compareSchemaProperties) { - orderedDeps.put(compareSchema.getName(), orderedDeps.get(schema_name)); - } - } - } - - private boolean checkIfReferenced(String referencer, String schema) { - if (orderedDeps.get(referencer) != null) { - for (String s : orderedDeps.get(referencer)) { - if (s.startsWith(schema)) { - return true; - } - } - } - return false; - } - - /** - * Counts the number of form properties in the schema. The number of properties is used to - * determine the order of schemas in the form. - * - * @return int number of properties - */ - private int countFormProperties() { - int num_properties = 0; - JsonNode properties = schema.at("/definitions/form/properties"); - Iterator properties_iterator = properties.fieldNames(); - while (properties_iterator.hasNext()) { - num_properties++; - properties_iterator.next(); - } - return num_properties; - } - - /** - * Finds references in this schema. Find by going through $ref tags in the - * schema and replacing the internal and external references. - * - * @param node the node that is being searched for references - * @param schemaFetcher to load schemas - */ - public void dereference(JsonNode node, SchemaFetcher schemaFetcher) { - //collect all $refs in a hashmap in the schema and the xPath to the $ref - HashMap allRefs = new HashMap<>(); - getRefAndPointerToObject("", allRefs, node); - - //iterate through allRefs and replace the $ref with the referenced object - for (Map.Entry entry : allRefs.entrySet()) { - String path = entry.getKey(); - String ref = entry.getValue(); - JsonNode replacement; - String[] refParts = ref.split("#"); - String[] allNodePath = path.split("/"); - String parentNodePtr = path.substring(0, path.lastIndexOf("/")); - String parentNodeName = allNodePath[allNodePath.length - 2]; - String topNodePtr = parentNodePtr.substring(0, parentNodePtr.lastIndexOf("/")); - JsonNode parentNode = node.at(parentNodePtr); - JsonNode topNode = node.at(topNodePtr); - - if (ref.charAt(0) == '#') { //internal reference - replacement = resolveRef(refParts[1], schema); - } else { //external reference - JsonNode ext_schema = null; - try { - ext_schema = schemaFetcher.getLocalSchema("/" + schema_dir + "/" + refParts[0]); - } catch (IllegalArgumentException e) { - LOG.error("Invalid Schema URI", e); - } catch (IOException e) { - LOG.error("Failed to dereference schema", e); - } - if (refParts.length == 2) { - replacement = resolveRef(refParts[1], ext_schema); - } else if (refParts.length == 1) { //full schema reference - replacement = ext_schema; - } else { - throw new IllegalArgumentException("Invalid $ref value: " + ref); - } - } - if (topNode.isArray() && parentNode.isObject()) { - ((ObjectNode) parentNode).removeAll(); - ((ObjectNode) parentNode).setAll((ObjectNode) replacement); //replace the $ref node with the referenced - } else { - ((ObjectNode) topNode).replace(parentNodeName, replacement); - } - } - } - - private void getRefAndPointerToObject(String currentPath, HashMap refs, JsonNode schema) { - String newPath = ""; - if (schema.isObject()) { - ObjectNode objectNode = (ObjectNode) schema; - Iterator> iterator = objectNode.fields(); - while (iterator.hasNext()) { - Map.Entry entry = iterator.next(); - newPath = currentPath.isEmpty() ? "/" + entry.getKey() : currentPath + "/" + entry.getKey(); - String currentValue = entry.getValue().asText(); - String currentKey = entry.getKey(); - if (currentKey.equals(keyRef)) { - //put newPath and currentValue in the hashmap - refs.put(newPath, currentValue); - } - getRefAndPointerToObject(newPath, refs, entry.getValue()); - } - } - if (schema.isArray()) { - ArrayNode arrayNode = (ArrayNode) schema; - for (int i = 0; i < arrayNode.size(); i++) { - if (i > 0) { - currentPath = currentPath.substring(0, currentPath.lastIndexOf("/")) + "/" + i; - } else { - currentPath = currentPath + "/" + i; - } - getRefAndPointerToObject(currentPath, refs, arrayNode.get(i)); - } - } - } - - private void findRefs(JsonNode node, String pointer) { - Iterator it = node.fieldNames(); - it.forEachRemaining(k -> { - JsonNode value = node.get(k); - String path; - if (value.isValueNode()) { - if (k.equals(keyRef)) { - path = pointer + "/" + k; - refs.put(path, value.asText()); - } - } else if (value.isObject()) { - findRefs(value, pointer + "/" + k); - } - }); - } - - /** - * Finds dependencies of this schema on other schemas. Find by going through - * $ref tags in the schema and adding only those that point to different schemas - * - */ - private void findDeps() { - refs.forEach((path, ref) -> { - String schema = ref.split("#")[0]; - if (!schema.equals("")) { // only add refs to other schemas; not to itself - deps.put(path, ref); - } - }); - orderedDeps.put(schema_name, deps.values()); - } - - /** - * Find a dependency in a schema - * - * @param dep the reference to resolve - * @param schema the schema to resolve the reference in - * @return the dependency in the schema - */ - private JsonNode resolveRef(String dep, JsonNode schema) { - return schema.at(dep); - } - - /** - * - * @return the schema as a JsonNode - */ - public JsonNode getSchema() { - return schema; - } - - /** - * @return the name of the schema - */ - public String getName() { - return schema_name; - } - - /** - * @return the dependencies of the schema - */ - public HashMap getDeps() { - return deps; - } - -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaService.java b/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaService.java deleted file mode 100644 index b2cdb90e..00000000 --- a/pass-core-metadataschema-service/src/main/java/org/eclipse/pass/metadataschema/SchemaService.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.springframework.stereotype.Service; - -/** - * The SchemaService class handles the business logic of the metadata schema - * service. It can be used to get a merged schema composed of all the schemas - * relevant to the repositories that a PASS submission must be published to. - */ -@Service -public class SchemaService { - - private final SchemaFetcher schemaFetcher; - - /** - * Constructor for SchemaService - * @param schemaFetcher the component responsible for reading schemas - */ - public SchemaService(SchemaFetcher schemaFetcher) { - this.schemaFetcher = schemaFetcher; - } - - /** - * Get a merged schema composed of all the repository schemas provided as input. This uses the SchemaMerger - * class to merge the schemas into a single JSON schema. The schemas are fetched from the repository URIs, - * using the SchemaFetcher class, and then merged using the SchemaMerger class. - * - * @param repository_list List of repository URIs containing schemas to be merged - * @return JsonSchema merged schema - * @throws MergeFailException, if the schemas cannot be merged - * @throws IOException, if the schemas cannot be fetched - */ - JsonNode getMergedSchema(List repository_list) throws MergeFailException, IOException { - List repository_schemas = schemaFetcher.getSchemas(repository_list); - return mergeSchemas(repository_schemas); - } - - List getIndividualSchemas(List repository_list) - throws IllegalArgumentException, URISyntaxException, IOException { - return schemaFetcher.getSchemas(repository_list); - } - - /** - * Merges a list of SchemaInstance object into a single one. Field:value pairs - * should only be added if not already present - * - * @param schemasToMerge list of schemas to be merged - * @return SchemaInstance of merged schemas - */ - JsonNode mergeSchemas(List schemasToMerge) { - ObjectNode merged = new ObjectMapper().createObjectNode(); - Set ignorable = - new HashSet<>(Arrays.asList("title", "description", "$id", "$schema", "$comment")); - for (JsonNode schema : schemasToMerge) { - Iterator fieldnames = schema.fieldNames(); - fieldnames.forEachRemaining(f -> { - if (!ignorable.contains(f)) { - mergeIn(f, schema.get(f), merged); - } - }); - } - return merged; - } - - /** - * Merges a field:value pair into the schema If there is already a value in this - * field, it should be the same type, else error. - * - * @throws MergeFailException, if the field:value pair cannot be merged - */ - private void mergeIn(String fieldName, JsonNode value, ObjectNode schema) throws MergeFailException { - - // if this value is not already in the merged schema, add it - if (schema.get(fieldName) == null) { - schema.set(fieldName, value); - return; - } - - // the field already exists, so check for type agreement - if (value.isValueNode() && !value.isArray()) { - if (!schema.get(fieldName).isValueNode()) { - throw new MergeFailException("Type conflict for property '" + fieldName + "': " - + schema.get(fieldName).getNodeType() + " vs STRING/NUMBER"); - } - schema.set(fieldName, value); - return; - } - if (value.isArray()) { - if (!schema.get(fieldName).isArray()) { - throw new MergeFailException("Type conflict for property '" + fieldName + "': " - + schema.get(fieldName).getNodeType() + " vs ARRAY"); - } - // iterate through array and add elements that are not already in merged schema - for (JsonNode element : value) { - Iterator existing_elements = schema.get(fieldName).elements(); - boolean hasElement = false; - while (existing_elements.hasNext()) { - if (existing_elements.next().equals(element)) { - hasElement = true; - } - } - if (!hasElement) { - ((ArrayNode) (schema.get(fieldName))).add(element); - } - } - return; - } - if (value.isObject()) { - if (!schema.get(fieldName).isObject()) { - throw new MergeFailException("Type conflict for property '" + fieldName + "': " - + schema.get(fieldName).getNodeType() + " vs OBJECT"); - } - Iterator fieldnames = value.fieldNames(); - fieldnames.forEachRemaining(f -> mergeIn(f, value.get(f), (ObjectNode) schema.get(fieldName))); - } - } -} diff --git a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/common.json b/pass-core-metadataschema-service/src/main/resources/schemas/jhu/common.json deleted file mode 100644 index 2c09ee78..00000000 --- a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/common.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "title": "JHU common schema", - "description": "Enumerates the common properties required by most repositories", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/common.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "type": "object", - "title": "Publication Details

Please provide additional information about your article/manuscript below. If DOI was provided in the initial step of the submission, the metadata associated with that DOI was found and used to prepopulatethis form.

Fields that are not editable were populated using metadata associated with the provided DOI.

", - "$comment": "These properties are intended to be displayed in an Alpaca form", - "properties": { - "title": { - "$ref": "global.json#/properties/title" - }, - "journal-title": { - "$ref": "global.json#/properties/journal-title" - }, - "volume": { - "$ref": "global.json#/properties/volume" - }, - "issue": { - "$ref": "global.json#/properties/issue" - }, - "issns": { - "$ref": "global.json#/properties/issns" - }, - "publisher": { - "$ref": "global.json#/properties/publisher" - }, - "publicationDate": { - "$ref": "global.json#/properties/publicationDate" - }, - "abstract": { - "$ref": "global.json#/properties/abstract" - }, - "authors": { - "$ref": "global.json#/properties/authors" - }, - "under-embargo": { - "$ref": "global.json#/properties/under-embargo" - }, - "Embargo-end-date": { - "$ref": "global.json#/properties/Embargo-end-date" - } - }, - "dependencies": { - "Embargo-end-date": ["under-embargo"] - }, - "options": { - "$ref": "global.json#/options" - } - } - } -} diff --git a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/global.json b/pass-core-metadataschema-service/src/main/resources/schemas/jhu/global.json deleted file mode 100644 index 3d2c8018..00000000 --- a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/global.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "title": "JHU global schema", - "description": "Defines all possible metadata fields for PASS deposit", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "$schema", - "title" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "title": "JSON schema", - "description": "The JSON schema that applies to the resulting metadata blob" - }, - "agreements": { - "type": "object", - "title": "Agreements to deposit conditions", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "patternProperties": { - "^.+$": { - "type": "string", - "title": "Agreement", - "description": "Text or link agreed to for the given repository key", - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}" - } - } - }, - "abstract": { - "type": "string", - "title": "Abstract", - "description": "The abstract of the article or manuscript being submitted" - }, - "agent_information": { - "type": "object", - "title": "User agent (browser) information", - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "type": "string", - "title": "User agent (browser) name" - }, - "version": { - "type": "string", - "title": "User agent (browser) version" - } - } - }, - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - }, - "doi": { - "type": "string", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "description": "The DOI of the individual article or manuscript submitted" - }, - "Embargo-end-date": { - "type": "string", - "format": "date", - "title": "Embargo end date", - "description": "Date at which the article or manuscript may be made public" - }, - "hints": { - "type": "object", - "title": "Hints provided by the UI to backend services", - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "additionalProperties": false, - "properties": { - "collection-tags": { - "type": "array", - "uniqueItems": true, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "items": { - "type": "string" - } - } - } - }, - "journal-NLMTA-ID": { - "type": "string", - "title": "NTMLA", - "description": "NLM identifier for a journal" - }, - "journal-title": { - "type": "string", - "title": "Journal title", - "description": "Title of the journal the individual article or manuscript was submitted to" - }, - "journal-title-short": { - "type": "string", - "title": "Short journal title", - "description": "Short journal title from CrossRef" - }, - "issue": { - "type": "string", - "title": "Journal issue", - "description": "Issue number of the journal this article or manuscript was submitted to" - }, - "issns": { - "type": "array", - "title": "ISSN information for the manuscript's journal", - "description": "List of ISSN numbers with optional publication type", - "uniqueItems": true, - "items": { - "type": "object", - "title": "ISSN info", - "properties": { - "issn": { - "type": "string", - "title": "ISSN " - }, - "pubType": { - "type": "string", - "title": "publication type", - "enum": ["Print", "Online"] - } - } - } - }, - "publisher": { - "type": "string", - "title": "Publisher", - "description": "Publisher of the journal this article or manuscript was submitted to" - }, - "publicationDate": { - "type": "string", - "title": "Publication Date", - "description": "Publication date of the journal or article this manuscript was submitted to", - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'" - }, - "title": { - "type": "string", - "title": "Article / Manuscript Title", - "description": "The title of the individual article or manuscript that was submitted" - }, - "under-embargo": { - "type": "string", - "title": "Under Embargo", - "description": "Indicates wither the article or manuscript is under embargo", - "$comment": "This should probably be a boolean" - }, - "volume": { - "type": "string", - "title": "Journal Volume", - "description": "journal volume this article or manuscript was published in" - } - }, - "dependencies": { - "Embargo-end-date": ["under-embargo"] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "readonly": true, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title", - "placeholder": "Enter the journal title", - "hidden": false, - "readonly": true, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID", - "placeholder": "nlmta", - "readonly": true, - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "readonly": true, - "collapsible": false, - "collapsed": false, - "fieldClass": "", - "toolbar": { - "actions": [{ - "action": "add", - "enabled": false - }] - }, - "actionbar": { - "actions": [{ - "action": "add", - "enabled": false - }, { - "action": "remove", - "enabled": false - }, { - "action": "up", - "enabled": false - }, { - "action": "down", - "enabled": false - }] - }, - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date ", - "hidden": false, - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "collapsible": false, - "collapsed": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } -} diff --git a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/inveniordm.json b/pass-core-metadataschema-service/src/main/resources/schemas/jhu/inveniordm.json deleted file mode 100644 index 84ac834a..00000000 --- a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/inveniordm.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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

Deposit requirements for InvenioRDM

", - "type": "object", - "properties": { - "authors": { - "$ref": "global.json#/properties/authors" - } - }, - "required": ["authors", "publicationDate"] - }, - "options": { - "$ref": "global.json#/options" - } - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/form" - } - ] -} diff --git a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/jscholarship.json b/pass-core-metadataschema-service/src/main/resources/schemas/jhu/jscholarship.json deleted file mode 100644 index 887106ad..00000000 --- a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/jscholarship.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "title": "JScholarship schema", - "description": "JScholarship-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/jscholarship.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "$ref": "global.json#/properties/authors" - } - }, - "required": ["authors", "publicationDate"] - }, - "options": { - "$ref": "global.json#/options" - } - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/form" - } - ] -} diff --git a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/nihms.json b/pass-core-metadataschema-service/src/main/resources/schemas/jhu/nihms.json deleted file mode 100644 index 82080d27..00000000 --- a/pass-core-metadataschema-service/src/main/resources/schemas/jhu/nihms.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "title": "NIHMS schema", - "description": "NIHMS-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/nihms.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "journal-title" - ], - "definitions": { - "form": { - "title": "NIH Manuscript Submission System (NIHMS)

The following metadata fields will be part of the NIHMS submission.

", - "type": "object", - "properties": { - "journal-NLMTA-ID": { - "$ref": "global.json#/properties/journal-NLMTA-ID" - }, - "issns": { - "$ref": "global.json#/properties/issns" - } - } - }, - "prerequisites": { - "anyOf": [ - {"$ref": "#/definitions/nlmta_present"}, - {"$ref": "#/definitions/issn_present"} - ] - }, - "issn_present": { - "type": "object", - "properties": { - "issns": { - "type": "array", - "contains": { - "type": "object", - "required": [ - "issn", - "pubType" - ], - "properties": { - "issn": { - "type": "string" - }, - "pubType": { - "type": "string" - } - } - } - } - } - }, - "nlmta_present": { - "type": "object", - "required": [ - "journal-NLMTA-ID" - ], - "properties": { - "journal-NLMTA-ID": { - "$ref": "global.json#/properties/journal-NLMTA-ID" - } - } - }, - "options": { - "$ref": "global.json#/options" - } - }, - "allOf": [ - { - "$ref": "global.json#" - }, - { - "$ref": "#/definitions/prerequisites" - }, - { - "$ref": "#/definitions/form" - } - ] -} diff --git a/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaInstanceTest.java b/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaInstanceTest.java deleted file mode 100644 index 804c93b1..00000000 --- a/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaInstanceTest.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2022 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.yahoo.elide.RefreshableElide; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -class SchemaInstanceTest { - - private ObjectMapper map; - - @BeforeEach - void setup() { - map = new ObjectMapper(); - } - - /* - * Sort schemas based on the following rules: If one schema is referenced by - * another in a $ref, then that schema appears before the other For schemas that - * are independent of one another, the one with the greatest number of form - * properties appears before those that have fewer. If two schemas have no - * dependencies and have the same number of properties, the one that appears - * first in the initial list will be first in the result. - */ - @Test - void testSort() throws JsonProcessingException { - String one = "{\r\n" + " \"$id\": \"http://example.org/schemas/one.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" + " \"foo\": \"bar\"\r\n" - + " }\r\n" + " }\r\n" + " }\r\n" + " }"; - - String two = "{\r\n" + " \"$id\": \"http://example.org/schemas/two.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" - + " \"foo\": {\"$ref\": \"one.json#/definitions/form/properties/foo\"},\r\n" - + " \"bar\": \"baz\",\r\n" - + " \"baz\": {\"$ref\": \"#/definitions/form/properties/bar\"}\r\n" - + " }\r\n" + " }\r\n" + " }\r\n" + " }"; - - String three = "{\r\n" + " \"$id\": \"http://example.org/schemas/three.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" - + " \"foo\": {\"$ref\": \"one.json#/definitions/form/properties/foo\"},\r\n" - + " \"bar\": {\"$ref\": \"two.json#/definitions/form/properties/foo\"},\r\n" - + " \"baz0\": \"value0\",\r\n" + " \"baz\": \"value\"\r\n" - + " }\r\n" + " }\r\n" + " }\r\n" + " }"; - - String four = "{\r\n" + " \"$id\": \"http://example.org/schemas/four.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" - + " \"foo2\": {\"$ref\": \"one.json#/definitions/form/properties/foo\"},\r\n" - + " \"bar2\": {\"$ref\": \"two.json#/definitions/form/properties/foo\"},\r\n" - + " \"baz\": \"value\"\r\n" + " }\r\n" + " }\r\n" - + " }\r\n" + " }"; - - String five = "{\r\n" + " \"$id\": \"http://example.org/schemas/five.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" + " \"one\": 1,\r\n" - + " \"two\": 2\r\n" + " }\r\n" + " }\r\n" + " }\r\n" - + " }"; - - String six = "{\r\n" + " \"$id\": \"http://example.org/schemas/six.json\",\r\n" - + " \"definitions\": {\r\n" + " \"form\": {\r\n" - + " \"properties\": {\r\n" + " \"one\": 1\r\n" - + " }\r\n" + " }\r\n" + " }\r\n" + " }"; - - String seven = "{\r\n" + " \"$id\": \"http://example.org/schemas/seven.json\"\r\n" + " }"; - - SchemaInstance schema1 = new SchemaInstance(map.readTree(one)); - SchemaInstance schema2 = new SchemaInstance(map.readTree(two)); - SchemaInstance schema3 = new SchemaInstance(map.readTree(three)); - SchemaInstance schema4 = new SchemaInstance(map.readTree(four)); - SchemaInstance schema5 = new SchemaInstance(map.readTree(five)); - SchemaInstance schema6 = new SchemaInstance(map.readTree(six)); - SchemaInstance schema7 = new SchemaInstance(map.readTree(seven)); - - ArrayList toSort = new ArrayList<>(Arrays.asList(schema5, schema2, - schema7, schema1, schema6, schema3, schema4)); - ArrayList expected = new ArrayList<>(Arrays.asList(schema1, schema2, - schema3, schema4, schema5, schema6, schema7)); - - for (SchemaInstance s : toSort) { - for (SchemaInstance k: toSort) { - s.updateOrderDeps(k); - } - } - Collections.sort(toSort); - assertEquals(toSort, expected); - } - - @Test - void dereferenceTest() throws JsonProcessingException { - String example_schema_json = "{\r\n" + " \"$schema\": \"http://example.org/schema_to_dereference\",\r\n" - + " \"$id\": \"https://example.org/schemas/jhu/deref\",\r\n" - + " \"copySchemaName\": {\"$ref\": \"#/$schema\"},\r\n" - + " \"title\": {\"$ref\": \"schema1.json#/x/title\"},\r\n" - + " \"x\": {\"$ref\": \"schema2.json#/x\"},\r\n" - + " \"array\": {\"$ref\": \"schema3.json#/array\"},\r\n" - + " \"complexarray\": {\"$ref\": \"schema4.json#/complexarray\"},\r\n" - + " \"k\": {\"$ref\": \"schema4.json#/h/k\"}\r\n" + "}"; - - String expected = "{\r\n" + " \"$schema\": \"http://example.org/schema_to_dereference\",\r\n" - + " \"$id\": \"https://example.org/schemas/jhu/deref\",\r\n" - + " \"copySchemaName\": \"http://example.org/schema_to_dereference\",\r\n" + " \"title\": \"X\",\r\n" - + " \"x\": {\r\n" + " \"title\": \"x\",\r\n" + " \"description\": \"an awesome letter\",\r\n" - + " \"$comment\": \"displays nicely\",\r\n" + " \"type\": \"letter\"\r\n" + " },\r\n" - + " \"array\": [\"c\", \"d\", \"e\"],\r\n" + " \"complexarray\": [\"e\", \"f\", {\"g\": \"h\"}],\r\n" - + " \"k\": [\"l\", \"m\", \"m'\"]\r\n" + "}"; - - SchemaInstance testSchema = new SchemaInstance(map.readTree(example_schema_json)); - SchemaInstance expectedSchema = new SchemaInstance(map.readTree(expected)); - SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class)); - testSchema.dereference(testSchema.getSchema(), schemaFetcher); - assertEquals(expectedSchema.getSchema(), testSchema.getSchema()); - } - - @Test - void dereferenceTest2() throws Exception { - InputStream schemaDerefTest = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/schema_to_deref.json"); - - InputStream expectedDeref = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/schema_to_deref_expected.json"); - - SchemaInstance testSchema = new SchemaInstance(map.readTree(schemaDerefTest)); - SchemaInstance expectedSchema = new SchemaInstance(map.readTree(expectedDeref)); - SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class)); - testSchema.dereference(testSchema.getSchema(), schemaFetcher); - assertEquals(expectedSchema.getSchema(), testSchema.getSchema()); - } - - @Test - void dereferenceArrayObjTest() throws Exception { - InputStream schemaDerefTest = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/deref_obj_array.json"); - - InputStream expectedDeref = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/deref_obj_array_expected.json"); - - SchemaInstance testSchema = new SchemaInstance(map.readTree(schemaDerefTest)); - SchemaInstance expectedSchema = new SchemaInstance(map.readTree(expectedDeref)); - SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class)); - testSchema.dereference(testSchema.getSchema(), schemaFetcher); - assertEquals(expectedSchema.getSchema(), testSchema.getSchema()); - } - - @Test - void dereferenceJscholarSimpleTest() throws Exception { - InputStream jscholarSchemaJson = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/jscholarship_simple.json"); - - InputStream jscholarExpected = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/jscholarship_simple_deref.json"); - - SchemaInstance testSchema = new SchemaInstance(map.readTree(jscholarSchemaJson)); - SchemaInstance expectedSchema = new SchemaInstance(map.readTree(jscholarExpected)); - SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class)); - testSchema.dereference(testSchema.getSchema(), schemaFetcher); - assertEquals(expectedSchema.getSchema(), testSchema.getSchema()); - } - - @Test - void dereferenceJscholarTest() throws Exception { - InputStream jscholarSchemaJson = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/jscholarship.json"); - - InputStream jscholarExpected = SchemaInstanceTest.class - .getResourceAsStream("/schemas/jhu/jscholarship_deref.json"); - - SchemaInstance testSchema = new SchemaInstance(map.readTree(jscholarSchemaJson)); - SchemaInstance expectedSchema = new SchemaInstance(map.readTree(jscholarExpected)); - SchemaFetcher schemaFetcher = new SchemaFetcher(Mockito.mock(RefreshableElide.class)); - testSchema.dereference(testSchema.getSchema(), schemaFetcher); - 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()); - } -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaServiceTest.java b/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaServiceTest.java deleted file mode 100644 index f378a2a4..00000000 --- a/pass-core-metadataschema-service/src/test/java/org/eclipse/pass/metadataschema/SchemaServiceTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * - * Copyright 2023 Johns Hopkins University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.pass.metadataschema; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; - -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.yahoo.elide.RefreshableElide; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -class SchemaServiceTest { - - private SchemaService schemaService; - private ObjectMapper map; - - @BeforeEach - void setup() { - RefreshableElide refreshableElideMock = mock(RefreshableElide.class); - SchemaFetcher schemaFetcher = new SchemaFetcher(refreshableElideMock); - schemaService = new SchemaService(schemaFetcher); - map = new ObjectMapper(); - } - - @Test - void simpleIgnorePreamble() throws Exception { - String schema1 = "{\r\n" + " \"$schema\": \"http://example.org/schema\",\r\n" - + " \"$id\": \"http://example.org/foo\",\r\n" + " \"title\": \"foo\",\r\n" - + " \"description\": \"foo schema\",\r\n" + " \"$comment\": \"one\",\r\n" - + " \"a\": \"1\"\r\n" + " }"; - String schema2 = "{\r\n" + " \"$schema\": \"http://example.org/schema\",\r\n" - + " \"$id\": \"http://example.org/bar\",\r\n" + " \"title\": \"bar\",\r\n" - + " \"description\": \"bar schema\",\r\n" + " \"$comment\": \"two\",\r\n" - + " \"b\": \"2\"\r\n" + " }"; - String expected_json = "{\r\n" + " \"a\": \"1\",\r\n" + " \"b\": \"2\"\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(result, expected); - } - - @Test - void ignorableConflicts() throws Exception { - String schema1 = "{\r\n" + " \"a\": {\r\n" + " \"title\": \"A\",\r\n" - + " \"description\": \"a letter\",\r\n" - + " \"$comment\": \"displays good\",\r\n" + " \"type\": \"letter\"\r\n" - + " }\r\n" + " }"; - String schema2 = "{\r\n" + " \"a\": {\r\n" + " \"title\": \"a\",\r\n" - + " \"description\": \"an awesome letter\",\r\n" - + " \"$comment\": \"displays nicely\",\r\n" + " \"type\": \"letter\"\r\n" - + " }\r\n" + " }"; - String expected_json = "{\r\n" + " \"a\": {\r\n" + " \"title\": \"a\",\r\n" - + " \"$comment\": \"displays nicely\",\r\n" - + " \"description\": \"an awesome letter\",\r\n" - + " \"type\": \"letter\"\r\n" + " }\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(expected, result); - } - - @Test - void simpleArrayDeduplication() throws Exception { - String schema1 = "{\r\n" + " \"array\": [\"a\", \"b\", \"c\"]\r\n" + " }"; - String schema2 = "{\r\n" + " \"array\": [\"b\", \"c\", \"d\"]\r\n" + " }"; - String schema3 = "{\r\n" + " \"array\": [\"c\", \"d\", \"e\"]\r\n" + " }"; - String expected_json = "{\r\n" + " \"array\": [\"a\", \"b\", \"c\", \"d\", \"e\"]\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode schema_three = map.readTree(schema3); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two, schema_three); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(expected, result); - } - - @Test - void complexArrayDeduplication() throws Exception { - String schema1 = "{\r\n" + " \"array\": [{\"a\": [\"b\", {\"c\": \"d\"}]}, \"e\"]\r\n" + " }"; - String schema2 = "{\r\n" + " \"array\": [{\"a\": [\"b\", {\"c\": \"d\"}]}, \"f\"]\r\n" + " }"; - String schema3 = "{\r\n" + " \"array\": [\"e\", \"f\", {\"g\": \"h\"}]\r\n" + " }"; - String expected_json = "{\r\n" - + " \"array\": [{\"a\": [\"b\", {\"c\": \"d\"}]}, \"e\", \"f\", {\"g\": \"h\"}]\r\n" - + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode schema_three = map.readTree(schema3); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two, schema_three); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(expected, result); - } - - @Test - void objectMerge() throws Exception { - String schema1 = "{\r\n" + " \"a\": \"b\",\r\n" + " \"c\": [\"d\", \"e\"]\r\n" - + " }"; - String schema2 = "{\r\n" + " \"a\": \"b\",\r\n" + " \"c\": [\"e\", \"f\", \"g\"]\r\n" - + " }"; - String schema3 = "{\r\n" + " \"h\": {\r\n" + " \"i\": \"j\",\r\n" - + " \"k\": [\"l\", \"m\"],\r\n" + " \"n\": {\r\n" - + " \"o\": \"p\"\r\n" + " }\r\n" + " }\r\n" + " }"; - String schema4 = "{\r\n" + " \"h\": {\r\n" + " \"k\": [\"l\", \"m\", \"m'\"],\r\n" - + " \"n\": {\r\n" + " \"q\": \"r\"\r\n" + " }\r\n" - + " }\r\n" + " }"; - String expected_json = "{\r\n" + " \"a\": \"b\",\r\n" - + " \"c\": [\"d\", \"e\", \"f\", \"g\"],\r\n" + " \"h\": {\r\n" - + " \"i\": \"j\",\r\n" + " \"k\": [\"l\", \"m\", \"m'\"],\r\n" - + " \"n\": {\r\n" + " \"o\": \"p\",\r\n" - + " \"q\": \"r\"\r\n" + " }\r\n" + " }\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode schema_three = map.readTree(schema3); - JsonNode schema_four = map.readTree(schema4); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two, schema_three, schema_four); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(expected, result); - } - - @Test - void testMergerFull() throws Exception { - InputStream schema1 = SchemaServiceTest.class.getResourceAsStream("/schemas/jhu/schema1.json"); - InputStream schema2 = SchemaServiceTest.class.getResourceAsStream("/schemas/jhu/schema2.json"); - InputStream schema3 = SchemaServiceTest.class.getResourceAsStream("/schemas/jhu/schema3.json"); - InputStream schema4 = SchemaServiceTest.class.getResourceAsStream("/schemas/jhu/schema4.json"); - InputStream expected_json = SchemaServiceTest.class - .getResourceAsStream("/schemas/jhu/example_merged_basic.json"); - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - JsonNode schema_three = map.readTree(schema3); - JsonNode schema_four = map.readTree(schema4); - JsonNode expected = map.readTree(expected_json); - - List toMerge = Arrays.asList(schema_one, schema_two, schema_three, schema_four); - JsonNode result = schemaService.mergeSchemas(toMerge); - assertEquals(expected, result); - } - - @Test - void valueNodeTypeConflictTest() throws Exception { - String schema1 = "{\r\n" + " \"key\": [\"l\", \"m\"]\r\n" + " }"; - String schema2 = "{\r\n" + " \"key\": \"keyString\"\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - - List toMerge = Arrays.asList(schema_one, schema_two); - Exception ex = assertThrows(MergeFailException.class, () -> schemaService.mergeSchemas(toMerge)); - - String expectedMessage = "Type conflict for property 'key': ARRAY vs STRING/NUMBER"; - String actualMessage = ex.getMessage(); - - assertEquals(expectedMessage, actualMessage); - } - - @Test - void arrayNodeTypeConflictTest() throws Exception { - String schema1 = "{\r\n" + " \"key\": \"keyString\"\r\n" + " }"; - String schema2 = "{\r\n" + " \"key\": [\"l\", \"m\"]\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - - List toMerge = Arrays.asList(schema_one, schema_two); - Exception ex = assertThrows(MergeFailException.class, () -> schemaService.mergeSchemas(toMerge)); - - String expectedMessage = "Type conflict for property 'key': STRING vs ARRAY"; - String actualMessage = ex.getMessage(); - - assertEquals(expectedMessage, actualMessage); - } - - @Test - void objectNodeTypeConflictTest() throws Exception { - String schema1 = "{\r\n" + " \"key\": \"keyString\"\r\n" + " }"; - String schema2 = "{\r\n" + " \"key\": {\"c\": \"d\"}\r\n" + " }"; - JsonNode schema_one = map.readTree(schema1); - JsonNode schema_two = map.readTree(schema2); - - List toMerge = Arrays.asList(schema_one, schema_two); - Exception ex = assertThrows(MergeFailException.class, () -> schemaService.mergeSchemas(toMerge)); - - String expectedMessage = "Type conflict for property 'key': STRING vs OBJECT"; - String actualMessage = ex.getMessage(); - - assertEquals(expectedMessage, actualMessage); - } - -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array.json deleted file mode 100644 index 54e0a2e6..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/deref_obj_array", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref_obj_array", - "definitions": { - "form": { - "type": "string", - "title": "Deref this" - } - }, - "allOf": [{"$ref": "#/definitions/form"}] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array_expected.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array_expected.json deleted file mode 100644 index 3e41c435..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/deref_obj_array_expected.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/deref_obj_array", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref_obj_array", - "definitions": { - "form": { - "type": "string", - "title": "Deref this" - } - }, - "allOf": [ - { - "type": "string", - "title": "Deref this" - } - ] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_basic.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_basic.json deleted file mode 100644 index 2ce9b49a..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_basic.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "a": "1", - "b": "2", - "c": "3", - "d": "4", - "x": { - "title": "x", - "$comment": "displays nicely", - "description": "an awesome letter", - "type": "letter" - }, - "array": ["a", "b", "c", "d", "e", "f"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e", "f", {"g": "h"}], - "aa": "b", - "cc": ["d", "e", "f", "g"], - "h": { - "i": "j", - "k": ["l", "m", "m'"], - "n": { - "o": "p", - "q": "r" - } - } -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_dereferenced.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_dereferenced.json deleted file mode 100644 index e6e8ffec..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/example_merged_dereferenced.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "a": "1", - "b": "2", - "c": "3", - "d": "4", - "x": { - "title": "x", - "$comment": "displays nicely", - "description": "an awesome letter", - "type": "letter" - }, - "array": ["a", "b", "c", "d", "e", "f"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e", "f", {"g": "h"}], - "aa": "b", - "cc": ["d", "e", "f", "g"], - "h": { - "i": "j", - "k": ["l", "m", "m'"], - "n": { - "o": "p", - "q": "r" - } - }, - "copySchemaName": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "k": ["l", "m", "m'"] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json deleted file mode 100644 index 459cc13a..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/expected_jscholarship_common_merge.json +++ /dev/null @@ -1,704 +0,0 @@ -[ - { - "allOf": [ - { - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "description": "Defines all possible metadata fields for PASS deposit", - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - }, - "properties": { - "$schema": { - "description": "The JSON schema that applies to the resulting metadata blob", - "title": "JSON schema", - "type": "string" - }, - "Embargo-end-date": { - "description": "Date at which the article or manuscript may be made public", - "format": "date", - "title": "Embargo end date", - "type": "string" - }, - "abstract": { - "description": "The abstract of the article or manuscript being submitted", - "title": "Abstract", - "type": "string" - }, - "agent_information": { - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "title": "User agent (browser) name", - "type": "string" - }, - "version": { - "title": "User agent (browser) version", - "type": "string" - } - }, - "title": "User agent (browser) information", - "type": "object" - }, - "agreements": { - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "patternProperties": { - "^.+$": { - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}", - "description": "Text or link agreed to for the given repository key", - "title": "Agreement", - "type": "string" - } - }, - "title": "Agreements to deposit conditions", - "type": "object" - }, - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - }, - "doi": { - "description": "The DOI of the individual article or manuscript submitted", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "type": "string" - }, - "hints": { - "additionalProperties": false, - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "properties": { - "collection-tags": { - "items": { - "type": "string" - }, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "type": "array", - "uniqueItems": true - } - }, - "title": "Hints provided by the UI to backend services", - "type": "object" - }, - "issns": { - "description": "List of ISSN numbers with optional publication type", - "items": { - "properties": { - "issn": { - "title": "ISSN ", - "type": "string" - }, - "pubType": { - "enum": [ - "Print", - "Online" - ], - "title": "publication type", - "type": "string" - } - }, - "title": "ISSN info", - "type": "object" - }, - "title": "ISSN information for the manuscript's journal", - "type": "array", - "uniqueItems": true - }, - "issue": { - "description": "Issue number of the journal this article or manuscript was submitted to", - "title": "Journal issue", - "type": "string" - }, - "journal-NLMTA-ID": { - "description": "NLM identifier for a journal", - "title": "NTMLA", - "type": "string" - }, - "journal-title": { - "description": "Title of the journal the individual article or manuscript was submitted to", - "title": "Journal title", - "type": "string" - }, - "journal-title-short": { - "description": "Short journal title from CrossRef", - "title": "Short journal title", - "type": "string" - }, - "publicationDate": { - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'", - "description": "Publication date of the journal or article this manuscript was submitted to", - "title": "Publication Date", - "type": "string" - }, - "publisher": { - "description": "Publisher of the journal this article or manuscript was submitted to", - "title": "Publisher", - "type": "string" - }, - "title": { - "description": "The title of the individual article or manuscript that was submitted", - "title": "Article / Manuscript Title", - "type": "string" - }, - "under-embargo": { - "$comment": "This should probably be a boolean", - "description": "Indicates wither the article or manuscript is under embargo", - "title": "Under Embargo", - "type": "string" - }, - "volume": { - "description": "journal volume this article or manuscript was published in", - "title": "Journal Volume", - "type": "string" - } - }, - "required": [ - "$schema", - "title", - "journal-title" - ], - "title": "JHU global schema", - "type": "object" - }, - { - "properties": { - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - } - }, - "required": [ - "authors" - ], - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object" - } - ], - "definitions": { - "form": { - "$comment": "These properties are intended to be displayed in an Alpaca form", - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - }, - "properties": { - "Embargo-end-date": { - "description": "Date at which the article or manuscript may be made public", - "format": "date", - "title": "Embargo end date", - "type": "string" - }, - "abstract": { - "description": "The abstract of the article or manuscript being submitted", - "title": "Abstract", - "type": "string" - }, - "authors": { - "description": "List of authors and their associated ORCIDS, if available", - "items": { - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ], - "title": "Author", - "type": "object" - }, - "title": "Authors of this article or manuscript", - "type": "array", - "uniqueItems": true - }, - "issns": { - "description": "List of ISSN numbers with optional publication type", - "items": { - "properties": { - "issn": { - "title": "ISSN ", - "type": "string" - }, - "pubType": { - "enum": [ - "Print", - "Online" - ], - "title": "publication type", - "type": "string" - } - }, - "title": "ISSN info", - "type": "object" - }, - "title": "ISSN information for the manuscript's journal", - "type": "array", - "uniqueItems": true - }, - "issue": { - "description": "Issue number of the journal this article or manuscript was submitted to", - "title": "Journal issue", - "type": "string" - }, - "journal-title": { - "description": "Title of the journal the individual article or manuscript was submitted to", - "title": "Journal title", - "type": "string" - }, - "publicationDate": { - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'", - "description": "Publication date of the journal or article this manuscript was submitted to", - "title": "Publication Date", - "type": "string" - }, - "publisher": { - "description": "Publisher of the journal this article or manuscript was submitted to", - "title": "Publisher", - "type": "string" - }, - "title": { - "description": "The title of the individual article or manuscript that was submitted", - "title": "Article / Manuscript Title", - "type": "string" - }, - "under-embargo": { - "$comment": "This should probably be a boolean", - "description": "Indicates wither the article or manuscript is under embargo", - "title": "Under Embargo", - "type": "string" - }, - "volume": { - "description": "journal volume this article or manuscript was published in", - "title": "Journal Volume", - "type": "string" - } - }, - "required": [ - "authors" - ], - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object" - }, - "options": { - "fields": { - "Embargo-end-date": { - "dependencies": { - "under-embargo": true - }, - "fieldClass": "date-time-picker", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "inputType": "date", - "label": "Embargo End Date", - "order": 12, - "picker": { - "allowInputToggle": true, - "format": "MM/DD/YY" - }, - "placeholder": "dd/mm/yyyy", - "type": "date", - "validate": true - }, - "abstract": { - "fieldClass": "clearfix", - "hidden": false, - "label": "Abstract (optional)", - "order": 9, - "placeholder": "Enter abstract", - "type": "textarea" - }, - "authors": { - "hidden": false, - "items": { - "fields": { - "author": { - "fieldClass": "body-text col-6 pull-left pl-0", - "label": "Name" - }, - "orcid": { - "fieldClass": "body-text col-6 pull-left pr-0", - "label": "ORCiD" - } - }, - "label": "" - }, - "label": "
Authors

", - "order": 10 - }, - "issns": { - "fieldClass": "", - "hidden": false, - "items": { - "fieldClass": "row", - "fields": { - "issn": { - "fieldClass": "body-text col-6 pull-left ", - "label": "ISSN" - }, - "pubType": { - "fieldClass": "body-text col-6 pull-left md-pubtype", - "label": "Publication Type", - "removeDefaultNone": true, - "vertical": false - } - }, - "label": "" - }, - "label": "
ISSN Information

", - "order": 6 - }, - "issue": { - "hidden": false, - "label": "Issue (optional)", - "order": 5, - "placeholder": "Enter issue", - "type": "text" - }, - "journal-NLMTA-ID": { - "label": "Journal NLMTA ID (optional)", - "order": 3, - "placeholder": "nlmta", - "type": "text" - }, - "journal-title": { - "hidden": false, - "label": "Journal Title (required)", - "order": 2, - "placeholder": "Enter the journal title", - "type": "text" - }, - "publicationDate": { - "hidden": false, - "label": "Publication Date (optional)", - "order": 8, - "type": "date" - }, - "publisher": { - "hidden": false, - "label": "Publisher (optional)", - "order": 7, - "placeholder": "Enter the Publisher", - "type": "text" - }, - "title": { - "cols": 100, - "hidden": false, - "label": "Article / Manuscript Title (required)", - "order": 1, - "placeholder": "Enter the manuscript title", - "rows": 2, - "type": "textarea" - }, - "under-embargo": { - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11, - "rightLabel": "The material being submitted is published under an embargo.", - "type": "checkbox" - }, - "volume": { - "hidden": false, - "label": "Volume (optional)", - "order": 4, - "placeholder": "Enter the volume", - "type": "text" - } - } - } - }, - "type": "object" - } -] diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/inveniordm_deref.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/inveniordm_deref.json deleted file mode 100644 index 08b4d4c0..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/inveniordm_deref.json +++ /dev/null @@ -1,589 +0,0 @@ -{ - "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

Deposit requirements for InvenioRDM

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - } - }, - "required": [ - "authors", - "publicationDate" - ] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "readonly": true, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title", - "placeholder": "Enter the journal title", - "hidden": false, - "readonly": true, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID", - "placeholder": "nlmta", - "readonly": true, - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "readonly": true, - "collapsible": false, - "collapsed": false, - "fieldClass": "", - "toolbar": { - "actions": [ - { - "action": "add", - "enabled": false - } - ] - }, - "actionbar": { - "actions": [ - { - "action": "add", - "enabled": false - }, - { - "action": "remove", - "enabled": false - }, - { - "action": "up", - "enabled": false - }, - { - "action": "down", - "enabled": false - } - ] - }, - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date ", - "hidden": false, - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "collapsible": false, - "collapsed": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - }, - "allOf": [ - { - "title": "JHU global schema", - "description": "Defines all possible metadata fields for PASS deposit", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "$schema", - "title" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "title": "JSON schema", - "description": "The JSON schema that applies to the resulting metadata blob" - }, - "agreements": { - "type": "object", - "title": "Agreements to deposit conditions", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "patternProperties": { - "^.+$": { - "type": "string", - "title": "Agreement", - "description": "Text or link agreed to for the given repository key", - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}" - } - } - }, - "abstract": { - "type": "string", - "title": "Abstract", - "description": "The abstract of the article or manuscript being submitted" - }, - "agent_information": { - "type": "object", - "title": "User agent (browser) information", - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "type": "string", - "title": "User agent (browser) name" - }, - "version": { - "type": "string", - "title": "User agent (browser) version" - } - } - }, - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - }, - "doi": { - "type": "string", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "description": "The DOI of the individual article or manuscript submitted" - }, - "Embargo-end-date": { - "type": "string", - "format": "date", - "title": "Embargo end date", - "description": "Date at which the article or manuscript may be made public" - }, - "hints": { - "type": "object", - "title": "Hints provided by the UI to backend services", - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "additionalProperties": false, - "properties": { - "collection-tags": { - "type": "array", - "uniqueItems": true, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "items": { - "type": "string" - } - } - } - }, - "journal-NLMTA-ID": { - "type": "string", - "title": "NTMLA", - "description": "NLM identifier for a journal" - }, - "journal-title": { - "type": "string", - "title": "Journal title", - "description": "Title of the journal the individual article or manuscript was submitted to" - }, - "journal-title-short": { - "type": "string", - "title": "Short journal title", - "description": "Short journal title from CrossRef" - }, - "issue": { - "type": "string", - "title": "Journal issue", - "description": "Issue number of the journal this article or manuscript was submitted to" - }, - "issns": { - "type": "array", - "title": "ISSN information for the manuscript's journal", - "description": "List of ISSN numbers with optional publication type", - "uniqueItems": true, - "items": { - "type": "object", - "title": "ISSN info", - "properties": { - "issn": { - "type": "string", - "title": "ISSN " - }, - "pubType": { - "type": "string", - "title": "publication type", - "enum": [ - "Print", - "Online" - ] - } - } - } - }, - "publisher": { - "type": "string", - "title": "Publisher", - "description": "Publisher of the journal this article or manuscript was submitted to" - }, - "publicationDate": { - "type": "string", - "title": "Publication Date", - "description": "Publication date of the journal or article this manuscript was submitted to", - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'" - }, - "title": { - "type": "string", - "title": "Article / Manuscript Title", - "description": "The title of the individual article or manuscript that was submitted" - }, - "under-embargo": { - "type": "string", - "title": "Under Embargo", - "description": "Indicates wither the article or manuscript is under embargo", - "$comment": "This should probably be a boolean" - }, - "volume": { - "type": "string", - "title": "Journal Volume", - "description": "journal volume this article or manuscript was published in" - } - }, - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "readonly": true, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title", - "placeholder": "Enter the journal title", - "hidden": false, - "readonly": true, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID", - "placeholder": "nlmta", - "readonly": true, - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "readonly": true, - "collapsible": false, - "collapsed": false, - "fieldClass": "", - "toolbar": { - "actions": [ - { - "action": "add", - "enabled": false - } - ] - }, - "actionbar": { - "actions": [ - { - "action": "add", - "enabled": false - }, - { - "action": "remove", - "enabled": false - }, - { - "action": "up", - "enabled": false - }, - { - "action": "down", - "enabled": false - } - ] - }, - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date ", - "hidden": false, - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "collapsible": false, - "collapsed": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - }, - { - "title": "InvenioRDM

Deposit requirements for InvenioRDM

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - } - }, - "required": [ - "authors", - "publicationDate" - ] - } - ] -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_deref.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_deref.json deleted file mode 100644 index 144f3ac6..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_deref.json +++ /dev/null @@ -1,589 +0,0 @@ -{ - "title": "JScholarship schema", - "description": "JScholarship-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/jscholarship.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - } - }, - "required": [ - "authors", - "publicationDate" - ] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "readonly": true, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title", - "placeholder": "Enter the journal title", - "hidden": false, - "readonly": true, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID", - "placeholder": "nlmta", - "readonly": true, - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "readonly": true, - "collapsible": false, - "collapsed": false, - "fieldClass": "", - "toolbar": { - "actions": [ - { - "action": "add", - "enabled": false - } - ] - }, - "actionbar": { - "actions": [ - { - "action": "add", - "enabled": false - }, - { - "action": "remove", - "enabled": false - }, - { - "action": "up", - "enabled": false - }, - { - "action": "down", - "enabled": false - } - ] - }, - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date ", - "hidden": false, - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "collapsible": false, - "collapsed": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - }, - "allOf": [ - { - "title": "JHU global schema", - "description": "Defines all possible metadata fields for PASS deposit", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "$schema", - "title" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "title": "JSON schema", - "description": "The JSON schema that applies to the resulting metadata blob" - }, - "agreements": { - "type": "object", - "title": "Agreements to deposit conditions", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "patternProperties": { - "^.+$": { - "type": "string", - "title": "Agreement", - "description": "Text or link agreed to for the given repository key", - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}" - } - } - }, - "abstract": { - "type": "string", - "title": "Abstract", - "description": "The abstract of the article or manuscript being submitted" - }, - "agent_information": { - "type": "object", - "title": "User agent (browser) information", - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "type": "string", - "title": "User agent (browser) name" - }, - "version": { - "type": "string", - "title": "User agent (browser) version" - } - } - }, - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - }, - "doi": { - "type": "string", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "description": "The DOI of the individual article or manuscript submitted" - }, - "Embargo-end-date": { - "type": "string", - "format": "date", - "title": "Embargo end date", - "description": "Date at which the article or manuscript may be made public" - }, - "hints": { - "type": "object", - "title": "Hints provided by the UI to backend services", - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "additionalProperties": false, - "properties": { - "collection-tags": { - "type": "array", - "uniqueItems": true, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "items": { - "type": "string" - } - } - } - }, - "journal-NLMTA-ID": { - "type": "string", - "title": "NTMLA", - "description": "NLM identifier for a journal" - }, - "journal-title": { - "type": "string", - "title": "Journal title", - "description": "Title of the journal the individual article or manuscript was submitted to" - }, - "journal-title-short": { - "type": "string", - "title": "Short journal title", - "description": "Short journal title from CrossRef" - }, - "issue": { - "type": "string", - "title": "Journal issue", - "description": "Issue number of the journal this article or manuscript was submitted to" - }, - "issns": { - "type": "array", - "title": "ISSN information for the manuscript's journal", - "description": "List of ISSN numbers with optional publication type", - "uniqueItems": true, - "items": { - "type": "object", - "title": "ISSN info", - "properties": { - "issn": { - "type": "string", - "title": "ISSN " - }, - "pubType": { - "type": "string", - "title": "publication type", - "enum": [ - "Print", - "Online" - ] - } - } - } - }, - "publisher": { - "type": "string", - "title": "Publisher", - "description": "Publisher of the journal this article or manuscript was submitted to" - }, - "publicationDate": { - "type": "string", - "title": "Publication Date", - "description": "Publication date of the journal or article this manuscript was submitted to", - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'" - }, - "title": { - "type": "string", - "title": "Article / Manuscript Title", - "description": "The title of the individual article or manuscript that was submitted" - }, - "under-embargo": { - "type": "string", - "title": "Under Embargo", - "description": "Indicates wither the article or manuscript is under embargo", - "$comment": "This should probably be a boolean" - }, - "volume": { - "type": "string", - "title": "Journal Volume", - "description": "journal volume this article or manuscript was published in" - } - }, - "dependencies": { - "Embargo-end-date": [ - "under-embargo" - ] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "readonly": true, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title", - "placeholder": "Enter the journal title", - "hidden": false, - "readonly": true, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID", - "placeholder": "nlmta", - "readonly": true, - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "readonly": true, - "collapsible": false, - "collapsed": false, - "fieldClass": "", - "toolbar": { - "actions": [ - { - "action": "add", - "enabled": false - } - ] - }, - "actionbar": { - "actions": [ - { - "action": "add", - "enabled": false - }, - { - "action": "remove", - "enabled": false - }, - { - "action": "up", - "enabled": false - }, - { - "action": "down", - "enabled": false - } - ] - }, - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date ", - "hidden": false, - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "collapsible": false, - "collapsed": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "L", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - }, - { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": [ - "author" - ] - } - } - }, - "required": [ - "authors", - "publicationDate" - ] - } - ] -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_merge_deref.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_merge_deref.json deleted file mode 100644 index 89df188b..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_merge_deref.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - } - }, - "required": ["authors"] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title (required)", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title (required)", - "placeholder": "Enter the journal title", - "hidden": false, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID (optional)", - "placeholder": "nlmta", - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "fieldClass": "", - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date (optional)", - "hidden": false, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "placeholder": "dd/mm/yyyy", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "MM/DD/YY", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - }, - "allOf": [ - { - "title": "JHU global schema", - "description": "Defines all possible metadata fields for PASS deposit", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/global.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "$schema", - "title", - "journal-title" - ], - "additionalProperties": false, - "properties": { - "$schema": { - "type": "string", - "title": "JSON schema", - "description": "The JSON schema that applies to the resulting metadata blob" - }, - "agreements": { - "type": "object", - "title": "Agreements to deposit conditions", - "description": "Maps repository keys to the text or links containing the agreements accepted by the submitter", - "$comment": "This was formerly known as 'embargo', available only for JScholarship metadata", - "patternProperties": { - "^.+$": { - "type": "string", - "title": "Agreement", - "description": "Text or link agreed to for the given repository key", - "$comment": "Example: {'jScholarship': 'http://example.org/agreementText'}" - } - } - }, - "abstract": { - "type": "string", - "title": "Abstract", - "description": "The abstract of the article or manuscript being submitted" - }, - "agent_information": { - "type": "object", - "title": "User agent (browser) information", - "description": "Contains the identity and version of the user's browser", - "properties": { - "name": { - "type": "string", - "title": "User agent (browser) name" - }, - "version": { - "type": "string", - "title": "User agent (browser) version" - } - } - }, - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - }, - "doi": { - "type": "string", - "pattern": "^10\\..+?/.+?$", - "title": "DOI of article", - "description": "The DOI of the individual article or manuscript submitted" - }, - "Embargo-end-date": { - "type": "string", - "format": "date", - "title": "Embargo end date", - "description": "Date at which the article or manuscript may be made public" - }, - "hints": { - "type": "object", - "title": "Hints provided by the UI to backend services", - "description": "Hints have semantics shared by the UI and the backend that are intended to influence the backend processing of the submission.", - "additionalProperties": false, - "properties": { - "collection-tags": { - "type": "array", - "uniqueItems": true, - "title": "Tags impacting the collection used by Deposit Services for deposit", - "items": { - "type": "string" - } - } - } - }, - "journal-NLMTA-ID": { - "type": "string", - "title": "NTMLA", - "description": "NLM identifier for a journal" - }, - "journal-title": { - "type": "string", - "title": "Journal title", - "description": "Title of the journal the individual article or manuscript was submitted to" - }, - "journal-title-short": { - "type": "string", - "title": "Short journal title", - "description": "Short journal title from CrossRef" - }, - "issue": { - "type": "string", - "title": "Journal issue", - "description": "Issue number of the journal this article or manuscript was submitted to" - }, - "issns": { - "type": "array", - "title": "ISSN information for the manuscript's journal", - "description": "List of ISSN numbers with optional publication type", - "uniqueItems": true, - "items": { - "type": "object", - "title": "ISSN info", - "properties": { - "issn": { - "type": "string", - "title": "ISSN " - }, - "pubType": { - "type": "string", - "title": "publication type", - "enum": ["Print", "Online"] - } - } - } - }, - "publisher": { - "type": "string", - "title": "Publisher", - "description": "Publisher of the journal this article or manuscript was submitted to" - }, - "publicationDate": { - "type": "string", - "title": "Publication Date", - "description": "Publication date of the journal or article this manuscript was submitted to", - "$comment": "This was formerly date-time format, but that appears too precise for values like 'Summer 2018'" - }, - "title": { - "type": "string", - "title": "Article / Manuscript Title", - "description": "The title of the individual article or manuscript that was submitted" - }, - "under-embargo": { - "type": "string", - "title": "Under Embargo", - "description": "Indicates wither the article or manuscript is under embargo", - "$comment": "This should probably be a boolean" - }, - "volume": { - "type": "string", - "title": "Journal Volume", - "description": "journal volume this article or manuscript was published in" - } - }, - "dependencies": { - "Embargo-end-date": ["under-embargo"] - }, - "options": { - "fields": { - "title": { - "type": "textarea", - "label": "Article / Manuscript Title (required)", - "placeholder": "Enter the manuscript title", - "rows": 2, - "cols": 100, - "hidden": false, - "order": 1 - }, - "journal-title": { - "type": "text", - "label": "Journal Title (required)", - "placeholder": "Enter the journal title", - "hidden": false, - "order": 2 - }, - "journal-NLMTA-ID": { - "type": "text", - "label": "Journal NLMTA ID (optional)", - "placeholder": "nlmta", - "order": 3 - }, - "volume": { - "type": "text", - "label": "Volume (optional)", - "placeholder": "Enter the volume", - "hidden": false, - "order": 4 - }, - "issue": { - "type": "text", - "label": "Issue (optional)", - "placeholder": "Enter issue", - "hidden": false, - "order": 5 - }, - "issns": { - "label": "
ISSN Information

", - "hidden": false, - "fieldClass": "", - "items": { - "label": "", - "fieldClass": "row", - "fields": { - "issn": { - "label": "ISSN", - "fieldClass": "body-text col-6 pull-left " - }, - "pubType": { - "label": "Publication Type", - "fieldClass": "body-text col-6 pull-left md-pubtype", - "vertical": false, - "removeDefaultNone": true - } - } - }, - "order": 6 - }, - "publisher": { - "type": "text", - "label": "Publisher (optional)", - "placeholder": "Enter the Publisher", - "hidden": false, - "order": 7 - }, - "publicationDate": { - "type": "date", - "label": "Publication Date (optional)", - "hidden": false, - "order": 8 - }, - "abstract": { - "type": "textarea", - "label": "Abstract (optional)", - "placeholder": "Enter abstract", - "fieldClass": "clearfix", - "hidden": false, - "order": 9 - }, - "authors": { - "label": "
Authors

", - "hidden": false, - "items": { - "label": "", - "fields": { - "author": { - "label": "Name", - "fieldClass": "body-text col-6 pull-left pl-0" - }, - "orcid": { - "label": "ORCiD", - "fieldClass": "body-text col-6 pull-left pr-0" - } - } - }, - "order": 10 - }, - "under-embargo": { - "type": "checkbox", - "rightLabel": "The material being submitted is published under an embargo.", - "fieldClass": "m-0 mt-4", - "hidden": false, - "order": 11 - }, - "Embargo-end-date": { - "type": "date", - "label": "Embargo End Date", - "helper": "After the embargo end date, your submission manuscripts or article can be made public. If this publication is not under embargo, please leave this field blank.", - "helpersPosition": "above", - "placeholder": "dd/mm/yyyy", - "validate": true, - "inputType": "date", - "fieldClass": "date-time-picker", - "picker": { - "format": "MM/DD/YY", - "allowInputToggle": true - }, - "order": 12, - "dependencies": { - "under-embargo": true - } - } - } - } - - }, - { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - } - }, - "required": ["authors"] - } - ] -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple.json deleted file mode 100644 index 23c91662..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": "JScholarship schema", - "description": "JScholarship-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/jscholarship.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "$ref": "global.json#/properties/authors" - } - }, - "required": ["authors"] - } - }, - "allOf": [ - { - "$ref": "#/definitions/form" - } - ] -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple_deref.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple_deref.json deleted file mode 100644 index 0350d938..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/jscholarship_simple_deref.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "title": "JScholarship schema", - "description": "JScholarship-specific metadata requirements", - "$id": "https://eclipse-pass.github.io/pass-metadata-schemas/schemas/jhu/jscholarship.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "definitions": { - "form": { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - } - }, - "required": ["authors"] - } - }, - "allOf": [ - { - "title": "Johns Hopkins - JScholarship

Deposit requirements for JH's institutional repository JScholarship

", - "type": "object", - "properties": { - "authors": { - "type": "array", - "title": "Authors of this article or manuscript", - "description": "List of authors and their associated ORCIDS, if available", - "uniqueItems": true, - "items": { - "type": "object", - "title": "Author", - "properties": { - "author": { - "type": "string" - }, - "orcid": { - "type": "string" - } - }, - "required": ["author"] - } - } - }, - "required": ["authors"] - } - ] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema1.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema1.json deleted file mode 100644 index 19d4492c..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/foo", - "title": "foo", - "description": "foo schema", - "$comment": "one", - "a": "1", - "x": { - "title": "X", - "description": "a letter", - "$comment": "displays good", - "type": "letter" - }, - "array": ["a", "b", "c"], - "aa": "b", - "cc": ["d", "e"] -} diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema2.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema2.json deleted file mode 100644 index 5c3101c7..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema2", - "title": "bar", - "description": "bar schema", - "$comment": "two", - "b": "2", - "x": { - "title": "x", - "description": "an awesome letter", - "$comment": "displays nicely", - "type": "letter" - }, - "array": ["b", "c", "d"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "e"], - "aa": "b", - "cc": ["e", "f", "g"] -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema3.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema3.json deleted file mode 100644 index 641405a4..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema3", - "title": "test", - "description": "test schema", - "$comment": "three", - "c": "3", - "array": ["c", "d", "e"], - "complexarray": [{"a": ["b", {"c": "d"}]}, "f"], - "h": { - "i": "j", - "k": ["l", "m"], - "n": { - "o": "p" - } - } -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema4.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema4.json deleted file mode 100644 index 4942ff5f..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema4.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu", - "$id": "http://example.org/metadata-schemas/schemas/jhu/schema4", - "title": "example", - "description": "example schema", - "$comment": "four", - "d": "4", - "array": ["d", "e", "f"], - "complexarray": ["e", "f", {"g": "h"}], - "h": { - "k": ["l", "m", "m'"], - "n": { - "q": "r" - } - } -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema5.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema5.json deleted file mode 100644 index 35219cdc..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/jhu/schema", - "$id": "http://example.org/example/schemas/schema4", - "cycleref": "#/cycleref", - "loop_ref": {"$ref": "schema6.json#/loopref"} -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema6.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema6.json deleted file mode 100644 index 380b4420..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema6.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/jhu/schema_to_dereference", - "$id": "http://example.org/example/schemas/deref_err", - "loop_ref": {"$ref": "schema5.json#/loopref"} -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref.json deleted file mode 100644 index 7ae70502..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref", - "copySchemaName": {"$ref": "#/$schema"}, - "title": {"$ref": "schema1.json#/x/title"}, - "x": {"$ref": "schema2.json#/x"}, - "array": {"$ref": "schema3.json#/array"}, - "complexarray": {"$ref": "schema4.json#/complexarray"}, - "k": {"$ref": "schema4.json#/h/k"} -} \ No newline at end of file diff --git a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref_expected.json b/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref_expected.json deleted file mode 100644 index ecf554d6..00000000 --- a/pass-core-metadataschema-service/src/test/resources/schemas/jhu/schema_to_deref_expected.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "$id": "http://example.org/metadata-schemas/schemas/jhu/deref", - "copySchemaName": "http://example.org/metadata-schemas/schemas/jhu/schema_to_dereference", - "title": "X", - "x": { - "title": "x", - "description": "an awesome letter", - "$comment": "displays nicely", - "type": "letter" - }, - "array": ["c", "d", "e"], - "complexarray": ["e", "f", {"g": "h"}], - "k": ["l", "m", "m'"] -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1c7ac4ac..172cd601 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,6 @@ pass-core-file-service pass-core-user-service pass-core-main - pass-core-metadataschema-service pass-core-policy-service pass-core-usertoken pass-core-test-config