From 7ecfd161ec23aaa57c5bdd64433572da36dc61c0 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 28 Jun 2022 11:57:46 +0300 Subject: [PATCH 01/52] temporarily disabled security for registry-core calls --- .../java/eu/intelcomp/catalogue/config/SecurityConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java index ea8a6b3..83f6228 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java +++ b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java @@ -46,9 +46,9 @@ public SecurityConfig(AuthenticationSuccessHandler authSuccessHandler, protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests(authorizeRequests -> authorizeRequests - .regexMatchers("/dump/.*", "/restore/", "/resources.*", "/resourceType.*", "/search.*", "/logs.*").hasAnyAuthority("ADMIN") - .antMatchers(HttpMethod.GET, "/forms/**").permitAll() - .antMatchers( "/forms/**").hasAnyAuthority("ADMIN") +// .regexMatchers("/dump/.*", "/restore/", "/resources.*", "/resourceType.*", "/search.*", "/logs.*").hasAnyAuthority("ADMIN") +// .antMatchers(HttpMethod.GET, "/forms/**").permitAll() +// .antMatchers( "/forms/**").hasAnyAuthority("ADMIN") .anyRequest().permitAll()) .oauth2Login() .successHandler(authSuccessHandler) From efb5a11ba561e025ea0d0f3a3707ddc943fbf2f0 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 28 Jun 2022 19:25:50 +0300 Subject: [PATCH 02/52] bumped catalogue version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3955ac8..d25d6a8 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ gr.athenarc catalogue - 3.0.0 + 3.0.1 From ce207ea0e2ef5df0b79b4077ba5171d92f032d12 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 29 Jun 2022 14:49:08 +0300 Subject: [PATCH 03/52] added id field in dataset_instance schema and resource type --- .../resources/resourceTypes/dataset_instance.json | 11 ++++++++++- src/main/resources/schema/dataset_instance.xsd | 10 ++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/resources/resourceTypes/dataset_instance.json b/src/main/resources/resourceTypes/dataset_instance.json index 5a7c566..e37970e 100644 --- a/src/main/resources/resourceTypes/dataset_instance.json +++ b/src/main/resources/resourceTypes/dataset_instance.json @@ -1,5 +1,14 @@ { "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "dataset_instance_id", + "path": "//*[local-name()='dataset_instance']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, { "defaultValue": null, "label": "Type", @@ -80,5 +89,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.DatasetInstance" }, - "schema": "\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The following metadata elements are based on the DataCite schema\n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n" + "schema": "\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The following metadata elements are based on the DataCite schema\n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" } diff --git a/src/main/resources/schema/dataset_instance.xsd b/src/main/resources/schema/dataset_instance.xsd index 9985d84..f469dc2 100644 --- a/src/main/resources/schema/dataset_instance.xsd +++ b/src/main/resources/schema/dataset_instance.xsd @@ -4,6 +4,7 @@ Changes in v0.0.3 - In preparation for the tools, the "location" element is no longer mandatory + - Added an id --> @@ -12,19 +13,20 @@ Changes in v0.0.3 + - - + + - + @@ -33,7 +35,7 @@ Changes in v0.0.3 - + From a10f7a24edf87a1bbeccdbe6b27a4c54a62ac561 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 29 Jun 2022 15:45:50 +0300 Subject: [PATCH 04/52] fixed null pointer exception --- .../catalogue/controller/DatasetController.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java index 2e92468..1cabdec 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import eu.intelcomp.catalogue.domain.ModelAnswer; +import eu.openminted.registry.core.domain.Resource; import eu.openminted.registry.core.service.SearchService; import gr.athenarc.catalogue.service.GenericItemService; import org.json.simple.JSONObject; @@ -10,6 +11,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -45,9 +48,13 @@ public ModelAnswer get(@PathVariable("id") String id) { // TODO: helper method, remove when job filter is implemented correctly from @CITE @GetMapping("instances/{type}/{version}/internalid") - public String getCoreId(@PathVariable("type") String type, @PathVariable("version") String version) { + public ResponseEntity getCoreId(@PathVariable("type") String type, @PathVariable("version") String version) { SearchService.KeyValue typeKeyValue = new SearchService.KeyValue("type", type); SearchService.KeyValue versionKeyValue = new SearchService.KeyValue("version", version); - return genericItemService.searchResource("dataset_instance", typeKeyValue, versionKeyValue).getId(); + Resource resource = genericItemService.searchResource("dataset_instance", typeKeyValue, versionKeyValue); + if (resource == null) { + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + return new ResponseEntity<>(resource.getId(), HttpStatus.OK); } } From 49e17fa4119ef292f903e613dcaed6902ab6da0a Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 14 Sep 2022 17:36:52 +0300 Subject: [PATCH 05/52] added tools and models --- pom.xml | 33 +- src/main/resources/resourceTypes/model.json | 107 ++++ src/main/resources/resourceTypes/tool.json | 107 ++++ .../resources/schema/dataset_instance.xsd | 53 +- src/main/resources/schema/dataset_type.xsd | 144 +---- src/main/resources/schema/imports.xsd | 286 +++++++++ src/main/resources/schema/model.xsd | 600 ++++++++++++++++++ src/main/resources/schema/tool.xsd | 600 ++++++++++++++++++ 8 files changed, 1746 insertions(+), 184 deletions(-) create mode 100644 src/main/resources/resourceTypes/model.json create mode 100644 src/main/resources/resourceTypes/tool.json create mode 100644 src/main/resources/schema/imports.xsd create mode 100644 src/main/resources/schema/model.xsd create mode 100644 src/main/resources/schema/tool.xsd diff --git a/pom.xml b/pom.xml index d25d6a8..d469457 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Intelcomp Catalogue Project 11 - 2.3.7 + 2.4.4 @@ -78,7 +78,7 @@ gr.athenarc catalogue - 3.0.1 + 3.1.0-SNAPSHOT @@ -165,6 +165,35 @@ + + cz.habarta.typescript-generator + typescript-generator-maven-plugin + 2.16.538 + + + generate + + generate + + process-classes + + + + jackson2 + + eu.intelcomp.xsd2java.** + eu.intelcomp.catalogue.domain.** + + + function(name, simpleName) { return name; } + + target/domain.ts + module + implementationFile + asEnum + asClasses + + diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/model.json new file mode 100644 index 0000000..427fa10 --- /dev/null +++ b/src/main/resources/resourceTypes/model.json @@ -0,0 +1,107 @@ +{ + "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "model_id", + "path": "//*[local-name()='model']/*[local-name()='identifier']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Resource Type", + "multivalued": false, + "name": "resourceType", + "path": "//*[local-name()='model']/*[local-name()='resourceType']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Version", + "multivalued": false, + "name": "version", + "path": "//*[local-name()='model']/*[local-name()='version']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Publisher", + "multivalued": false, + "name": "publisher", + "path": "//*[local-name()='model']/*[local-name()='publisher']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Rights", + "multivalued": true, + "name": "rights", + "path": "//*[local-name()='model']/*[local-name()='rightsList']/*[local-name()='rights']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Formats", + "multivalued": true, + "name": "formats", + "path": "//*[local-name()='model']/*[local-name()='formats']/*[local-name()='format']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Subjects", + "multivalued": true, + "name": "subjects", + "path": "//*[local-name()='model']/*[local-name()='subjects']/*[local-name()='subject']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Titles", + "multivalued": true, + "name": "titles", + "path": "//*[local-name()='model']/*[local-name()='titles']/*[local-name()='title']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Identifier", + "multivalued": false, + "name": "identifier", + "path": "//*[local-name()='model']/*[local-name()='identifier']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "datasets", + "label": "Datasets", + "path": "//*[local-name()='model']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Dataset']/text()", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "models", + "label": "Models", + "path": "//*[local-name()='model']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Model']/text()", + "type": "java.lang.String" + } + ], + "indexMapperClass": "eu.openminted.registry.core.index.DefaultIndexMapper", + "aliasGroup": "resourceTypes", + "name": "model", + "payloadType": "xml", + "properties": { + "class": "eu.intelcomp.xsd2java.Model" + }, + "schema": "\n\n\n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" +} diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json new file mode 100644 index 0000000..33062be --- /dev/null +++ b/src/main/resources/resourceTypes/tool.json @@ -0,0 +1,107 @@ +{ + "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "tool_id", + "path": "//*[local-name()='tool']/*[local-name()='identifier']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Resource Type", + "multivalued": false, + "name": "resourceType", + "path": "//*[local-name()='tool']/*[local-name()='resourceType']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Version", + "multivalued": false, + "name": "version", + "path": "//*[local-name()='tool']/*[local-name()='version']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Publisher", + "multivalued": false, + "name": "publisher", + "path": "//*[local-name()='tool']/*[local-name()='publisher']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Rights", + "multivalued": true, + "name": "rights", + "path": "//*[local-name()='tool']/*[local-name()='rightsList']/*[local-name()='rights']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Formats", + "multivalued": true, + "name": "formats", + "path": "//*[local-name()='tool']/*[local-name()='formats']/*[local-name()='format']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Subjects", + "multivalued": true, + "name": "subjects", + "path": "//*[local-name()='tool']/*[local-name()='subjects']/*[local-name()='subject']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Titles", + "multivalued": true, + "name": "titles", + "path": "//*[local-name()='tool']/*[local-name()='titles']/*[local-name()='title']/text()", + "primaryKey": false, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": "Identifier", + "multivalued": false, + "name": "identifier", + "path": "//*[local-name()='tool']/*[local-name()='identifier']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "datasets", + "label": "Datasets", + "path": "//*[local-name()='tool']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][contains(@relationType, 'Requires') and contains(@resourceTypeGeneral, 'Dataset') and contains(@relatedIdentifierType, 'internal')]/text()", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "models", + "label": "Models", + "path": "//*[local-name()='tool']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Model']/text()", + "type": "java.lang.String" + } + ], + "indexMapperClass": "eu.openminted.registry.core.index.DefaultIndexMapper", + "aliasGroup": "resourceTypes", + "name": "tool", + "payloadType": "xml", + "properties": { + "class": "eu.intelcomp.xsd2java.Tool" + }, + "schema": "\n\n\n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" +} diff --git a/src/main/resources/schema/dataset_instance.xsd b/src/main/resources/schema/dataset_instance.xsd index f469dc2..b4e38fb 100644 --- a/src/main/resources/schema/dataset_instance.xsd +++ b/src/main/resources/schema/dataset_instance.xsd @@ -8,8 +8,8 @@ Changes in v0.0.3 --> - - + + @@ -112,7 +112,7 @@ Changes in v0.0.3 - + @@ -129,7 +129,7 @@ Changes in v0.0.3 - + @@ -150,49 +150,4 @@ Changes in v0.0.3 - - - The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate. - - - - - - - - - - - - - - - - The type of contributor of the resource. - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/schema/dataset_type.xsd b/src/main/resources/schema/dataset_type.xsd index c8be6c2..d248961 100644 --- a/src/main/resources/schema/dataset_type.xsd +++ b/src/main/resources/schema/dataset_type.xsd @@ -6,8 +6,9 @@ Changes in v0.0.3 - In preparation for the tools, the "schema" element is no longer mandatory --> - - + + + @@ -35,7 +36,7 @@ Changes in v0.0.3 - + @@ -81,7 +82,7 @@ Changes in v0.0.3 - + @@ -114,8 +115,8 @@ Changes in v0.0.3 - - + + @@ -166,7 +167,7 @@ Changes in v0.0.3 - + @@ -186,8 +187,8 @@ Changes in v0.0.3 - - + + @@ -248,7 +249,7 @@ Changes in v0.0.3 - + @@ -287,127 +288,4 @@ Changes in v0.0.3 - - - - - - - - - - - The general type of a resource. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The type of the description. - - - - - - - - - - - - The type of the entity. - - - - - - - - - - The type of the RelatedIdentifier. - - - - - - - - - - - - - - - - - - - - - - - - - Description of the relationship of the resource being registered (A) and the related resource (B). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd new file mode 100644 index 0000000..8135543 --- /dev/null +++ b/src/main/resources/schema/imports.xsd @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + Uniquely identifies a creator or contributor, according to various identifier schemes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uniquely identifies an affiliation, according to various identifier schemes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The general type of a resource. + + + + + + + + + + + + + + + + + + + + + The type of the description. + + + + + + + + + + + + + The type of the entity. + + + + + + + + + + The type of the RelatedIdentifier. + + + + + + + + + + + + + + + + + + + + + + + + + + Description of the relationship of the resource being registered (A) and the related resource (B). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate. + + + + + + + + + + + + + + + + The type of contributor of the resource. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd new file mode 100644 index 0000000..10949cc --- /dev/null +++ b/src/main/resources/schema/model.xsd @@ -0,0 +1,600 @@ + + + + + + + + Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. + Note: This is the case for all wrapper elements within this schema. + No content in this wrapper element. + + + + + + + A persistent identifier that identifies a resource. + + + + + + + + + + + + + + + The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name. + Format: Family, Given. + Personal names can be further specified using givenName and familyName. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A name or title by which a resource is known. + + + + + + + + + + + + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + In the case of datasets, "publish" is understood to mean making the data available to the community of researchers. + + + + + + + + + + + + Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends. + In the case of datasets, "publish" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective. + YYYY + + + + + + + + The type of a resource. You may enter an additional free text description. + The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property. + + + + + + + + + + + + + + + + Subject, keywords, classification codes, or key phrases describing the resource. + + + + + + + + + + + + + + + + + + + + + + The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset. + The personal name format should be: Family, Given. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Different dates relevant to the work. + YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges. + + + + + + + + + + + + + + + + Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes. + + + + + + + + An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file). + + + + + + + + + + + + + + + + + + Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate. + + + + + + + + + + + + + + + + + + + + + + + Unstructures size information about the resource. + + + + + + + + + + + Technical format of the resource. + Use file extension or MIME type where possible. + + + + + + + + Version number of the resource. If the primary resource has changed the version number increases. + Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version. + + + + + + + + Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. +Use the complete title of a license and include version information if applicable. + + + + + + + + + + + + + + + + + + + + + + All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description. + + + + + + + + + + + + + + + + + + + + + + + Spatial region or named place where the data was gathered or about which the data is focused. + + + + + A point contains a single latitude-longitude pair. + + + + + A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner. + + + + + A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain. + + + + + + + + + + + + + + + + + + + + Information about financial support (funding) for the resource being registered. + + + + + + Name of the funding provider. + + + + + + + + Uniquely identifies a funding entity, according to various types. + + + + + + + + + + + + + The code assigned by the funder to a sponsored award (grant). + + + + + + + + + + + + The human readable title of the award (grant). + + + + + + + + + + + + + + Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part. + + + + + + The identifier for the related item. + + + + + + + The type of the Identifier for the related item e.g. DOI. + + + + + The name of the scheme. + + + + + The URI of the relatedMetadataScheme. + + + + + The type of the relatedMetadataScheme, linked with the schemeURI. + + + + + + + + + + + + The institution or person responsible for creating the + related resource. To supply multiple creators, repeat this property. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Title of the related item. + + + + + + + + + + + + + + + + The year when the item was or will be made publicly available. + + + + + + + + Volume of the related item. + + + + + Issue number or name of the related item. + + + + + Number of the related item e.g. report number of article number. + + + + + + + + + + + + First page of the related item e.g. of the chapter, article, or conference paper. + + + + + Last page of the related item e.g. of the chapter, article, or conference paper. + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + + + + + Edition or version of the related item. + + + + + + + + The institution or person responsible for collecting, + managing, distributing, or otherwise contributing to the development of + the resource. + + + + + + + + + + + + + + + + + + + The type of contributor of the resource. + + + + + + + + + + + The type of the related item, e.g. journal article, book or chapter. + + + + + Description of the relationship of the resource being registered (A) and the related resource (B). + + + + + + + + + + + diff --git a/src/main/resources/schema/tool.xsd b/src/main/resources/schema/tool.xsd new file mode 100644 index 0000000..3b94a16 --- /dev/null +++ b/src/main/resources/schema/tool.xsd @@ -0,0 +1,600 @@ + + + + + + + + Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. + Note: This is the case for all wrapper elements within this schema. + No content in this wrapper element. + + + + + + + A persistent identifier that identifies a resource. + + + + + + + + + + + + + + + The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name. + Format: Family, Given. + Personal names can be further specified using givenName and familyName. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A name or title by which a resource is known. + + + + + + + + + + + + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + In the case of datasets, "publish" is understood to mean making the data available to the community of researchers. + + + + + + + + + + + + Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends. + In the case of datasets, "publish" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective. + YYYY + + + + + + + + The type of a resource. You may enter an additional free text description. + The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property. + + + + + + + + + + + + + + + + Subject, keywords, classification codes, or key phrases describing the resource. + + + + + + + + + + + + + + + + + + + + + + The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset. + The personal name format should be: Family, Given. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Different dates relevant to the work. + YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges. + + + + + + + + + + + + + + + + Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes. + + + + + + + + An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file). + + + + + + + + + + + + + + + + + + Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate. + + + + + + + + + + + + + + + + + + + + + + + Unstructures size information about the resource. + + + + + + + + + + + Technical format of the resource. + Use file extension or MIME type where possible. + + + + + + + + Version number of the resource. If the primary resource has changed the version number increases. + Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version. + + + + + + + + Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. +Use the complete title of a license and include version information if applicable. + + + + + + + + + + + + + + + + + + + + + + All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description. + + + + + + + + + + + + + + + + + + + + + + + Spatial region or named place where the data was gathered or about which the data is focused. + + + + + A point contains a single latitude-longitude pair. + + + + + A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner. + + + + + A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain. + + + + + + + + + + + + + + + + + + + + Information about financial support (funding) for the resource being registered. + + + + + + Name of the funding provider. + + + + + + + + Uniquely identifies a funding entity, according to various types. + + + + + + + + + + + + + The code assigned by the funder to a sponsored award (grant). + + + + + + + + + + + + The human-readable title of the award (grant). + + + + + + + + + + + + + + Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part. + + + + + + The identifier for the related item. + + + + + + + The type of the Identifier for the related item e.g. DOI. + + + + + The name of the scheme. + + + + + The URI of the relatedMetadataScheme. + + + + + The type of the relatedMetadataScheme, linked with the schemeURI. + + + + + + + + + + + + The institution or person responsible for creating the + related resource. To supply multiple creators, repeat this property. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Title of the related item. + + + + + + + + + + + + + + + + The year when the item was or will be made publicly available. + + + + + + + + Volume of the related item. + + + + + Issue number or name of the related item. + + + + + Number of the related item e.g. report number of article number. + + + + + + + + + + + + First page of the related item e.g. of the chapter, article, or conference paper. + + + + + Last page of the related item e.g. of the chapter, article, or conference paper. + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + + + + + Edition or version of the related item. + + + + + + + + The institution or person responsible for collecting, + managing, distributing, or otherwise contributing to the development of + the resource. + + + + + + + + + + + + + + + + + + + The type of contributor of the resource. + + + + + + + + + + + The type of the related item, e.g. journal article, book or chapter. + + + + + Description of the relationship of the resource being registered (A) and the related resource (B). + + + + + + + + + + + From da2a00c6fbe472a34ded7b097413aee10a67b2b9 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 29 Sep 2022 19:34:13 +0300 Subject: [PATCH 06/52] added id field in models and tools --- src/main/resources/resourceTypes/model.json | 15 ++++++++++++--- src/main/resources/resourceTypes/tool.json | 11 ++++++++++- src/main/resources/schema/model.xsd | 1 + src/main/resources/schema/tool.xsd | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/model.json index 427fa10..36174af 100644 --- a/src/main/resources/resourceTypes/model.json +++ b/src/main/resources/resourceTypes/model.json @@ -4,7 +4,16 @@ "defaultValue": null, "label": null, "multivalued": false, - "name": "model_id", + "name": "ai_model_id", + "path": "//*[local-name()='model']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "identifier", "path": "//*[local-name()='model']/*[local-name()='identifier']/text()", "primaryKey": true, "type": "java.lang.String" @@ -98,10 +107,10 @@ ], "indexMapperClass": "eu.openminted.registry.core.index.DefaultIndexMapper", "aliasGroup": "resourceTypes", - "name": "model", + "name": "ai_model", "payloadType": "xml", "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schema": "\n\n\n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" } diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index 33062be..bd2c4a0 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -5,6 +5,15 @@ "label": null, "multivalued": false, "name": "tool_id", + "path": "//*[local-name()='tool']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "identifier", "path": "//*[local-name()='tool']/*[local-name()='identifier']/text()", "primaryKey": true, "type": "java.lang.String" @@ -103,5 +112,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schema": "\n\n\n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" } diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 10949cc..586fc5b 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -25,6 +25,7 @@ + A persistent identifier that identifies a resource. diff --git a/src/main/resources/schema/tool.xsd b/src/main/resources/schema/tool.xsd index 3b94a16..6c01cd9 100644 --- a/src/main/resources/schema/tool.xsd +++ b/src/main/resources/schema/tool.xsd @@ -25,6 +25,7 @@ + A persistent identifier that identifies a resource. From d24cc9aafa1c71ee676d54ae0424f1d34ff16b9e Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 29 Sep 2022 19:39:45 +0300 Subject: [PATCH 07/52] removed duplicate identifier index field --- src/main/resources/resourceTypes/model.json | 9 --------- src/main/resources/resourceTypes/tool.json | 9 --------- 2 files changed, 18 deletions(-) diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/model.json index 36174af..00597b2 100644 --- a/src/main/resources/resourceTypes/model.json +++ b/src/main/resources/resourceTypes/model.json @@ -9,15 +9,6 @@ "primaryKey": true, "type": "java.lang.String" }, - { - "defaultValue": null, - "label": null, - "multivalued": false, - "name": "identifier", - "path": "//*[local-name()='model']/*[local-name()='identifier']/text()", - "primaryKey": true, - "type": "java.lang.String" - }, { "defaultValue": null, "label": "Resource Type", diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index bd2c4a0..f9cfffe 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -9,15 +9,6 @@ "primaryKey": true, "type": "java.lang.String" }, - { - "defaultValue": null, - "label": null, - "multivalued": false, - "name": "identifier", - "path": "//*[local-name()='tool']/*[local-name()='identifier']/text()", - "primaryKey": true, - "type": "java.lang.String" - }, { "defaultValue": null, "label": "Resource Type", From d3e58a969061f0589235a0679b569431d74800e9 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 30 Sep 2022 14:34:11 +0300 Subject: [PATCH 08/52] updated resourceTypes and schemas --- src/main/resources/resourceTypes/model.json | 12 ++++--- src/main/resources/resourceTypes/tool.json | 10 ++++-- src/main/resources/schema/model.xsd | 40 +-------------------- src/main/resources/schema/tool.xsd | 40 +-------------------- 4 files changed, 17 insertions(+), 85 deletions(-) diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/model.json index 00597b2..1a20486 100644 --- a/src/main/resources/resourceTypes/model.json +++ b/src/main/resources/resourceTypes/model.json @@ -82,17 +82,21 @@ "type": "java.lang.String" }, { + "defaultValue": null, + "label": "Datasets", "multivalued": true, "name": "datasets", - "label": "Datasets", - "path": "//*[local-name()='model']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Dataset']/text()", + "path": "//*[local-name()='model']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][contains(@relationType, 'Requires') and contains(@resourceTypeGeneral, 'Dataset') and contains(@relatedIdentifierType, 'internal')]/text()", + "primaryKey": false, "type": "java.lang.String" }, { + "defaultValue": null, + "label": "Models", "multivalued": true, "name": "models", - "label": "Models", "path": "//*[local-name()='model']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Model']/text()", + "primaryKey": false, "type": "java.lang.String" } ], @@ -103,5 +107,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schema": "\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" } diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index f9cfffe..b35e084 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -82,17 +82,21 @@ "type": "java.lang.String" }, { + "defaultValue": null, + "label": "Datasets", "multivalued": true, "name": "datasets", - "label": "Datasets", "path": "//*[local-name()='tool']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][contains(@relationType, 'Requires') and contains(@resourceTypeGeneral, 'Dataset') and contains(@relatedIdentifierType, 'internal')]/text()", + "primaryKey": false, "type": "java.lang.String" }, { + "defaultValue": null, + "label": "Models", "multivalued": true, "name": "models", - "label": "Models", "path": "//*[local-name()='tool']/*[local-name()='relatedIdentifiers']/*[local-name()='relatedIdentifier'][@relationType='Requires'][@resourceTypeGeneral='Model']/text()", + "primaryKey": false, "type": "java.lang.String" } ], @@ -103,5 +107,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schema": "\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Spatial region or named place where the data was gathered or about which the data is focused.\n \n \n \n \n A point contains a single latitude-longitude pair.\n \n \n \n \n A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.\n \n \n \n \n A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" } diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 586fc5b..7552861 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -14,7 +14,7 @@ 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> - + @@ -316,44 +316,6 @@ Use the complete title of a license and include version information if applicabl - - - - - - - - - Spatial region or named place where the data was gathered or about which the data is focused. - - - - - A point contains a single latitude-longitude pair. - - - - - A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner. - - - - - A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain. - - - - - - - - - - - - - - diff --git a/src/main/resources/schema/tool.xsd b/src/main/resources/schema/tool.xsd index 6c01cd9..df795e9 100644 --- a/src/main/resources/schema/tool.xsd +++ b/src/main/resources/schema/tool.xsd @@ -14,7 +14,7 @@ 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> - + @@ -316,44 +316,6 @@ Use the complete title of a license and include version information if applicabl - - - - - - - - - Spatial region or named place where the data was gathered or about which the data is focused. - - - - - A point contains a single latitude-longitude pair. - - - - - A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner. - - - - - A drawn polygon area, defined by a set of points and lines connecting the points in a closed chain. - - - - - - - - - - - - - - From 14c171f75de6190dbed8335b3aba33b9d754c483 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 30 Sep 2022 14:35:09 +0300 Subject: [PATCH 09/52] updated import schema location --- src/main/resources/schema/dataset_instance.xsd | 2 +- src/main/resources/schema/dataset_type.xsd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/schema/dataset_instance.xsd b/src/main/resources/schema/dataset_instance.xsd index b4e38fb..893cf34 100644 --- a/src/main/resources/schema/dataset_instance.xsd +++ b/src/main/resources/schema/dataset_instance.xsd @@ -9,7 +9,7 @@ Changes in v0.0.3 --> - + diff --git a/src/main/resources/schema/dataset_type.xsd b/src/main/resources/schema/dataset_type.xsd index d248961..7af2bd2 100644 --- a/src/main/resources/schema/dataset_type.xsd +++ b/src/main/resources/schema/dataset_type.xsd @@ -8,7 +8,7 @@ Changes in v0.0.3 --> - + From ab0d5cf8591c0ff45a7c83778b515dae3245b889 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 11 Oct 2022 11:24:22 +0300 Subject: [PATCH 10/52] added some debug logs --- .../intelcomp/catalogue/config/AuthSuccessHandler.java | 4 ++++ .../eu/intelcomp/catalogue/config/SecurityConfig.java | 5 +++-- .../controller/IntelcompGenericExceptionController.java | 9 ++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java index 815549d..a8db1b3 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java +++ b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java @@ -1,5 +1,6 @@ package eu.intelcomp.catalogue.config; +import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ public class AuthSuccessHandler implements AuthenticationSuccessHandler { private static final Logger logger = LoggerFactory.getLogger(AuthSuccessHandler.class); private final ApplicationProperties applicationProperties; + private final ObjectMapper objectMapper = new ObjectMapper(); @Autowired public AuthSuccessHandler(ApplicationProperties applicationProperties) { @@ -41,7 +43,9 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo cookie.setPath("/"); // cookie.setSecure(true); + logger.debug("Assigning Cookie: {}", objectMapper.writeValueAsString(cookie)); response.addCookie(cookie); + logger.debug("Authentication Successful - Redirecting to: {}", applicationProperties.getLoginRedirect()); response.sendRedirect(applicationProperties.getLoginRedirect()); } diff --git a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java index 83f6228..f1ce896 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java +++ b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java @@ -74,10 +74,11 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { OidcIdToken idToken = oidcUserAuthority.getIdToken(); OidcUserInfo userInfo = oidcUserAuthority.getUserInfo(); + logger.debug("User attributes: {}", oidcUserAuthority.getAttributes()); JSONArray icRoles = ((JSONArray) oidcUserAuthority.getAttributes().get("ic-roles")); + logger.debug("User attributes.ic-roles: {}", icRoles); if (icRoles != null) { for (int i = 0; i < icRoles.size(); i++) { - mappedAuthorities.add(new SimpleGrantedAuthority(icRoles.get(i).toString().toUpperCase())); } } @@ -110,7 +111,7 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { } }); - + logger.debug("Granted Authorities: {}", mappedAuthorities); return mappedAuthorities; }; } diff --git a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java b/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java index d966eb4..665d4f3 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java @@ -1,7 +1,5 @@ package eu.intelcomp.catalogue.controller; -import gr.athenarc.catalogue.RequestUtils; -import gr.athenarc.catalogue.config.logging.LogTransactionsFilter; import gr.athenarc.catalogue.controller.GenericExceptionController; import gr.athenarc.catalogue.exception.ResourceException; import gr.athenarc.catalogue.exception.ServerError; @@ -24,15 +22,20 @@ public class IntelcompGenericExceptionController extends GenericExceptionControl @ExceptionHandler(Exception.class) ResponseEntity handleException(HttpServletRequest req, Exception ex) { - logger.info(ex.getMessage(), ex); HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR; if (ex instanceof ResourceException) { + logger.info(ex.getMessage(), ex); status = ((ResourceException) ex).getStatus(); } else if (ex instanceof HttpClientErrorException) { + logger.info(ex.getMessage(), ex); status = ((HttpClientErrorException) ex).getStatusCode(); } else if (ex instanceof AccessDeniedException) { + logger.info(ex.getMessage()); + logger.debug(ex.getMessage(), ex); status = HttpStatus.FORBIDDEN; } else if (ex instanceof InsufficientAuthenticationException) { + logger.info(ex.getMessage()); + logger.debug(ex.getMessage(), ex); status = HttpStatus.UNAUTHORIZED; } return ResponseEntity From edf432d2254006ad2d7bdf48514e7fefc8002e03 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 26 Oct 2022 18:49:07 +0300 Subject: [PATCH 11/52] updated catalogue-lib version and fixed logging 500 exceptions --- pom.xml | 2 +- .../controller/IntelcompGenericExceptionController.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d469457..e0c815f 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ gr.athenarc catalogue - 3.1.0-SNAPSHOT + 3.2.0 diff --git a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java b/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java index 665d4f3..1e946bf 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java @@ -37,6 +37,8 @@ ResponseEntity handleException(HttpServletRequest req, Exception ex logger.info(ex.getMessage()); logger.debug(ex.getMessage(), ex); status = HttpStatus.UNAUTHORIZED; + } else { + logger.error(ex.getMessage(), ex); } return ResponseEntity .status(status) From ab88bf336eb71614d1169f9c3b5c1d4db008aabb Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 9 Mar 2023 17:38:43 +0200 Subject: [PATCH 12/52] added methods returning auth --- .../catalogue/config/SecurityConfig.java | 16 +++++++++----- .../catalogue/controller/UserController.java | 21 +++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java index f1ce896..a0af927 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java +++ b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java @@ -13,9 +13,12 @@ import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; +import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; +import org.springframework.security.oauth2.core.OAuth2Token; import org.springframework.security.oauth2.core.oidc.OidcIdToken; import org.springframework.security.oauth2.core.oidc.OidcUserInfo; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; +import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2UserAuthority; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; @@ -68,14 +71,15 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { Set mappedAuthorities = new HashSet<>(); authorities.forEach(authority -> { - if (OidcUserAuthority.class.isInstance(authority)) { + if (authority instanceof OidcUserAuthority) { OidcUserAuthority oidcUserAuthority = (OidcUserAuthority) authority; OidcIdToken idToken = oidcUserAuthority.getIdToken(); OidcUserInfo userInfo = oidcUserAuthority.getUserInfo(); logger.debug("User attributes: {}", oidcUserAuthority.getAttributes()); - JSONArray icRoles = ((JSONArray) oidcUserAuthority.getAttributes().get("ic-roles")); + logger.debug("User Token Claims: {}", idToken.getClaims()); + JSONArray icRoles = ((JSONArray) oidcUserAuthority.getIdToken().getClaims().get("ic-roles")); logger.debug("User attributes.ic-roles: {}", icRoles); if (icRoles != null) { for (int i = 0; i < icRoles.size(); i++) { @@ -98,14 +102,16 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { // Map the claims found in idToken and/or userInfo // to one or more GrantedAuthority's and add it to mappedAuthorities - } else if (OAuth2UserAuthority.class.isInstance(authority)) { - OAuth2UserAuthority oauth2UserAuthority = (OAuth2UserAuthority) authority; + } else if (authority instanceof OAuth2UserAuthority) { - Map userAttributes = oauth2UserAuthority.getAttributes(); + OAuth2User oauth2User = (OAuth2User) authority; + Map userAttributes = oauth2User.getAttributes(); if (userAttributes != null && applicationProperties.getAdmins().contains(userAttributes.get("email"))) { mappedAuthorities.add(new SimpleGrantedAuthority("ADMIN")); } + + mappedAuthorities.addAll(oauth2User.getAuthorities()); // Map the attributes found in userAttributes // to one or more GrantedAuthority's and add it to mappedAuthorities diff --git a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java index a81d2be..5bf5cf4 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java @@ -5,6 +5,9 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.oauth2.core.oidc.user.OidcUser; +import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -23,4 +26,22 @@ public UserController() { public ResponseEntity getInfo(@ApiIgnore Authentication authentication) { return new ResponseEntity<>(User.of(authentication), HttpStatus.OK); } + + @ApiIgnore + @GetMapping("auth/oidc-principal") + public OidcUser getOidcUserPrincipal(@AuthenticationPrincipal OidcUser principal) { + return principal; + } + + @ApiIgnore + @GetMapping("auth/oauth2-principal") + public OAuth2User getOAuth2UserPrincipal(@AuthenticationPrincipal OAuth2User principal) { + return principal; + } + + @ApiIgnore + @GetMapping("auth") + public Authentication getAuth(Authentication auth) { + return auth; + } } From ba7ab7390cb1b3d2e02ef5c60826a985d371edbe Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 15 May 2023 15:12:58 +0300 Subject: [PATCH 13/52] added identifier in resource types --- .../resourceTypes/{model.json => ai_model.json} | 9 +++++++++ src/main/resources/resourceTypes/dataset_instance.json | 9 +++++++++ src/main/resources/resourceTypes/dataset_type.json | 9 +++++++++ src/main/resources/resourceTypes/tool.json | 9 +++++++++ 4 files changed, 36 insertions(+) rename src/main/resources/resourceTypes/{model.json => ai_model.json} (99%) diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/ai_model.json similarity index 99% rename from src/main/resources/resourceTypes/model.json rename to src/main/resources/resourceTypes/ai_model.json index 1a20486..24aa5e9 100644 --- a/src/main/resources/resourceTypes/model.json +++ b/src/main/resources/resourceTypes/ai_model.json @@ -1,5 +1,14 @@ { "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "resource_internal_id", + "path": "//*[local-name()='model']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, { "defaultValue": null, "label": null, diff --git a/src/main/resources/resourceTypes/dataset_instance.json b/src/main/resources/resourceTypes/dataset_instance.json index e37970e..ca25593 100644 --- a/src/main/resources/resourceTypes/dataset_instance.json +++ b/src/main/resources/resourceTypes/dataset_instance.json @@ -1,5 +1,14 @@ { "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "resource_internal_id", + "path": "//*[local-name()='dataset_instance']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, { "defaultValue": null, "label": null, diff --git a/src/main/resources/resourceTypes/dataset_type.json b/src/main/resources/resourceTypes/dataset_type.json index 8397c87..9e7be0f 100644 --- a/src/main/resources/resourceTypes/dataset_type.json +++ b/src/main/resources/resourceTypes/dataset_type.json @@ -1,5 +1,14 @@ { "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "resource_internal_id", + "path": "//*[local-name()='dataset_type']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, { "defaultValue": null, "label": null, diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index b35e084..6fc0e96 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -1,5 +1,14 @@ { "indexFields": [ + { + "defaultValue": null, + "label": null, + "multivalued": false, + "name": "resource_internal_id", + "path": "//*[local-name()='tool']/*[local-name()='id']/text()", + "primaryKey": true, + "type": "java.lang.String" + }, { "defaultValue": null, "label": null, From ee77182e20b4bf59e7f402203df23067e2384b57 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 15 May 2023 15:26:52 +0300 Subject: [PATCH 14/52] changed tool and model schemas --- src/main/resources/schema/imports.xsd | 533 ++++++------- src/main/resources/schema/tool.xsd | 1042 ++++++++++++------------- 2 files changed, 759 insertions(+), 816 deletions(-) diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd index 8135543..60ecaec 100644 --- a/src/main/resources/schema/imports.xsd +++ b/src/main/resources/schema/imports.xsd @@ -1,286 +1,247 @@ - - - - - - - - - - - - - - - - - - - Uniquely identifies a creator or contributor, according to various identifier schemes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Uniquely identifies an affiliation, according to various identifier schemes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The general type of a resource. - - - - - - - - - - - - - - - - - - - - - The type of the description. - - - - - - - - - - - - - The type of the entity. - - - - - - - - - - The type of the RelatedIdentifier. - - - - - - - - - - - - - - - - - - - - - - - - - - Description of the relationship of the resource being registered (A) and the related resource (B). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate. - - - - - - - - - - - - - - - - The type of contributor of the resource. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Uniquely identifies a creator or contributor, according to various identifier schemes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Uniquely identifies an affiliation, according to various identifier schemes. + + + + + + + + + + + + + + + + + + + + + + + + + The general type of a resource. + + + + + + + + + The type of the description. + + + + + + + + + + + + + The type of the entity. + + + + + + + + + + The type of the RelatedIdentifier. + + + + + + + + + + + + + + + + + + + + + + + + + + Description of the relationship of the resource being registered (A) and the related resource (B). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate. + + + + + + + + + + + + + + + + The type of contributor of the resource. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/schema/tool.xsd b/src/main/resources/schema/tool.xsd index df795e9..74d223c 100644 --- a/src/main/resources/schema/tool.xsd +++ b/src/main/resources/schema/tool.xsd @@ -1,4 +1,5 @@ - + + - - - - - Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. - Note: This is the case for all wrapper elements within this schema. - No content in this wrapper element. - - - - - - - - A persistent identifier that identifies a resource. - - - - - - - - - - - - - - - The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name. - Format: Family, Given. - Personal names can be further specified using givenName and familyName. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A name or title by which a resource is known. - - - - - - - - - - - - - - - - The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. - In the case of datasets, "publish" is understood to mean making the data available to the community of researchers. - - - - - - - - - - - - Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends. - In the case of datasets, "publish" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective. - YYYY - - - - - - - - The type of a resource. You may enter an additional free text description. - The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property. - - - - - - - - - - - - - - - - Subject, keywords, classification codes, or key phrases describing the resource. - - - - - - - - - - - - - - - - - - - - - - The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset. - The personal name format should be: Family, Given. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Different dates relevant to the work. - YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges. - - - - - - - - - - - - - - - - Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes. - - - - - - - - An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file). - - - - - - - - - - - - - - - - - - Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate. - - - - - - - - - - - - - - - - - - - - - - - Unstructures size information about the resource. - - - - - - - - - - - Technical format of the resource. - Use file extension or MIME type where possible. - - - - - - - - Version number of the resource. If the primary resource has changed the version number increases. - Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version. - - - - - - - - Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. -Use the complete title of a license and include version information if applicable. - - - - - - - - - - - - - - - - - - - - - - All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description. - - - - - - - - - - - - - - - - - - - - Information about financial support (funding) for the resource being registered. - - - - - - Name of the funding provider. - - - - - - - - Uniquely identifies a funding entity, according to various types. - - - - - - - - - - - - - The code assigned by the funder to a sponsored award (grant). - - - - - - - - - - - - The human-readable title of the award (grant). - - - - - - - - - - - - - - Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part. - - - - - - The identifier for the related item. - - + + + + + Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. + Note: This is the case for all wrapper elements within this schema. + + No content in this wrapper element. + + + + + + + + A persistent identifier that identifies a resource. + + - - - - The type of the Identifier for the related item e.g. DOI. - - - - - The name of the scheme. - - - - - The URI of the relatedMetadataScheme. - - - - - The type of the relatedMetadataScheme, linked with the schemeURI. - - - + + + - - - - + + + + - - - The institution or person responsible for creating the - related resource. To supply multiple creators, repeat this property. - - - - - - - - - - - - - - - - - - - + + + The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name. + Format: Family, Given. + Personal names can be further specified using givenName and familyName. + + + + + + + + + + + + + + + + + - - - - + + + + - - - Title of the related item. - - - - - - - - - - + + + A name or title by which a resource is known. + + + + + + + + + - - - - - The year when the item was or will be made publicly available. - - - - - - - - Volume of the related item. - - - - - Issue number or name of the related item. - - - - - Number of the related item e.g. report number of article number. - - + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + In the case of datasets, "publish" is understood to mean making the data available to the community of researchers. + + - - - + + - - - - - First page of the related item e.g. of the chapter, article, or conference paper. - - - - - Last page of the related item e.g. of the chapter, article, or conference paper. - - - - - The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. - - - - - Edition or version of the related item. - - - - + + + + + Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends. + In the case of datasets, "publish" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective. + YYYY + + + + + + + + The type of a resource. You may enter an additional free text description. + The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property. + + + + + - - - The institution or person responsible for collecting, - managing, distributing, or otherwise contributing to the development of - the resource. - - - - - + + + Subject, keywords, classification codes, or key phrases describing the resource. + + - - - - + + + + + + - - - - - - + + + + + + + + + - The type of contributor of the resource. + The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset. + The personal name format should be: Family, Given. - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Different dates relevant to the work. + YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges. + + + + + + + + + + - - - - + + + - The type of the related item, e.g. journal article, book or chapter. + Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes. - - + + + + + + + An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file). + + + + + + + + + + + + + + + + + + Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate. + + + + + + + + + + + + + + + + + + + + + + + Unstructures size information about the resource. + + + + + + + + + + + Technical format of the resource. + Use file extension or MIME type where possible. + + + + + + - Description of the relationship of the resource being registered (A) and the related resource (B). + Version number of the resource. If the primary resource has changed the version number increases. + Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version. - - - - - - - - - - + + + + + + + + Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. + Use the complete title of a license and include version information if applicable. + + + + + + + + + + + + + + + + + + + + + + All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description. + + + + + + + + + + + + + + + + + + + Information about financial support (funding) for the resource being registered. + + + + + + Name of the funding provider. + + + + + + + + Uniquely identifies a funding entity, according to various types. + + + + + + + + + + + + + The code assigned by the funder to a sponsored award (grant). + + + + + + + + + + + + The human-readable title of the award (grant). + + + + + + + + + + + + + + Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part. + + + + + + The identifier for the related item. + + + + + + + The type of the Identifier for the related item e.g. DOI. + + + + + The name of the scheme. + + + + + The URI of the relatedMetadataScheme. + + + + + The type of the relatedMetadataScheme, linked with the schemeURI. + + + + + + + + + + + + + The institution or person responsible for creating the + related resource. To supply multiple creators, repeat this property. + + + + + + + + + + + + + + + + + + + + + + + + + Title of the related item. + + + + + + + + + + + + + + + The year when the item was or will be made publicly available. + + + + + + + + Volume of the related item. + + + + + Issue number or name of the related item. + + + + + Number of the related item e.g. report number of article number. + + + + + + + + + + + + First page of the related item e.g. of the chapter, article, or conference paper. + + + + + Last page of the related item e.g. of the chapter, article, or conference paper. + + + + + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. + + + + + Edition or version of the related item. + + + + + + + + + The institution or person responsible for collecting, + managing, distributing, or otherwise contributing to the development of + the resource. + + + + + + + + + + + + + + + + + The type of contributor of the resource. + + + + + + + + + + + The type of the related item, e.g. journal article, book or chapter. + + + + + Description of the relationship of the resource being registered (A) and the related resource (B). + + + + + + + + + + + \ No newline at end of file From b6a1cdd807925c8759e9fe258acbb5c27a89202a Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 15 May 2023 15:28:15 +0300 Subject: [PATCH 15/52] forgot to push model changes --- src/main/resources/schema/model.xsd | 70 +++++++++++------------------ 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 7552861..438dd6b 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -1,4 +1,5 @@ + @@ -19,7 +20,8 @@ Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard. - Note: This is the case for all wrapper elements within this schema. + Note: This is the case for all wrapper elements within this schema. + No content in this wrapper element. @@ -54,13 +56,10 @@ - - - @@ -80,7 +79,6 @@ - @@ -96,7 +94,6 @@ - @@ -111,18 +108,11 @@ - + The type of a resource. You may enter an additional free text description. The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property. - - - - - - - @@ -139,7 +129,6 @@ - @@ -162,13 +151,10 @@ - - - @@ -278,8 +264,10 @@ - Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. -Use the complete title of a license and include version information if applicable. + + Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. + Use the complete title of a license and include version information if applicable. + @@ -288,7 +276,6 @@ Use the complete title of a license and include version information if applicabl - @@ -310,7 +297,6 @@ Use the complete title of a license and include version information if applicabl - @@ -358,9 +344,9 @@ Use the complete title of a license and include version information if applicabl - + - The human readable title of the award (grant). + The human-readable title of the award (grant). @@ -414,7 +400,8 @@ Use the complete title of a license and include version information if applicabl - The institution or person responsible for creating the + + The institution or person responsible for creating the related resource. To supply multiple creators, repeat this property. @@ -425,13 +412,10 @@ Use the complete title of a license and include version information if applicabl - - - @@ -449,7 +433,6 @@ Use the complete title of a license and include version information if applicabl - @@ -465,12 +448,12 @@ Use the complete title of a license and include version information if applicabl - + Volume of the related item. - + Issue number or name of the related item. @@ -487,22 +470,22 @@ Use the complete title of a license and include version information if applicabl - + First page of the related item e.g. of the chapter, article, or conference paper. - + Last page of the related item e.g. of the chapter, article, or conference paper. - + The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role. - + Edition or version of the related item. @@ -512,9 +495,11 @@ Use the complete title of a license and include version information if applicabl - The institution or person responsible for collecting, - managing, distributing, or otherwise contributing to the development of - the resource. + + The institution or person responsible for collecting, + managing, distributing, or otherwise contributing to the development of + the resource. + @@ -523,13 +508,10 @@ Use the complete title of a license and include version information if applicabl - - - @@ -560,4 +542,4 @@ Use the complete title of a license and include version information if applicabl - + \ No newline at end of file From 4e0b92a42894b45bb4a51e6a2a45776fd08845aa Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 15 May 2023 15:53:57 +0300 Subject: [PATCH 16/52] changed ai_model/tool resource types --- src/main/resources/resourceTypes/ai_model.json | 2 +- src/main/resources/resourceTypes/tool.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/resourceTypes/ai_model.json b/src/main/resources/resourceTypes/ai_model.json index 24aa5e9..ac1a2c8 100644 --- a/src/main/resources/resourceTypes/ai_model.json +++ b/src/main/resources/resourceTypes/ai_model.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schema": "\n\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" } diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index 6fc0e96..3e2fa73 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schema": "\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\nUse the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the \n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n The institution or person responsible for collecting, \n managing, distributing, or otherwise contributing to the development of \n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n\n" + "schema": "\n\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" } From 6a4eb3bb60743ca9d5e6aec2b8e45a90b9e17c72 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:05:55 +0300 Subject: [PATCH 17/52] changed schema --- src/main/resources/resourceTypes/ai_model.json | 2 +- src/main/resources/resourceTypes/tool.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/resourceTypes/ai_model.json b/src/main/resources/resourceTypes/ai_model.json index ac1a2c8..7abc4e6 100644 --- a/src/main/resources/resourceTypes/ai_model.json +++ b/src/main/resources/resourceTypes/ai_model.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schema": "\n\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" + "schema": "\n\n\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" } diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index 3e2fa73..01cec73 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schema": "\n\n\n\n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" + "schema": "\n\n\n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" } From 08eebdeff33ed1b9748dc38304e1d0ba8aa06eff Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:08:58 +0300 Subject: [PATCH 18/52] replaced schema with schemaUrl in ai_model resource type --- .../resources/resourceTypes/ai_model.json | 2 +- src/main/resources/schema/imports.xsd | 29 +++++++++++++++++++ src/main/resources/schema/model.xsd | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/resources/resourceTypes/ai_model.json b/src/main/resources/resourceTypes/ai_model.json index 7abc4e6..fe40770 100644 --- a/src/main/resources/resourceTypes/ai_model.json +++ b/src/main/resources/resourceTypes/ai_model.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schema": "\n\n\n\n\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" + "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/changed_schema/src/main/resources/schema/model.xsd" } diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd index 60ecaec..fd3f31a 100644 --- a/src/main/resources/schema/imports.xsd +++ b/src/main/resources/schema/imports.xsd @@ -20,6 +20,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 438dd6b..5297dde 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -14,7 +14,7 @@ 2019-02-14 v4.2: Addition of dateType value "Withdrawn", relationType values "Obsoletes", "isObsoletedBy", addition of new subproperties for Rights: rightsIdentifier, rightsIdentifierScheme, schemeURI, addition of the XML language attribute to the properties Creator, Contributor and Publisher for organizational names, don't check format of DOI 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> - + From 643fa35c0f4b83e60953a3f380945a5b859f51a4 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:17:03 +0300 Subject: [PATCH 19/52] fixed schemaLocation --- src/main/resources/schema/model.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 5297dde..9118828 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -15,7 +15,7 @@ 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> - + From 97b3f1e1c664fe03ad5ae4df8d717e1a9097561f Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:28:22 +0300 Subject: [PATCH 20/52] replaced relative schemaLocation with absolute --- src/main/resources/schema/model.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 9118828..b93e20b 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -15,7 +15,7 @@ 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> - + From acccd0d3f881c1eb3d790e64b53f5b86baef88ac Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:48:53 +0300 Subject: [PATCH 21/52] removed BOM from file --- src/main/resources/schema/imports.xsd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd index fd3f31a..92a1030 100644 --- a/src/main/resources/schema/imports.xsd +++ b/src/main/resources/schema/imports.xsd @@ -1,5 +1,4 @@ - - + + 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" + --> @@ -273,4 +273,4 @@ - \ No newline at end of file + From f2bb03ac435f1dc84ad5a13d28c1a0a081650387 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 16:58:57 +0300 Subject: [PATCH 22/52] used relative schemaLocation --- src/main/resources/schema/imports.xsd | 2 +- src/main/resources/schema/model.xsd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd index 92a1030..2cb6ca1 100644 --- a/src/main/resources/schema/imports.xsd +++ b/src/main/resources/schema/imports.xsd @@ -1,4 +1,4 @@ - + - + From 066087dec1c7d9aa2bdc589bb7870b594a8f2655 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 17:26:45 +0300 Subject: [PATCH 23/52] fixed xsd files and resourceTypes --- src/main/resources/resourceTypes/tool.json | 2 +- src/main/resources/schema/dataset_instance.xsd | 4 ++-- src/main/resources/schema/dataset_type.xsd | 4 ++-- src/main/resources/schema/model.xsd | 3 ++- src/main/resources/schema/tool.xsd | 13 +++++++------ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index 01cec73..db64db9 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schema": "\n\n\n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n Uniquely identifies a creator or contributor, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n Uniquely identifies an affiliation, according to various identifier schemes.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The general type of a resource.\n \n \n \n \n \n \n \n \n The type of the description.\n \n \n \n \n \n \n \n \n \n \n \n \n The type of the entity.\n \n \n \n \n \n \n \n \n \n The type of the RelatedIdentifier.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.\n Note: This is the case for all wrapper elements within this schema.\n \n No content in this wrapper element.\n \n \n \n \n \n \n \n A persistent identifier that identifies a resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.\n Format: Family, Given.\n Personal names can be further specified using givenName and familyName.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n A name or title by which a resource is known.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n In the case of datasets, \"publish\" is understood to mean making the data available to the community of researchers.\n \n \n \n \n \n \n \n \n \n \n Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.\n In the case of datasets, \"publish\" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.\n YYYY\n \n \n \n \n \n \n \n The type of a resource. You may enter an additional free text description.\n The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.\n \n \n \n \n \n \n \n \n Subject, keywords, classification codes, or key phrases describing the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.\n The personal name format should be: Family, Given.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Different dates relevant to the work.\n YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Primary language of the resource. Allowed values are taken from IETF BCP 47, ISO 639-1 language codes.\n \n \n \n \n \n \n \n An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Unstructures size information about the resource.\n \n \n \n \n \n \n \n \n \n \n Technical format of the resource.\n Use file extension or MIME type where possible.\n \n \n \n \n \n \n \n Version number of the resource. If the primary resource has changed the version number increases.\n Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.\n \n \n \n \n \n \n \n \n Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.\n Use the complete title of a license and include version information if applicable.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about financial support (funding) for the resource being registered.\n \n \n \n \n \n Name of the funding provider.\n \n \n \n \n \n \n \n Uniquely identifies a funding entity, according to various types.\n \n \n \n \n \n \n \n \n \n \n \n \n The code assigned by the funder to a sponsored award (grant).\n \n \n \n \n \n \n \n \n \n \n \n The human-readable title of the award (grant).\n \n \n \n \n \n \n \n \n \n \n \n \n \n Information about a resource related to the one being registered e.g. a journal or book of which the article or chapter is part.\n \n \n \n \n \n The identifier for the related item.\n \n \n \n \n \n \n The type of the Identifier for the related item e.g. DOI.\n \n \n \n \n The name of the scheme.\n \n \n \n \n The URI of the relatedMetadataScheme.\n \n \n \n \n The type of the relatedMetadataScheme, linked with the schemeURI.\n \n \n \n \n \n \n \n \n \n \n \n \n The institution or person responsible for creating the\n related resource. To supply multiple creators, repeat this property.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Title of the related item.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The year when the item was or will be made publicly available.\n \n \n \n \n \n \n \n Volume of the related item.\n \n \n \n \n Issue number or name of the related item.\n \n \n \n \n Number of the related item e.g. report number of article number.\n \n \n \n \n \n \n \n \n \n \n \n First page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n Last page of the related item e.g. of the chapter, article, or conference paper.\n \n \n \n \n The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.\n \n \n \n \n Edition or version of the related item.\n \n \n \n \n \n \n \n \n The institution or person responsible for collecting,\n managing, distributing, or otherwise contributing to the development of\n the resource.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n The type of contributor of the resource.\n \n \n \n \n \n \n \n \n \n \n The type of the related item, e.g. journal article, book or chapter.\n \n \n \n \n Description of the relationship of the resource being registered (A) and the related resource (B).\n \n \n \n \n \n \n \n \n \n \n" + "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/changed_schema/src/main/resources/schema/tool.xsd" } diff --git a/src/main/resources/schema/dataset_instance.xsd b/src/main/resources/schema/dataset_instance.xsd index 893cf34..312d688 100644 --- a/src/main/resources/schema/dataset_instance.xsd +++ b/src/main/resources/schema/dataset_instance.xsd @@ -1,4 +1,4 @@ - + - + diff --git a/src/main/resources/schema/dataset_type.xsd b/src/main/resources/schema/dataset_type.xsd index 7af2bd2..4f7e943 100644 --- a/src/main/resources/schema/dataset_type.xsd +++ b/src/main/resources/schema/dataset_type.xsd @@ -1,4 +1,4 @@ - + - + diff --git a/src/main/resources/schema/model.xsd b/src/main/resources/schema/model.xsd index 9118828..06790c4 100644 --- a/src/main/resources/schema/model.xsd +++ b/src/main/resources/schema/model.xsd @@ -13,7 +13,8 @@ 2018-09-08 v4.1.1 Make schema 4.1 backwards compatible to 4.0 by allowing geolocation elements in any order 2019-02-14 v4.2: Addition of dateType value "Withdrawn", relationType values "Obsoletes", "isObsoletedBy", addition of new subproperties for Rights: rightsIdentifier, rightsIdentifierScheme, schemeURI, addition of the XML language attribute to the properties Creator, Contributor and Publisher for organizational names, don't check format of DOI 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier - 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" --> + 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" + --> diff --git a/src/main/resources/schema/tool.xsd b/src/main/resources/schema/tool.xsd index 74d223c..762cebb 100644 --- a/src/main/resources/schema/tool.xsd +++ b/src/main/resources/schema/tool.xsd @@ -1,4 +1,4 @@ - + - - + 2019-07-13 v4.3: Addition of new subproperties for Affiliation: "affiliationIdentifier", "affiliationIdentifierScheme", "schemeURI", addition of new sub-property for funderIdentifier: "schemeURI", addition of new funderIdentifierScheme: "ROR", added documentation for nameIdentifier + 2021-03-08 v4.4: Addition of new property relatedItem, relationType value "isPublishedIn", subject subproperty "classificationCode", controlled list "numberType", additional 13 properties for controlled list "resourceType" + --> + + From 56126444e4857b60a32435908314e94495dc5241 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 17:30:01 +0300 Subject: [PATCH 24/52] updated catalogue lib version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e0c815f..350d774 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ gr.athenarc catalogue - 3.2.0 + 3.2.1 From 97dcc9fe870b9dce2b688c17a0b3637f64d2ff7c Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 7 Jun 2023 17:34:34 +0300 Subject: [PATCH 25/52] fixed schemaUrl values --- src/main/resources/resourceTypes/ai_model.json | 2 +- src/main/resources/resourceTypes/tool.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/resourceTypes/ai_model.json b/src/main/resources/resourceTypes/ai_model.json index fe40770..cc6fb8c 100644 --- a/src/main/resources/resourceTypes/ai_model.json +++ b/src/main/resources/resourceTypes/ai_model.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Model" }, - "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/changed_schema/src/main/resources/schema/model.xsd" + "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/develop/src/main/resources/schema/model.xsd" } diff --git a/src/main/resources/resourceTypes/tool.json b/src/main/resources/resourceTypes/tool.json index db64db9..e8ed8b6 100644 --- a/src/main/resources/resourceTypes/tool.json +++ b/src/main/resources/resourceTypes/tool.json @@ -116,5 +116,5 @@ "properties": { "class": "eu.intelcomp.xsd2java.Tool" }, - "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/changed_schema/src/main/resources/schema/tool.xsd" + "schemaUrl": "https://raw.githubusercontent.com/IntelCompH2020/intelcomp-catalogue/develop/src/main/resources/schema/tool.xsd" } From 09f5ad0a053131bf11af74ba9a417369068276e4 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Wed, 14 Jun 2023 12:40:16 +0300 Subject: [PATCH 26/52] Major version update: 1. Updated dependencies (registry / catalogue) 2. Upgraded springdoc & swagger 3. Added Spring Actuator 4. Simplified configuration --- pom.xml | 15 +++--- .../catalogue/IntelcompApplication.java | 9 ++-- .../catalogue/config/AuthSuccessHandler.java | 10 ++-- .../config/CompleteLogoutSuccessHandler.java | 10 ++-- .../config/IntelcompConfiguration.java | 26 ++-------- ...operties.java => IntelcompProperties.java} | 4 +- .../catalogue/config/SecurityConfig.java | 17 +++---- .../config/SpringFoxConfiguration.java | 9 ---- .../controller/DatasetController.java | 23 ++------- .../IntelcompGenericExceptionController.java | 49 ------------------- .../catalogue/controller/JobController.java | 16 +++--- .../catalogue/controller/UserController.java | 13 +++-- 12 files changed, 54 insertions(+), 147 deletions(-) rename src/main/java/eu/intelcomp/catalogue/config/{ApplicationProperties.java => IntelcompProperties.java} (89%) delete mode 100644 src/main/java/eu/intelcomp/catalogue/config/SpringFoxConfiguration.java delete mode 100644 src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java diff --git a/pom.xml b/pom.xml index 350d774..3bb8870 100644 --- a/pom.xml +++ b/pom.xml @@ -5,18 +5,18 @@ org.springframework.boot spring-boot-starter-parent - 2.5.6 + 2.5.7 eu.intelcomp catalogue - 1.0.0-SNAPSHOT + 2.0.0-SNAPSHOT jar intelcomp Intelcomp Catalogue Project 11 - 2.4.4 + 2.5.2 @@ -46,16 +46,19 @@ + + org.springframework.boot + spring-boot-starter-actuator + + org.springframework.boot spring-boot-starter-oauth2-client - 2.6.1 org.springframework.boot spring-boot-starter-oauth2-resource-server - 2.6.1 @@ -78,7 +81,7 @@ gr.athenarc catalogue - 3.2.1 + 5.0.0-SNAPSHOT diff --git a/src/main/java/eu/intelcomp/catalogue/IntelcompApplication.java b/src/main/java/eu/intelcomp/catalogue/IntelcompApplication.java index fe815ca..6a4083a 100644 --- a/src/main/java/eu/intelcomp/catalogue/IntelcompApplication.java +++ b/src/main/java/eu/intelcomp/catalogue/IntelcompApplication.java @@ -2,13 +2,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) +@SpringBootApplication public class IntelcompApplication { - public static void main(String[] args) { - SpringApplication.run(IntelcompApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(IntelcompApplication.class, args); + } } diff --git a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java index a8db1b3..d6aff0c 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java +++ b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java @@ -23,12 +23,12 @@ public class AuthSuccessHandler implements AuthenticationSuccessHandler { private static final Logger logger = LoggerFactory.getLogger(AuthSuccessHandler.class); - private final ApplicationProperties applicationProperties; + private final IntelcompProperties intelcompProperties; private final ObjectMapper objectMapper = new ObjectMapper(); @Autowired - public AuthSuccessHandler(ApplicationProperties applicationProperties) { - this.applicationProperties = applicationProperties; + public AuthSuccessHandler(IntelcompProperties intelcompProperties) { + this.intelcompProperties = intelcompProperties; } @Override @@ -45,8 +45,8 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo logger.debug("Assigning Cookie: {}", objectMapper.writeValueAsString(cookie)); response.addCookie(cookie); - logger.debug("Authentication Successful - Redirecting to: {}", applicationProperties.getLoginRedirect()); - response.sendRedirect(applicationProperties.getLoginRedirect()); + logger.debug("Authentication Successful - Redirecting to: {}", intelcompProperties.getLoginRedirect()); + response.sendRedirect(intelcompProperties.getLoginRedirect()); } private int createCookieMaxAge(Authentication authentication) { diff --git a/src/main/java/eu/intelcomp/catalogue/config/CompleteLogoutSuccessHandler.java b/src/main/java/eu/intelcomp/catalogue/config/CompleteLogoutSuccessHandler.java index b4ee3bb..b27f369 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/CompleteLogoutSuccessHandler.java +++ b/src/main/java/eu/intelcomp/catalogue/config/CompleteLogoutSuccessHandler.java @@ -23,12 +23,12 @@ public class CompleteLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler private final String OPENID_CONFIGURATION = "/.well-known/openid-configuration"; private final String END_SESSION_ENDPOINT = "end_session_endpoint"; - private final ApplicationProperties applicationProperties; + private final IntelcompProperties intelcompProperties; private final RestTemplate restTemplate = new RestTemplate(); @Autowired - public CompleteLogoutSuccessHandler(ApplicationProperties applicationProperties) { - this.applicationProperties = applicationProperties; + public CompleteLogoutSuccessHandler(IntelcompProperties intelcompProperties) { + this.intelcompProperties = intelcompProperties; } @Override @@ -44,9 +44,9 @@ public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse resp String logoutEndpoint = getLogoutEndpoint(url); String logoutUrl; if (logoutEndpoint != null) { - logoutUrl = String.format("%s?redirect_uri=%s", logoutEndpoint, applicationProperties.getLogoutRedirect()); + logoutUrl = String.format("%s?redirect_uri=%s", logoutEndpoint, intelcompProperties.getLogoutRedirect()); } else { - logoutUrl = applicationProperties.getLogoutRedirect(); + logoutUrl = intelcompProperties.getLogoutRedirect(); } response.sendRedirect(logoutUrl); super.onLogoutSuccess(request, response, authentication); diff --git a/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java b/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java index 838fb42..5c28ca7 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java +++ b/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java @@ -1,29 +1,11 @@ package eu.intelcomp.catalogue.config; -import eu.openminted.registry.core.controllers.ResourceSyncController; -import gr.athenarc.catalogue.CatalogueApplication; -import gr.athenarc.catalogue.config.CatalogueLibConfiguration; -import gr.athenarc.catalogue.config.LibConfiguration; -import gr.athenarc.catalogue.config.RegistryCoreConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.FilterType; @Configuration -@ComponentScan(value = { - "gr.athenarc", - "eu.openminted.registry.core", -}, -excludeFilters = { - @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = CatalogueApplication.class), - @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = LibConfiguration.class), // TODO: remove if lib is fixed - @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RegistryCoreConfiguration.class), - @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = ResourceSyncController.class) -}) -public class IntelcompConfiguration implements CatalogueLibConfiguration { - - @Override - public String generatedClassesPackageName() { - return "eu.intelcomp.xsd2java"; - } +@EnableConfigurationProperties(IntelcompProperties.class) +@ComponentScan(value = {"eu.openminted.registry.core"}) +public class IntelcompConfiguration { } diff --git a/src/main/java/eu/intelcomp/catalogue/config/ApplicationProperties.java b/src/main/java/eu/intelcomp/catalogue/config/IntelcompProperties.java similarity index 89% rename from src/main/java/eu/intelcomp/catalogue/config/ApplicationProperties.java rename to src/main/java/eu/intelcomp/catalogue/config/IntelcompProperties.java index 9641a85..6ee1702 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/ApplicationProperties.java +++ b/src/main/java/eu/intelcomp/catalogue/config/IntelcompProperties.java @@ -1,13 +1,11 @@ package eu.intelcomp.catalogue.config; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; import java.util.Set; -@Component @ConfigurationProperties(prefix = "intelcomp") -public class ApplicationProperties { +public class IntelcompProperties { private Set admins; diff --git a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java index a0af927..eead6d7 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java +++ b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java @@ -6,15 +6,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; -import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; -import org.springframework.security.oauth2.core.OAuth2Token; import org.springframework.security.oauth2.core.oidc.OidcIdToken; import org.springframework.security.oauth2.core.oidc.OidcUserInfo; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; @@ -34,15 +31,15 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { private final AuthenticationSuccessHandler authSuccessHandler; private final CompleteLogoutSuccessHandler logoutSuccessHandler; - private final ApplicationProperties applicationProperties; + private final IntelcompProperties intelcompProperties; @Autowired public SecurityConfig(AuthenticationSuccessHandler authSuccessHandler, CompleteLogoutSuccessHandler logoutSuccessHandler, - ApplicationProperties applicationProperties) { + IntelcompProperties intelcompProperties) { this.authSuccessHandler = authSuccessHandler; this.logoutSuccessHandler = logoutSuccessHandler; - this.applicationProperties = applicationProperties; + this.intelcompProperties = intelcompProperties; } @Override @@ -87,14 +84,14 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { } } - if (idToken != null && applicationProperties.getAdmins().contains(idToken.getClaims().get("email"))) { + if (idToken != null && intelcompProperties.getAdmins().contains(idToken.getClaims().get("email"))) { mappedAuthorities.add(new SimpleGrantedAuthority("ADMIN")); - } else if (userInfo != null && applicationProperties.getAdmins().contains(userInfo.getEmail())) { + } else if (userInfo != null && intelcompProperties.getAdmins().contains(userInfo.getEmail())) { mappedAuthorities.add(new SimpleGrantedAuthority("ADMIN")); } else { if (((OidcUserAuthority) authority).getAttributes() != null && ((OidcUserAuthority) authority).getAttributes().containsKey("email") - && (applicationProperties.getAdmins().contains(((OidcUserAuthority) authority).getAttributes().get("email")))) { + && (intelcompProperties.getAdmins().contains(((OidcUserAuthority) authority).getAttributes().get("email")))) { mappedAuthorities.add(new SimpleGrantedAuthority("ADMIN")); } } @@ -107,7 +104,7 @@ public GrantedAuthoritiesMapper userAuthoritiesMapper() { OAuth2User oauth2User = (OAuth2User) authority; Map userAttributes = oauth2User.getAttributes(); - if (userAttributes != null && applicationProperties.getAdmins().contains(userAttributes.get("email"))) { + if (userAttributes != null && intelcompProperties.getAdmins().contains(userAttributes.get("email"))) { mappedAuthorities.add(new SimpleGrantedAuthority("ADMIN")); } diff --git a/src/main/java/eu/intelcomp/catalogue/config/SpringFoxConfiguration.java b/src/main/java/eu/intelcomp/catalogue/config/SpringFoxConfiguration.java deleted file mode 100644 index 03b0a5d..0000000 --- a/src/main/java/eu/intelcomp/catalogue/config/SpringFoxConfiguration.java +++ /dev/null @@ -1,9 +0,0 @@ -package eu.intelcomp.catalogue.config; - -import gr.athenarc.catalogue.config.SpringFoxConfig; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class SpringFoxConfiguration extends SpringFoxConfig { - -} diff --git a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java index 1cabdec..4c665f3 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java @@ -1,16 +1,11 @@ package eu.intelcomp.catalogue.controller; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import eu.intelcomp.catalogue.domain.ModelAnswer; +import eu.intelcomp.xsd2java.DatasetType; import eu.openminted.registry.core.domain.Resource; import eu.openminted.registry.core.service.SearchService; import gr.athenarc.catalogue.service.GenericItemService; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; @@ -24,26 +19,16 @@ public class DatasetController { private static final Logger logger = LoggerFactory.getLogger(DatasetController.class); - private final ObjectMapper objectMapper = new ObjectMapper(); private final GenericItemService genericItemService; - @Autowired public DatasetController(GenericItemService genericItemService) { this.genericItemService = genericItemService; } @GetMapping("{id}") - public ModelAnswer get(@PathVariable("id") String id) { - ModelAnswer dataset = null; - try { - String json = objectMapper.writeValueAsString(genericItemService.get("dataset_type", id)); - Object answer = JSONValue.parse(json); - dataset = new ModelAnswer((JSONObject) answer); - } catch (JsonProcessingException e) { - logger.error(e.getMessage(), e); - } - - return dataset; + public ResponseEntity get(@PathVariable("id") String id) { + DatasetType dataset = genericItemService.get("dataset_type", id); + return ResponseEntity.ok(dataset); } // TODO: helper method, remove when job filter is implemented correctly from @CITE diff --git a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java b/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java deleted file mode 100644 index 1e946bf..0000000 --- a/src/main/java/eu/intelcomp/catalogue/controller/IntelcompGenericExceptionController.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.intelcomp.catalogue.controller; - -import gr.athenarc.catalogue.controller.GenericExceptionController; -import gr.athenarc.catalogue.exception.ResourceException; -import gr.athenarc.catalogue.exception.ServerError; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.authentication.InsufficientAuthenticationException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.client.HttpClientErrorException; - -import javax.servlet.http.HttpServletRequest; - -@ControllerAdvice -public class IntelcompGenericExceptionController extends GenericExceptionController { - - private static final Logger logger = LoggerFactory.getLogger(IntelcompGenericExceptionController.class); - - @ExceptionHandler(Exception.class) - ResponseEntity handleException(HttpServletRequest req, Exception ex) { - HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR; - if (ex instanceof ResourceException) { - logger.info(ex.getMessage(), ex); - status = ((ResourceException) ex).getStatus(); - } else if (ex instanceof HttpClientErrorException) { - logger.info(ex.getMessage(), ex); - status = ((HttpClientErrorException) ex).getStatusCode(); - } else if (ex instanceof AccessDeniedException) { - logger.info(ex.getMessage()); - logger.debug(ex.getMessage(), ex); - status = HttpStatus.FORBIDDEN; - } else if (ex instanceof InsufficientAuthenticationException) { - logger.info(ex.getMessage()); - logger.debug(ex.getMessage(), ex); - status = HttpStatus.UNAUTHORIZED; - } else { - logger.error(ex.getMessage(), ex); - } - return ResponseEntity - .status(status) - .body(new ServerError(status, req, ex)); - } - - -} diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index 1ae9f2a..ed45158 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -1,14 +1,17 @@ package eu.intelcomp.catalogue.controller; -import eu.intelcomp.catalogue.domain.*; +import eu.intelcomp.catalogue.domain.Job; +import eu.intelcomp.catalogue.domain.JobFilters; +import eu.intelcomp.catalogue.domain.JobInfo; +import eu.intelcomp.catalogue.domain.User; import eu.intelcomp.catalogue.service.JobService; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; @@ -18,21 +21,20 @@ public class JobController { private final JobService jobService; - @Autowired public JobController(JobService jobService) { this.jobService = jobService; } @PostMapping("execute") @PreAuthorize("hasAuthority('OPERATOR_DATA-PROCESSOR')") - public ResponseEntity add(@RequestBody Job job, @ApiIgnore Authentication authentication) { + public ResponseEntity add(@RequestBody Job job, @Parameter(hidden = true) Authentication authentication) { return new ResponseEntity<>(jobService.add(job, authentication), HttpStatus.OK); } @GetMapping("/{jobId}") public ResponseEntity get(@PathVariable("jobId") String id, @RequestParam(value = "user", required = false) String userId, - @ApiIgnore Authentication authentication) { + @Parameter(hidden = true) Authentication authentication) { if (userId == null || "".equals(userId)) { userId = User.of(authentication).getSub(); } @@ -40,14 +42,14 @@ public ResponseEntity get(@PathVariable("jobId") String id, } @PostMapping - public ResponseEntity> browse(@RequestBody JobFilters jobFilters, @ApiIgnore Authentication authentication) { + public ResponseEntity> browse(@RequestBody JobFilters jobFilters, @Parameter(hidden = true) Authentication authentication) { return new ResponseEntity<>(jobService.browse(jobFilters, authentication), HttpStatus.OK); } @DeleteMapping("/{jobId}") public ResponseEntity delete(@PathVariable("jobId") String id, @RequestParam(value = "user", required = false) String userId, - @ApiIgnore Authentication authentication) { + @Parameter(hidden = true) Authentication authentication) { if (userId == null || "".equals(userId)) { userId = User.of(authentication).getSub(); } diff --git a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java index 5bf5cf4..8d32620 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java @@ -1,6 +1,8 @@ package eu.intelcomp.catalogue.controller; import eu.intelcomp.catalogue.domain.User; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Parameter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -11,35 +13,32 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import springfox.documentation.annotations.ApiIgnore; @RestController @RequestMapping("user") public class UserController { - @Autowired public UserController() { - } @GetMapping("info") - public ResponseEntity getInfo(@ApiIgnore Authentication authentication) { + public ResponseEntity getInfo(@Parameter(hidden = true) Authentication authentication) { return new ResponseEntity<>(User.of(authentication), HttpStatus.OK); } - @ApiIgnore + @Hidden @GetMapping("auth/oidc-principal") public OidcUser getOidcUserPrincipal(@AuthenticationPrincipal OidcUser principal) { return principal; } - @ApiIgnore + @Hidden @GetMapping("auth/oauth2-principal") public OAuth2User getOAuth2UserPrincipal(@AuthenticationPrincipal OAuth2User principal) { return principal; } - @ApiIgnore + @Hidden @GetMapping("auth") public Authentication getAuth(Authentication auth) { return auth; From 3fdc6f89702bc5aa01201c1551d2ce88a6570e0e Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 20 Jun 2023 18:10:09 +0300 Subject: [PATCH 27/52] Changes in job service: 1. Fixed authorization for new jobs 2. Added processes as filter when browsing jobs --- .../catalogue/controller/JobController.java | 15 +++++++++++++-- .../eu/intelcomp/catalogue/domain/JobFilters.java | 10 ++++++++++ .../catalogue/service/ExternalApiJobService.java | 13 ++++++------- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index ed45158..7c840db 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -5,8 +5,8 @@ import eu.intelcomp.catalogue.domain.JobInfo; import eu.intelcomp.catalogue.domain.User; import eu.intelcomp.catalogue.service.JobService; +import gr.athenarc.catalogue.exception.ResourceException; import io.swagger.v3.oas.annotations.Parameter; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; @@ -26,7 +26,7 @@ public JobController(JobService jobService) { } @PostMapping("execute") - @PreAuthorize("hasAuthority('OPERATOR_DATA-PROCESSOR')") + @PreAuthorize("(hasAuthority('OPERATOR-WORKFLOW_PROCESSOR') && @jobController.jobIsWorkflow(#job)) || (hasAuthority('OPERATOR_DATA-PROCESSOR') && !@jobController.jobIsWorkflow(#job))") public ResponseEntity add(@RequestBody Job job, @Parameter(hidden = true) Authentication authentication) { return new ResponseEntity<>(jobService.add(job, authentication), HttpStatus.OK); } @@ -56,4 +56,15 @@ public ResponseEntity delete(@PathVariable("jobId") String id, jobService.delete(id, userId); return new ResponseEntity<>(HttpStatus.OK); } + + public static boolean jobIsWorkflow(Job job) { + if (job == null || job.getServiceArguments() == null || job.getJobArguments() == null) { + throw new ResourceException("Incomplete Job information", HttpStatus.BAD_REQUEST); + } + if (job.getServiceArguments().getProcessId() == null || "".equals(job.getServiceArguments().getProcessId())) { + throw new ResourceException("'processId' cannot be empty", HttpStatus.BAD_REQUEST); + } + + return job.getServiceArguments().getProcessId().endsWith("-workflow"); + } } diff --git a/src/main/java/eu/intelcomp/catalogue/domain/JobFilters.java b/src/main/java/eu/intelcomp/catalogue/domain/JobFilters.java index 4694632..afcb0ed 100644 --- a/src/main/java/eu/intelcomp/catalogue/domain/JobFilters.java +++ b/src/main/java/eu/intelcomp/catalogue/domain/JobFilters.java @@ -2,11 +2,13 @@ import java.util.Date; import java.util.List; +import java.util.Map; public class JobFilters { private String user; private List ids; + private List processes; private List statuses; // private List statuses; #["QUEUED", "FINISHED", "RUNNING"] private Date createdAfter; @@ -35,6 +37,14 @@ public void setUser(String user) { this.user = user; } + public List getProcesses() { + return processes; + } + + public void setProcesses(List processes) { + this.processes = processes; + } + public List getIds() { return ids; } diff --git a/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java b/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java index 73d2b49..7e405ac 100644 --- a/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java +++ b/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java @@ -1,18 +1,18 @@ package eu.intelcomp.catalogue.service; -import eu.intelcomp.catalogue.domain.*; +import eu.intelcomp.catalogue.domain.Job; +import eu.intelcomp.catalogue.domain.JobFilters; +import eu.intelcomp.catalogue.domain.JobInfo; +import eu.intelcomp.catalogue.domain.User; import gr.athenarc.catalogue.exception.ResourceException; -import gr.athenarc.catalogue.exception.ResourceNotFoundException; -import org.slf4j.LoggerFactory; -import org.slf4j.Logger;; import org.json.simple.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.*; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; import java.util.List; @@ -30,7 +30,6 @@ public class ExternalApiJobService implements JobService { private final ExternalJobServiceProperties properties; RestTemplate restTemplate = new RestTemplate(); - @Autowired public ExternalApiJobService(ExternalJobServiceProperties properties) { this.properties = properties; } From aa042752c71673be1438c69e1ee58a4efd85729c Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 27 Jun 2023 18:54:49 +0300 Subject: [PATCH 28/52] changed filters from string values to lists --- .../eu/intelcomp/catalogue/domain/Job.java | 42 +++++++++---------- .../service/ExternalApiJobService.java | 7 +++- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/domain/Job.java b/src/main/java/eu/intelcomp/catalogue/domain/Job.java index 71dd23e..448e673 100644 --- a/src/main/java/eu/intelcomp/catalogue/domain/Job.java +++ b/src/main/java/eu/intelcomp/catalogue/domain/Job.java @@ -32,9 +32,9 @@ public void setCallerAttributes(String callerAttributes) { this.callerAttributes = callerAttributes; } - public void addJobArgument(String name, String value) { - this.jobArguments.add(new JobArgument(name, value)); - } +// public void addJobArgument(String name, String value) { +// this.jobArguments.add(new JobArgument(name, value)); +// } // public void addJobArgument(String name, String value) { // this.jobArguments.add(new JobArgument(name, Collections.singletonList(value))); @@ -98,22 +98,22 @@ public void setInfraId(String infraId) { public static class JobArgument { private String name; - private String value; -// private List value = new ArrayList<>(); +// private String value; + private List value = new ArrayList<>(); public JobArgument() { } - public JobArgument(String name, String value) { - this.name = name; - this.value = value; - } - -// public JobArgument(String name, List value) { +// public JobArgument(String name, String value) { // this.name = name; // this.value = value; // } + public JobArgument(String name, List value) { + this.name = name; + this.value = value; + } + public String getName() { return name; } @@ -122,20 +122,20 @@ public void setName(String name) { this.name = name; } - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - -// public List getValue() { +// public String getValue() { // return value; // } // -// public void setValue(List value) { +// public void setValue(String value) { // this.value = value; // } + + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } } } diff --git a/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java b/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java index 7e405ac..5a37320 100644 --- a/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java +++ b/src/main/java/eu/intelcomp/catalogue/service/ExternalApiJobService.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import org.springframework.util.StringUtils; import org.springframework.web.client.RestTemplate; import java.util.List; @@ -39,10 +40,12 @@ public JobInfo add(Job job, Authentication authentication) { if (job == null || job.getServiceArguments() == null || job.getJobArguments() == null) { throw new ResourceException("Incomplete Job information", HttpStatus.BAD_REQUEST); } - if (job.getServiceArguments().getProcessId() == null || "".equals(job.getServiceArguments().getProcessId())) { + if (!StringUtils.hasText(job.getServiceArguments().getProcessId())) { throw new ResourceException("'processId' cannot be empty", HttpStatus.BAD_REQUEST); } - job.getServiceArguments().setInfraId("k8s"); + if (!StringUtils.hasText(job.getServiceArguments().getInfraId())) { + job.getServiceArguments().setInfraId("k8s"); + } job.getServiceArguments().setUser(User.of(authentication).getSub()); HttpEntity request = new HttpEntity<>(job, createHeaders()); String url = String.join("/", properties.getApiUrl(), EXECUTE_JOB); From c0ea582479b31f8a0908ab0e04f87c730efee270 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 27 Jun 2023 21:12:02 +0300 Subject: [PATCH 29/52] created Dataset pojo --- .../intelcomp/catalogue/domain/Dataset.java | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/main/java/eu/intelcomp/catalogue/domain/Dataset.java diff --git a/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java b/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java new file mode 100644 index 0000000..c47b7f8 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java @@ -0,0 +1,93 @@ +package eu.intelcomp.catalogue.domain; + +import java.util.Date; +import java.util.List; + + +public class Dataset { + + private String id; + private String name; + private String description; + private List usages; + private String owner; + private Date creationDate; + private String createdBy; + private Date modificationDate; + private String modifiedBy; + + public Dataset() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getUsages() { + return usages; + } + + public void setUsages(List usages) { + this.usages = usages; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public Date getCreationDate() { + return creationDate; + } + + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getModificationDate() { + return modificationDate; + } + + public void setModificationDate(Date modificationDate) { + this.modificationDate = modificationDate; + } + + public String getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(String modifiedBy) { + this.modifiedBy = modifiedBy; + } +} From 7ab05e30c6c2b10227c6e772e655166ca596a183 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 30 Jun 2023 19:39:36 +0300 Subject: [PATCH 30/52] save file in custom directory and submit job with 'file' argument --- .../catalogue/controller/JobController.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index 7c840db..edda3b6 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -1,5 +1,7 @@ package eu.intelcomp.catalogue.controller; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import eu.intelcomp.catalogue.domain.Job; import eu.intelcomp.catalogue.domain.JobFilters; import eu.intelcomp.catalogue.domain.JobInfo; @@ -8,17 +10,26 @@ import gr.athenarc.catalogue.exception.ResourceException; import io.swagger.v3.oas.annotations.Parameter; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.List; +import java.util.UUID; @RestController @RequestMapping("jobs") public class JobController { + private static final ObjectMapper mapper = new ObjectMapper(); private final JobService jobService; public JobController(JobService jobService) { @@ -31,6 +42,25 @@ public ResponseEntity add(@RequestBody Job job, @Parameter(hidden = tru return new ResponseEntity<>(jobService.add(job, authentication), HttpStatus.OK); } + @PostMapping(value = "execute/custom", consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + @PreAuthorize("hasAuthority('ADMIN') or (hasAuthority('OPERATOR-WORKFLOW_PROCESSOR') && @jobController.jobIsWorkflow(#jobString))") + public ResponseEntity addJobWithFile(@RequestParam(name = "job") String jobString, @RequestPart MultipartFile file, @Parameter(hidden = true) Authentication authentication) throws IOException { + // save + Job job = mapper.readValue(jobString, Job.class); + String location = String.format("/workdir/ui/%s/", UUID.randomUUID()); + Files.createDirectories(Paths.get(location)); + String filepath = location + file.getOriginalFilename(); + File f = new File(filepath); + Job.JobArgument fileArgument = new Job.JobArgument(); + file.transferTo(f); + fileArgument.setName("file"); + fileArgument.setValue(List.of(filepath)); + job.getJobArguments().add(fileArgument); + JobInfo info = jobService.add(job, authentication); +// Files.createDirectories(Paths.get(String.format("/workdir/%s/%s", job.getServiceArguments().getProcessId(), info.getCreatedAt()))); + return new ResponseEntity<>(info, HttpStatus.OK); + } + @GetMapping("/{jobId}") public ResponseEntity get(@PathVariable("jobId") String id, @RequestParam(value = "user", required = false) String userId, @@ -57,7 +87,13 @@ public ResponseEntity delete(@PathVariable("jobId") String id, return new ResponseEntity<>(HttpStatus.OK); } - public static boolean jobIsWorkflow(Job job) { + public static boolean jobIsWorkflow(Object obj) throws JsonProcessingException { + Job job; + if (obj instanceof String) { + job = mapper.readValue((String) obj, Job.class); + } else { + job = (Job) obj; + } if (job == null || job.getServiceArguments() == null || job.getJobArguments() == null) { throw new ResourceException("Incomplete Job information", HttpStatus.BAD_REQUEST); } From 0095e1ec3d0938ab97008da6857358eac89c24a9 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 6 Jul 2023 12:56:31 +0300 Subject: [PATCH 31/52] added download output file functionality --- .../catalogue/controller/JobController.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index edda3b6..1196356 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -8,19 +8,26 @@ import eu.intelcomp.catalogue.domain.User; import eu.intelcomp.catalogue.service.JobService; import gr.athenarc.catalogue.exception.ResourceException; +import gr.athenarc.catalogue.exception.ResourceNotFoundException; import io.swagger.v3.oas.annotations.Parameter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.Resource; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.File; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.UUID; @@ -29,6 +36,7 @@ @RequestMapping("jobs") public class JobController { + private static final Logger logger = LoggerFactory.getLogger(JobController.class); private static final ObjectMapper mapper = new ObjectMapper(); private final JobService jobService; @@ -61,6 +69,33 @@ public ResponseEntity addJobWithFile(@RequestParam(name = "job") String return new ResponseEntity<>(info, HttpStatus.OK); } + @RequestMapping(path = "/{jobId}/output/download", method = RequestMethod.GET) + public ResponseEntity download(@PathVariable("jobId") String id, + @RequestParam String process, + @RequestParam String filename, + @Parameter(hidden = true) Authentication authentication) { + JobInfo info = get(id, null, authentication).getBody(); + ResponseEntity responseEntity = ResponseEntity.notFound().build(); + if (info != null) { + try { + File file = new File(String.format("/workdir/%s/%s/output/%s", process, id, filename)); + Path path = Paths.get(file.getAbsolutePath()); + + ByteArrayResource resource = new ByteArrayResource(Files.readAllBytes(path)); + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.cvs", id)); + responseEntity = ResponseEntity.ok() + .headers(headers) + .contentLength(file.length()) + .contentType(MediaType.APPLICATION_OCTET_STREAM) + .body(resource); + } catch (Exception e) { + logger.warn("Could not find file : {}", e.getMessage()); + } + } + return responseEntity; + } + @GetMapping("/{jobId}") public ResponseEntity get(@PathVariable("jobId") String id, @RequestParam(value = "user", required = false) String userId, From 5c8ff512100193bb27ab9797719d0d8c137a8558 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 6 Jul 2023 14:34:10 +0300 Subject: [PATCH 32/52] created job properties component and removed hardcoded paths --- pom.xml | 6 ++ .../catalogue/controller/JobController.java | 29 ++++--- .../catalogue/service/JobProperties.java | 81 +++++++++++++++++++ 3 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 src/main/java/eu/intelcomp/catalogue/service/JobProperties.java diff --git a/pom.xml b/pom.xml index 3bb8870..55591a1 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,12 @@ spring-boot-starter-actuator + + org.springframework.boot + spring-boot-configuration-processor + true + + org.springframework.boot spring-boot-starter-oauth2-client diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index 1196356..0745463 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -6,9 +6,9 @@ import eu.intelcomp.catalogue.domain.JobFilters; import eu.intelcomp.catalogue.domain.JobInfo; import eu.intelcomp.catalogue.domain.User; +import eu.intelcomp.catalogue.service.JobProperties; import eu.intelcomp.catalogue.service.JobService; import gr.athenarc.catalogue.exception.ResourceException; -import gr.athenarc.catalogue.exception.ResourceNotFoundException; import io.swagger.v3.oas.annotations.Parameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,10 +23,9 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; -import java.io.IOException; import java.io.File; +import java.io.IOException; import java.nio.file.Files; -import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; @@ -39,9 +38,11 @@ public class JobController { private static final Logger logger = LoggerFactory.getLogger(JobController.class); private static final ObjectMapper mapper = new ObjectMapper(); private final JobService jobService; + private final JobProperties jobProperties; - public JobController(JobService jobService) { + public JobController(JobService jobService, JobProperties jobProperties) { this.jobService = jobService; + this.jobProperties = jobProperties; } @PostMapping("execute") @@ -50,12 +51,16 @@ public ResponseEntity add(@RequestBody Job job, @Parameter(hidden = tru return new ResponseEntity<>(jobService.add(job, authentication), HttpStatus.OK); } - @PostMapping(value = "execute/custom", consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + @PostMapping(value = "execute/custom", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE}) @PreAuthorize("hasAuthority('ADMIN') or (hasAuthority('OPERATOR-WORKFLOW_PROCESSOR') && @jobController.jobIsWorkflow(#jobString))") public ResponseEntity addJobWithFile(@RequestParam(name = "job") String jobString, @RequestPart MultipartFile file, @Parameter(hidden = true) Authentication authentication) throws IOException { // save Job job = mapper.readValue(jobString, Job.class); - String location = String.format("/workdir/ui/%s/", UUID.randomUUID()); + String location = String.format("%s/%s/%s/", + jobProperties.getData().getDirectories().getBase(), + jobProperties.getData().getDirectories().getInputRelativePath(), + UUID.randomUUID() + ); Files.createDirectories(Paths.get(location)); String filepath = location + file.getOriginalFilename(); File f = new File(filepath); @@ -65,11 +70,10 @@ public ResponseEntity addJobWithFile(@RequestParam(name = "job") String fileArgument.setValue(List.of(filepath)); job.getJobArguments().add(fileArgument); JobInfo info = jobService.add(job, authentication); -// Files.createDirectories(Paths.get(String.format("/workdir/%s/%s", job.getServiceArguments().getProcessId(), info.getCreatedAt()))); return new ResponseEntity<>(info, HttpStatus.OK); } - @RequestMapping(path = "/{jobId}/output/download", method = RequestMethod.GET) + @GetMapping(path = "/{jobId}/output/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) public ResponseEntity download(@PathVariable("jobId") String id, @RequestParam String process, @RequestParam String filename, @@ -78,7 +82,13 @@ public ResponseEntity download(@PathVariable("jobId") String id, ResponseEntity responseEntity = ResponseEntity.notFound().build(); if (info != null) { try { - File file = new File(String.format("/workdir/%s/%s/output/%s", process, id, filename)); + File file = new File(String.format("%s/%s/%s/%s/%s", + jobProperties.getData().getDirectories().getBase(), + process, + id, + jobProperties.getData().getDirectories().getOutputRelativePath(), + filename) + ); Path path = Paths.get(file.getAbsolutePath()); ByteArrayResource resource = new ByteArrayResource(Files.readAllBytes(path)); @@ -87,7 +97,6 @@ public ResponseEntity download(@PathVariable("jobId") String id, responseEntity = ResponseEntity.ok() .headers(headers) .contentLength(file.length()) - .contentType(MediaType.APPLICATION_OCTET_STREAM) .body(resource); } catch (Exception e) { logger.warn("Could not find file : {}", e.getMessage()); diff --git a/src/main/java/eu/intelcomp/catalogue/service/JobProperties.java b/src/main/java/eu/intelcomp/catalogue/service/JobProperties.java new file mode 100644 index 0000000..7e322d8 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/service/JobProperties.java @@ -0,0 +1,81 @@ +package eu.intelcomp.catalogue.service; + + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "jobs") +public class JobProperties { + + /** + * Job data properties. + */ + private Data data = new Data(); + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } + + public static class Data { + + /** + * Data directories. + */ + Directories directories = new Directories(); + + public Directories getDirectories() { + return directories; + } + + public void setDirectories(Directories directories) { + this.directories = directories; + } + } + + public static class Directories { + + /** + * Should contain the absolute path of the base directory. + */ + String base = "/workdir"; + + /** + * Should contain the relative path of the input directory. + */ + String inputRelativePath = "ui"; + + /** + * Should contain the relative path of the output directory. + */ + String outputRelativePath = "output"; + + public String getBase() { + return base; + } + + public void setBase(String base) { + this.base = base; + } + + public String getInputRelativePath() { + return inputRelativePath; + } + + public void setInputRelativePath(String inputRelativePath) { + this.inputRelativePath = inputRelativePath; + } + + public String getOutputRelativePath() { + return outputRelativePath; + } + + public void setOutputRelativePath(String outputRelativePath) { + this.outputRelativePath = outputRelativePath; + } + } +} From 2cf7af78e8c0630d8df70de234c60c14cc683444 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 6 Jul 2023 16:53:56 +0300 Subject: [PATCH 33/52] replaced ByteArrayResource with InputStreamResource --- .../catalogue/controller/JobController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index 0745463..c002bc7 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -13,7 +13,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.ByteArrayResource; +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.InputStreamResource; import org.springframework.core.io.Resource; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.core.io.buffer.DataBufferUtils; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -22,12 +26,14 @@ import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; -import java.io.File; -import java.io.IOException; +import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.util.List; import java.util.UUID; @@ -91,7 +97,7 @@ public ResponseEntity download(@PathVariable("jobId") String id, ); Path path = Paths.get(file.getAbsolutePath()); - ByteArrayResource resource = new ByteArrayResource(Files.readAllBytes(path)); + Resource resource = new InputStreamResource(new FileInputStream(path.toFile())); HttpHeaders headers = new HttpHeaders(); headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.cvs", id)); responseEntity = ResponseEntity.ok() From a1ffd21be971a7dba95044d341ff459d47148ea7 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 7 Jul 2023 12:20:08 +0300 Subject: [PATCH 34/52] removed unused classes --- .../catalogue/domain/ChapterAnswer.java | 48 ------------------- .../catalogue/domain/ModelAnswer.java | 48 ------------------- 2 files changed, 96 deletions(-) delete mode 100644 src/main/java/eu/intelcomp/catalogue/domain/ChapterAnswer.java delete mode 100644 src/main/java/eu/intelcomp/catalogue/domain/ModelAnswer.java diff --git a/src/main/java/eu/intelcomp/catalogue/domain/ChapterAnswer.java b/src/main/java/eu/intelcomp/catalogue/domain/ChapterAnswer.java deleted file mode 100644 index 2774341..0000000 --- a/src/main/java/eu/intelcomp/catalogue/domain/ChapterAnswer.java +++ /dev/null @@ -1,48 +0,0 @@ -package eu.intelcomp.catalogue.domain; - -import org.json.simple.JSONObject; - -public class ChapterAnswer { - - private String chapterId; - private JSONObject answer; - - public ChapterAnswer() { - answer = new JSONObject(); - } - - public ChapterAnswer(String id, JSONObject answer) { - this.answer = answer; - } - - public ChapterAnswer(String chapterAnswerId, String chapterId) { - this.answer = new JSONObject(); - this.setId(chapterAnswerId); - this.chapterId = chapterId; - } - - public String getId() { - return answer.get("id").toString(); - } - - public void setId(String id) { - this.answer.put("id", id); - } - - public String getChapterId() { - return chapterId; - } - - public void setChapterId(String chapterId) { - this.chapterId = chapterId; - } - - public JSONObject getAnswer() { - return answer; - } - - public void setAnswer(JSONObject answer) { - this.answer = answer; - } -} - diff --git a/src/main/java/eu/intelcomp/catalogue/domain/ModelAnswer.java b/src/main/java/eu/intelcomp/catalogue/domain/ModelAnswer.java deleted file mode 100644 index 1f977f4..0000000 --- a/src/main/java/eu/intelcomp/catalogue/domain/ModelAnswer.java +++ /dev/null @@ -1,48 +0,0 @@ -package eu.intelcomp.catalogue.domain; - -import org.json.simple.JSONObject; - -import java.util.Map; -import java.util.TreeMap; - -public class ModelAnswer { - - private String id; - private String modelId; - private Map chapterAnswers; - - public ModelAnswer() { - this.chapterAnswers = new TreeMap<>(); - } - - public ModelAnswer(JSONObject answer) { - this.chapterAnswers = new TreeMap<>(); - String answerId = answer.get("id").toString(); - this.id = answerId; - this.chapterAnswers.put(answerId, new ChapterAnswer(answerId, answer)); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getModelId() { - return modelId; - } - - public void setModelId(String modelId) { - this.modelId = modelId; - } - - public Map getChapterAnswers() { - return chapterAnswers; - } - - public void setChapterAnswers(Map chapterAnswers) { - this.chapterAnswers = chapterAnswers; - } -} From 650edff683df70a9f032d52884f1d1c787b6c18e Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 7 Jul 2023 15:11:44 +0300 Subject: [PATCH 35/52] added redis session dependencies --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 55591a1..aed565a 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,16 @@ spring-boot-starter-oauth2-resource-server + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.session + spring-session-data-redis + + eu.openminted registry-core-api From eb05968e0a9b1afad0589b10b4ca8f722f5f9169 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 7 Jul 2023 15:49:47 +0300 Subject: [PATCH 36/52] excluded registry GenericController advice --- .../eu/intelcomp/catalogue/config/IntelcompConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java b/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java index 5c28ca7..5b77c3d 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java +++ b/src/main/java/eu/intelcomp/catalogue/config/IntelcompConfiguration.java @@ -3,9 +3,10 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; @Configuration @EnableConfigurationProperties(IntelcompProperties.class) -@ComponentScan(value = {"eu.openminted.registry.core"}) +@ComponentScan(value = {"eu.openminted.registry.core"}, excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = eu.openminted.registry.core.controllers.GenericController.class)}) public class IntelcompConfiguration { } From 557d71b05f1d9e2fe86efd5b3f886eb27b03dbcd Mon Sep 17 00:00:00 2001 From: Antonis Lempesis Date: Mon, 10 Jul 2023 14:31:17 +0300 Subject: [PATCH 37/52] fixed the suffix of the downloaded files to csv --- .../java/eu/intelcomp/catalogue/controller/JobController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index c002bc7..93d3a60 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -99,7 +99,7 @@ public ResponseEntity download(@PathVariable("jobId") String id, Resource resource = new InputStreamResource(new FileInputStream(path.toFile())); HttpHeaders headers = new HttpHeaders(); - headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.cvs", id)); + headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.csv", id)); responseEntity = ResponseEntity.ok() .headers(headers) .contentLength(file.length()) From f858e3b8472feded7329c1ab7485b7a6adbbbae8 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 18 Jul 2023 15:49:08 +0300 Subject: [PATCH 38/52] fixed typo --- .../java/eu/intelcomp/catalogue/controller/JobController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java index c002bc7..93d3a60 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/JobController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/JobController.java @@ -99,7 +99,7 @@ public ResponseEntity download(@PathVariable("jobId") String id, Resource resource = new InputStreamResource(new FileInputStream(path.toFile())); HttpHeaders headers = new HttpHeaders(); - headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.cvs", id)); + headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s_output.csv", id)); responseEntity = ResponseEntity.ok() .headers(headers) .contentLength(file.length()) From 193f8cfc7afb2c3cfdc7a08cdfbc085dc8d2dc7c Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 24 Jul 2023 16:36:02 +0300 Subject: [PATCH 39/52] added dataset file location --- src/main/java/eu/intelcomp/catalogue/domain/Dataset.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java b/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java index c47b7f8..a5c7dee 100644 --- a/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java +++ b/src/main/java/eu/intelcomp/catalogue/domain/Dataset.java @@ -11,6 +11,7 @@ public class Dataset { private String description; private List usages; private String owner; + private String fileLocation; private Date creationDate; private String createdBy; private Date modificationDate; @@ -59,6 +60,14 @@ public void setOwner(String owner) { this.owner = owner; } + public String getFileLocation() { + return fileLocation; + } + + public void setFileLocation(String fileLocation) { + this.fileLocation = fileLocation; + } + public Date getCreationDate() { return creationDate; } From 04a8b9ed6e919e563442cb9f7e51f3661dd8c158 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 24 Jul 2023 16:39:10 +0300 Subject: [PATCH 40/52] Added CRUD functionality for datasets --- .../controller/WorkflowDatasetController.java | 129 ++++++++++++++++++ .../catalogue/service/DatasetService.java | 19 +++ .../catalogue/service/FileService.java | 14 ++ .../service/FileSystemFileService.java | 56 ++++++++ .../service/WorkflowDatasetService.java | 81 +++++++++++ src/main/resources/resourceTypes/dataset.json | 68 +++++++++ 6 files changed, 367 insertions(+) create mode 100644 src/main/java/eu/intelcomp/catalogue/controller/WorkflowDatasetController.java create mode 100644 src/main/java/eu/intelcomp/catalogue/service/DatasetService.java create mode 100644 src/main/java/eu/intelcomp/catalogue/service/FileService.java create mode 100644 src/main/java/eu/intelcomp/catalogue/service/FileSystemFileService.java create mode 100644 src/main/java/eu/intelcomp/catalogue/service/WorkflowDatasetService.java create mode 100644 src/main/resources/resourceTypes/dataset.json diff --git a/src/main/java/eu/intelcomp/catalogue/controller/WorkflowDatasetController.java b/src/main/java/eu/intelcomp/catalogue/controller/WorkflowDatasetController.java new file mode 100644 index 0000000..546ff72 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/controller/WorkflowDatasetController.java @@ -0,0 +1,129 @@ +package eu.intelcomp.catalogue.controller; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import eu.intelcomp.catalogue.domain.Dataset; +import eu.intelcomp.catalogue.domain.User; +import eu.intelcomp.catalogue.service.DatasetService; +import eu.intelcomp.catalogue.service.FileService; +import eu.intelcomp.catalogue.service.JobProperties; +import eu.openminted.registry.core.domain.FacetFilter; +import eu.openminted.registry.core.domain.Paging; +import gr.athenarc.catalogue.annotations.Browse; +import io.swagger.v3.oas.annotations.Parameter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.Resource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.Map; +import java.util.UUID; + +import static gr.athenarc.catalogue.utils.PagingUtils.createFacetFilter; + +@RestController +@RequestMapping("workflow-datasets") +public class WorkflowDatasetController { + + private static final Logger logger = LoggerFactory.getLogger(WorkflowDatasetController.class); + + private final DatasetService datasetService; + private final FileService fileService; + private final JobProperties jobProperties; + private final ObjectMapper mapper = new ObjectMapper(); + + public WorkflowDatasetController(DatasetService datasetService, + FileService fileService, + JobProperties jobProperties) { + this.datasetService = datasetService; + this.fileService = fileService; + this.jobProperties = jobProperties; + } + + @GetMapping("{datasetId}") + @PreAuthorize("isAuthenticated() and not anonymous") + public ResponseEntity get(@PathVariable("datasetId") String id) { + return ResponseEntity.ok(datasetService.get(id)); + } + + @GetMapping("{datasetId}/file") + @PreAuthorize("isAuthenticated() and not anonymous") + public ResponseEntity getFile(@PathVariable("datasetId") String id) { + Dataset dataset = datasetService.get(id); + File file = new File(dataset.getFileLocation()); + Resource resource = fileService.get(dataset.getFileLocation()); + + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s", file.getName())); + + return ResponseEntity.ok() + .headers(headers) + .contentLength(file.length()) + .body(resource); + } + + @Browse + @GetMapping + @PreAuthorize("isAuthenticated()") + public ResponseEntity> browse(@Parameter(hidden = true) @RequestParam Map allRequestParams) { + FacetFilter ff = createFacetFilter(allRequestParams); + ff.addFilter("owner", User.getId(SecurityContextHolder.getContext().getAuthentication())); + return ResponseEntity.ok(datasetService.browse(ff)); + } + + @PostMapping() + @PreAuthorize("isAuthenticated() and not anonymous") + public ResponseEntity add(@RequestParam(name = "dataset") String dataset, @RequestPart MultipartFile file, @Parameter(hidden = true) Authentication authentication) throws JsonProcessingException { + // save + Dataset datasetObj = mapper.readValue(dataset, Dataset.class); + String id = UUID.randomUUID().toString(); + logger.info("created dataset id: {}", id); + datasetObj.setFileLocation(createFileLocation(id, file)); + Dataset saved = datasetService.add(id, datasetObj); + fileService.save(file, saved.getFileLocation()); + return ResponseEntity.ok(saved); + } + + @PutMapping("{datasetId}") + @PreAuthorize("isAuthenticated()") + public ResponseEntity update(@PathVariable("datasetId") String id, @RequestParam(name = "dataset") String dataset, @RequestPart MultipartFile file) throws JsonProcessingException { + Dataset datasetObj = mapper.readValue(dataset, Dataset.class); + if (file != null) { + fileService.delete(datasetObj.getFileLocation()); + datasetObj.setFileLocation(createFileLocation(id, file)); + fileService.save(file, datasetObj.getFileLocation()); + } + return ResponseEntity.ok(datasetService.update(id, datasetObj)); + } + + @DeleteMapping("{datasetId}") + @PreAuthorize("isAuthenticated()") + public ResponseEntity delete(@PathVariable("datasetId") String id) { + Dataset dataset = datasetService.get(id); + datasetService.delete(id); + fileService.delete(dataset.getFileLocation()); + + return ResponseEntity.ok().build(); + } + + private String createFileLocation(String datasetId, MultipartFile file) { + String location = null; + if (file != null && datasetId != null) { + location = String.format("%s/%s/%s/%s", + jobProperties.getData().getDirectories().getBase(), + jobProperties.getData().getDirectories().getInputRelativePath(), + datasetId, + file.getOriginalFilename() + ); + } + return location; + } + +} diff --git a/src/main/java/eu/intelcomp/catalogue/service/DatasetService.java b/src/main/java/eu/intelcomp/catalogue/service/DatasetService.java new file mode 100644 index 0000000..c98cdd5 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/service/DatasetService.java @@ -0,0 +1,19 @@ +package eu.intelcomp.catalogue.service; + +import eu.intelcomp.catalogue.domain.Dataset; +import eu.openminted.registry.core.domain.FacetFilter; +import eu.openminted.registry.core.domain.Paging; + +public interface DatasetService { + + Dataset get(String id); + + Paging browse(FacetFilter filter); + + Dataset add(String id, Dataset dataset); + + Dataset update(String id, Dataset dataset); + + void delete(String id); + +} diff --git a/src/main/java/eu/intelcomp/catalogue/service/FileService.java b/src/main/java/eu/intelcomp/catalogue/service/FileService.java new file mode 100644 index 0000000..01e9850 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/service/FileService.java @@ -0,0 +1,14 @@ +package eu.intelcomp.catalogue.service; + +import org.springframework.core.io.Resource; +import org.springframework.web.multipart.MultipartFile; + +public interface FileService { + + Resource get(String filepath); + + void save(MultipartFile file, String filepath); + + void delete(String filepath); + +} diff --git a/src/main/java/eu/intelcomp/catalogue/service/FileSystemFileService.java b/src/main/java/eu/intelcomp/catalogue/service/FileSystemFileService.java new file mode 100644 index 0000000..18a1ae1 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/service/FileSystemFileService.java @@ -0,0 +1,56 @@ +package eu.intelcomp.catalogue.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.InputStreamResource; +import org.springframework.core.io.Resource; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Objects; + +@Service +public class FileSystemFileService implements FileService { + + private static final Logger logger = LoggerFactory.getLogger(FileSystemFileService.class); + + @Override + public Resource get(String filepath) { + Path path = Paths.get(filepath); + Resource resource = null; + try { + resource = new InputStreamResource(new FileInputStream(path.toFile())); + } catch (FileNotFoundException e) { + logger.error("Could not find file: {}", filepath); + } + return resource; + } + + @Override + public void save(MultipartFile file, String filepath) { + try { + String dir = filepath.substring(0, filepath.length() - Objects.requireNonNull(file.getOriginalFilename()).length()); + Files.createDirectory(Paths.get(dir)); + File f = new File(filepath); + file.transferTo(f); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void delete(String filepath) { + try { + Files.deleteIfExists(Paths.get(filepath)); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/eu/intelcomp/catalogue/service/WorkflowDatasetService.java b/src/main/java/eu/intelcomp/catalogue/service/WorkflowDatasetService.java new file mode 100644 index 0000000..1e4c3f9 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/service/WorkflowDatasetService.java @@ -0,0 +1,81 @@ +package eu.intelcomp.catalogue.service; + +import eu.intelcomp.catalogue.controller.WorkflowDatasetController; +import eu.intelcomp.catalogue.domain.Dataset; +import eu.intelcomp.catalogue.domain.User; +import eu.openminted.registry.core.domain.FacetFilter; +import eu.openminted.registry.core.domain.Paging; +import gr.athenarc.catalogue.service.GenericItemService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; + +import java.lang.reflect.InvocationTargetException; +import java.util.Date; + +@Service +public class WorkflowDatasetService implements DatasetService { + + private static final Logger logger = LoggerFactory.getLogger(WorkflowDatasetController.class); + private static final String RESOURCE_TYPE = "dataset"; + private final GenericItemService genericItemService; + + public WorkflowDatasetService(GenericItemService genericItemService) { + this.genericItemService = genericItemService; + } + + @Override + public Dataset get(String id) { + return this.genericItemService.get(RESOURCE_TYPE, id); + } + + @Override + public Paging browse(FacetFilter filter) { + filter.setResourceType(RESOURCE_TYPE); + return this.genericItemService.getResults(filter); + } + + @Override + public Dataset add(String id, Dataset dataset) { + Date now = new Date(); + String userId = User.getId(SecurityContextHolder.getContext().getAuthentication()); + + dataset.setId(id); + dataset.setOwner(userId); + + dataset.setCreationDate(now); + dataset.setCreatedBy(userId); + + dataset.setModificationDate(now); + dataset.setModifiedBy(userId); + + return genericItemService.add(RESOURCE_TYPE, dataset); + } + + @Override + public Dataset update(String id, Dataset dataset) { + Dataset existing = get(id); + + dataset.setCreatedBy(existing.getCreatedBy()); + dataset.setCreationDate(existing.getCreationDate()); + + Date now = new Date(); + String userId = User.getId(SecurityContextHolder.getContext().getAuthentication()); + dataset.setModificationDate(now); + dataset.setModifiedBy(userId); + + try { + return genericItemService.update(RESOURCE_TYPE, id, dataset); + } catch (NoSuchFieldException | InvocationTargetException | NoSuchMethodException e) { + logger.error("Could not update dataset : {}", e.getMessage(), e); + } + return null; + } + + @Override + public void delete(String id) { + genericItemService.delete(RESOURCE_TYPE, id); + } + +} diff --git a/src/main/resources/resourceTypes/dataset.json b/src/main/resources/resourceTypes/dataset.json new file mode 100644 index 0000000..48ce2bd --- /dev/null +++ b/src/main/resources/resourceTypes/dataset.json @@ -0,0 +1,68 @@ +{ + "indexFields": [ + { + "multivalued": false, + "name": "resource_internal_id", + "path": "$.id", + "type": "java.lang.String", + "primaryKey": true + }, + { + "multivalued": false, + "name": "name", + "label": "Dataset Name", + "path": "$.name", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "owner", + "label": "Owner", + "path": "$.owner", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "createdBy", + "label": "Created By", + "path": "$.createdBy", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "creationDate", + "label": "Creation Date", + "path": "$.creationDate", + "type": "java.util.Date" + }, + { + "multivalued": false, + "name": "modifiedBy", + "label": "Modified By", + "path": "$.modifiedBy", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "modificationDate", + "label": "Modification Date", + "path": "$.modificationDate", + "type": "java.util.Date" + }, + { + "multivalued": true, + "name": "usages", + "label": "Usages", + "path": "$.usages", + "type": "java.lang.String" + } + ], + "indexMapperClass": "eu.openminted.registry.core.index.DefaultIndexMapper", + "name": "dataset", + "aliasGroup": "resourceTypes", + "payloadType": "json", + "properties": { + "class": "eu.intelcomp.catalogue.domain.Dataset" + }, + "schema": "{\n\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\"\n}" +} \ No newline at end of file From 96fe25411c2f1c0ee3fd40c4fe4e523ecffc8531 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 19 Sep 2023 11:41:11 +0300 Subject: [PATCH 41/52] added security using aspect --- .../catalogue/aspects/SecurityAspect.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java diff --git a/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java b/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java new file mode 100644 index 0000000..76dbd70 --- /dev/null +++ b/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java @@ -0,0 +1,72 @@ +package eu.intelcomp.catalogue.aspects; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; + +import java.util.Arrays; + +@Aspect +@Component +public class SecurityAspect { + + private static final Logger logger = LoggerFactory.getLogger(SecurityAspect.class); + + public SecurityAspect() { + } + + @Before(value = "execution(* gr.athenarc.catalogue.controller.GenericItemController.create(..)) ||" + + "execution(* gr.athenarc.catalogue.controller.GenericItemController.update(..)) ||" + + "execution(* gr.athenarc.catalogue.controller.GenericItemController.delete(..))") + void authorize(JoinPoint joinPoint) { + String resourceType = (String) joinPoint.getArgs()[0]; + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + boolean authorized = false; + if (authentication.getAuthorities().contains(new SimpleGrantedAuthority("ADMIN"))) { + return; + } + switch (resourceType) { + case "tool": + authorized = authorizeAiTool(authentication); + break; + case "ai_model": + authorized = authorizeAiModel(authentication); + break; + case "dataset_type": + authorized = authorizeDatasetType(authentication); + break; + case "dataset_instance": + authorized = authorizeDatasetInstance(authentication); + break; + default: + authorized = authentication.getAuthorities().contains(new SimpleGrantedAuthority("ADMIN")); + } + if (!authorized) { + throw new AccessDeniedException("Forbidden"); + } + } + + boolean authorizeDatasetType(Authentication authentication) { + SimpleGrantedAuthority[] authorities = {new SimpleGrantedAuthority("OPERATOR_DATASET-INGESTOR")}; + return Arrays.stream(authorities).anyMatch(authority -> authentication.getAuthorities().contains(authority)); + } + + boolean authorizeDatasetInstance(Authentication authentication) { + return authentication.getAuthorities().contains(new SimpleGrantedAuthority("OPERATOR_DATASET-INGESTOR")); + } + + boolean authorizeAiTool(Authentication authentication) { + return authentication.getAuthorities().contains(new SimpleGrantedAuthority("OPERATOR_DEVELOPER")); + } + + boolean authorizeAiModel(Authentication authentication) { + return authentication.getAuthorities().contains(new SimpleGrantedAuthority("OPERATOR_DEVELOPER")); + } +} From 61d29bf32c58d2240186d981e58823535959bfd4 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 19 Sep 2023 18:16:54 +0300 Subject: [PATCH 42/52] fixed getting resourceType argument correctly from methods --- .../catalogue/aspects/SecurityAspect.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java b/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java index 76dbd70..759bc3c 100644 --- a/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java +++ b/src/main/java/eu/intelcomp/catalogue/aspects/SecurityAspect.java @@ -22,11 +22,19 @@ public class SecurityAspect { public SecurityAspect() { } - @Before(value = "execution(* gr.athenarc.catalogue.controller.GenericItemController.create(..)) ||" + - "execution(* gr.athenarc.catalogue.controller.GenericItemController.update(..)) ||" + - "execution(* gr.athenarc.catalogue.controller.GenericItemController.delete(..))") - void authorize(JoinPoint joinPoint) { - String resourceType = (String) joinPoint.getArgs()[0]; + @Before(value = "execution(* gr.athenarc.catalogue.controller.GenericItemController.create(String,..)) && args(resourceType)", argNames = "resourceType") + void beforeCreate(String resourceType) { + authorize(resourceType); + } + + @Before(value = "(execution(* gr.athenarc.catalogue.controller.GenericItemController.update(String, String, ..)) ||" + + "execution(* gr.athenarc.catalogue.controller.GenericItemController.delete(String, String, ..))) " + + "&& args(id, resourceType,..)", argNames = "id,resourceType") + void beforeUpdate_Delete(String id, String resourceType) { + authorize(resourceType); + } + + void authorize(String resourceType) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); boolean authorized = false; if (authentication.getAuthorities().contains(new SimpleGrantedAuthority("ADMIN"))) { From ed4ab6384d9857305a83870f5a24d4dca4208937 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 19 Sep 2023 18:17:28 +0300 Subject: [PATCH 43/52] updated registry-core version and catalogue version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index aed565a..cfde1ba 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Intelcomp Catalogue Project 11 - 2.5.2 + 2.6.0 @@ -97,7 +97,7 @@ gr.athenarc catalogue - 5.0.0-SNAPSHOT + 5.0.1-SNAPSHOT From 5a3102fa7be82dbb4cd60169aa4ffdd0276d75b2 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 22 Sep 2023 16:51:19 +0300 Subject: [PATCH 44/52] added method retrieving user authentication tokens and removed token from cookie --- .../catalogue/config/AuthSuccessHandler.java | 22 +----------------- .../catalogue/config/SecurityConfig.java | 23 ++++++++++++++----- .../catalogue/controller/UserController.java | 15 ++++++++++-- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java index d6aff0c..6886150 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java +++ b/src/main/java/eu/intelcomp/catalogue/config/AuthSuccessHandler.java @@ -5,7 +5,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; -import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; @@ -15,8 +14,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.time.Instant; -import java.util.Date; @Component public class AuthSuccessHandler implements AuthenticationSuccessHandler { @@ -38,30 +35,13 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { - Cookie cookie = new Cookie("AccessToken", ((OidcUser) authentication.getPrincipal()).getIdToken().getTokenValue()); - cookie.setMaxAge(createCookieMaxAge(authentication)); + Cookie cookie = new Cookie("AccessToken", "deprecated"); cookie.setPath("/"); -// cookie.setSecure(true); logger.debug("Assigning Cookie: {}", objectMapper.writeValueAsString(cookie)); response.addCookie(cookie); logger.debug("Authentication Successful - Redirecting to: {}", intelcompProperties.getLoginRedirect()); response.sendRedirect(intelcompProperties.getLoginRedirect()); } - - private int createCookieMaxAge(Authentication authentication) { - Integer age = getExp(authentication); - return age != null ? age : 3600; - } - - private Integer getExp(Authentication authentication) { - OidcUser user = ((OidcUser) authentication.getPrincipal()); - if (user.getAttribute("exp") instanceof Instant) { - Instant exp = user.getAttribute("exp"); - int age = (int) (exp.getEpochSecond() - (new Date().getTime() / 1000)); - return age; - } - return null; - } } diff --git a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java index eead6d7..442d71c 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java +++ b/src/main/java/eu/intelcomp/catalogue/config/SecurityConfig.java @@ -3,20 +3,21 @@ import com.nimbusds.jose.shaded.json.JSONArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper; +import org.springframework.security.oauth2.client.web.HttpSessionOAuth2AuthorizedClientRepository; +import org.springframework.security.oauth2.client.web.OAuth2AuthorizedClientRepository; import org.springframework.security.oauth2.core.oidc.OidcIdToken; import org.springframework.security.oauth2.core.oidc.OidcUserInfo; import org.springframework.security.oauth2.core.oidc.user.OidcUserAuthority; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.security.oauth2.core.user.OAuth2UserAuthority; +import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import java.util.HashSet; @@ -25,7 +26,7 @@ @Configuration @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) -public class SecurityConfig extends WebSecurityConfigurerAdapter { +public class SecurityConfig { private static final Logger logger = LoggerFactory.getLogger(SecurityConfig.class); @@ -33,7 +34,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { private final CompleteLogoutSuccessHandler logoutSuccessHandler; private final IntelcompProperties intelcompProperties; - @Autowired public SecurityConfig(AuthenticationSuccessHandler authSuccessHandler, CompleteLogoutSuccessHandler logoutSuccessHandler, IntelcompProperties intelcompProperties) { @@ -42,14 +42,24 @@ public SecurityConfig(AuthenticationSuccessHandler authSuccessHandler, this.intelcompProperties = intelcompProperties; } - @Override - protected void configure(HttpSecurity http) throws Exception { + /* + * Needed to save client repository in redis session. + */ + @Bean + public OAuth2AuthorizedClientRepository authorizedClientRepository() { + return new HttpSessionOAuth2AuthorizedClientRepository(); + } + + @Bean + public SecurityFilterChain clientFilterChain(HttpSecurity http) throws Exception { http .authorizeRequests(authorizeRequests -> authorizeRequests // .regexMatchers("/dump/.*", "/restore/", "/resources.*", "/resourceType.*", "/search.*", "/logs.*").hasAnyAuthority("ADMIN") // .antMatchers(HttpMethod.GET, "/forms/**").permitAll() // .antMatchers( "/forms/**").hasAnyAuthority("ADMIN") .anyRequest().permitAll()) + .oauth2Client() + .and() .oauth2Login() .successHandler(authSuccessHandler) .and() @@ -60,6 +70,7 @@ protected void configure(HttpSecurity http) throws Exception { .cors() .and() .csrf().disable(); + return http.build(); } @Bean diff --git a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java index 8d32620..231f68c 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/UserController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/UserController.java @@ -3,11 +3,15 @@ import eu.intelcomp.catalogue.domain.User; import io.swagger.v3.oas.annotations.Hidden; import io.swagger.v3.oas.annotations.Parameter; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.Authentication; import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient; +import org.springframework.security.oauth2.core.OAuth2AccessToken; import org.springframework.security.oauth2.core.oidc.user.OidcUser; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.web.bind.annotation.GetMapping; @@ -15,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -@RequestMapping("user") +@RequestMapping(value = "user", produces = MediaType.APPLICATION_JSON_VALUE) public class UserController { public UserController() { @@ -26,6 +30,13 @@ public ResponseEntity getInfo(@Parameter(hidden = true) Authentication aut return new ResponseEntity<>(User.of(authentication), HttpStatus.OK); } + @PreAuthorize("isFullyAuthenticated()") + @GetMapping("token") + public OAuth2AccessToken getAccessToken(@RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient authorizedClient) { + OAuth2AccessToken accessToken = authorizedClient.getAccessToken(); + return accessToken; + } + @Hidden @GetMapping("auth/oidc-principal") public OidcUser getOidcUserPrincipal(@AuthenticationPrincipal OidcUser principal) { From 01c4034ef5f9175da53324edb63cabc00bc4b8ab Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 22 Sep 2023 16:59:42 +0300 Subject: [PATCH 45/52] changed JobArgument value from List to Object --- .../eu/intelcomp/catalogue/domain/Job.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/domain/Job.java b/src/main/java/eu/intelcomp/catalogue/domain/Job.java index 448e673..b6193b8 100644 --- a/src/main/java/eu/intelcomp/catalogue/domain/Job.java +++ b/src/main/java/eu/intelcomp/catalogue/domain/Job.java @@ -52,7 +52,7 @@ public void setJobArguments(List jobArguments) { this.jobArguments = jobArguments; } - public class ServiceArguments { + public static class ServiceArguments { private String processId; private String user; private String infraId = "k8s"; @@ -98,16 +98,15 @@ public void setInfraId(String infraId) { public static class JobArgument { private String name; -// private String value; - private List value = new ArrayList<>(); + private Object value; public JobArgument() { } -// public JobArgument(String name, String value) { -// this.name = name; -// this.value = value; -// } + public JobArgument(String name, String value) { + this.name = name; + this.value = value; + } public JobArgument(String name, List value) { this.name = name; @@ -122,19 +121,11 @@ public void setName(String name) { this.name = name; } -// public String getValue() { -// return value; -// } -// -// public void setValue(String value) { -// this.value = value; -// } - - public List getValue() { + public Object getValue() { return value; } - public void setValue(List value) { + public void setValue(Object value) { this.value = value; } } From 334a13c71befda5564161ac1278fe9d63720fc1f Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 22 Sep 2023 17:03:07 +0300 Subject: [PATCH 46/52] refactoring --- .../intelcomp/catalogue/config/logging/LogUser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/intelcomp/catalogue/config/logging/LogUser.java b/src/main/java/eu/intelcomp/catalogue/config/logging/LogUser.java index 94c97c8..305352a 100644 --- a/src/main/java/eu/intelcomp/catalogue/config/logging/LogUser.java +++ b/src/main/java/eu/intelcomp/catalogue/config/logging/LogUser.java @@ -1,6 +1,5 @@ package eu.intelcomp.catalogue.config.logging; -import eu.intelcomp.catalogue.domain.User; import gr.athenarc.catalogue.config.logging.AbstractLogContextFilter; import org.slf4j.spi.MDCAdapter; import org.springframework.security.authentication.InsufficientAuthenticationException; @@ -13,17 +12,19 @@ @Component public class LogUser extends AbstractLogContextFilter { + public static final String TRANSACTION_ID = "transaction_id"; + public static final String USER_INFO = "user_info"; + @Override public void editMDC(MDCAdapter mdc) { String transactionId = UUID.randomUUID().toString(); - mdc.put("transaction_id", transactionId); + mdc.put(TRANSACTION_ID, transactionId); Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { try { - User user = User.of(authentication); - mdc.put("user_info", user.toString()); + mdc.put(USER_INFO, authentication.toString()); } catch (InsufficientAuthenticationException e) { - mdc.put("user_info", authentication.toString()); + mdc.put(USER_INFO, authentication.toString()); } } } From d10988849a84bf703a4ac58fc3a495d2c42b88ef Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 25 Sep 2023 15:30:51 +0300 Subject: [PATCH 47/52] expanded resourceType options --- src/main/resources/schema/imports.xsd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/resources/schema/imports.xsd b/src/main/resources/schema/imports.xsd index 2cb6ca1..8f97a1d 100644 --- a/src/main/resources/schema/imports.xsd +++ b/src/main/resources/schema/imports.xsd @@ -130,8 +130,20 @@ The general type of a resource. + + + + + + + + + + + + From d535c17d8fdb63420109ea7f53dae4b40552babf Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Thu, 4 Apr 2024 17:33:56 +0300 Subject: [PATCH 48/52] updated Dockerfile --- Dockerfile | 16 ++++++++++++++-- pom.xml | 12 ++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d11797a..12f26b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,17 @@ +### Build using Maven ### +FROM maven:3.8-jdk-11-slim AS maven + +COPY pom.xml /tmp/ +COPY . /tmp/ + +WORKDIR /tmp/ + +## run maven package ## +RUN mvn package -U -DskipTests + + FROM openjdk:11 -ARG JAR_FILE=target/*.jar -COPY ${JAR_FILE} intelcomp-catalogue.jar + +COPY --from=maven /tmp/target/*.jar /intelcomp-catalogue.jar ENTRYPOINT ["java","-jar","/intelcomp-catalogue.jar"] diff --git a/pom.xml b/pom.xml index cfde1ba..c19d9de 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Intelcomp Catalogue Project 11 - 2.6.0 + 2.7.3 @@ -97,7 +97,7 @@ gr.athenarc catalogue - 5.0.1-SNAPSHOT + 5.0.1 @@ -111,9 +111,9 @@ - omtd-snapshots + madgik-snapshots default - https://repo.openminted.eu/content/repositories/snapshots/ + https://repo.madgik.di.uoa.gr/content/repositories/snapshots/ false @@ -122,9 +122,9 @@ - omtd-releases + madgik-releases default - https://repo.openminted.eu/content/repositories/releases + https://repo.madgik.di.uoa.gr/content/repositories/releases true From 73931129d9a96391de96e9e3e340ca6d419e4651 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 29 Apr 2024 17:03:00 +0300 Subject: [PATCH 49/52] added default properties file and example application.properties file --- pom.xml | 6 +- src/main/resources/application.properties | 64 ++++++++++ src/main/resources/application.yml | 139 ++++++++++++---------- src/main/resources/registry.properties | 29 ----- 4 files changed, 147 insertions(+), 91 deletions(-) create mode 100644 src/main/resources/application.properties delete mode 100644 src/main/resources/registry.properties diff --git a/pom.xml b/pom.xml index c19d9de..567e65c 100644 --- a/pom.xml +++ b/pom.xml @@ -218,9 +218,11 @@ src/main/resources true + + **/application.yml + - **/application.yml - **/registry.properties + **/application.properties diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..b307769 --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,64 @@ +fqdn=localhost +server.port=8180 +server.servlet.contextPath=/api + + +## Spring OAuth2 ## +# Google +#spring.security.oauth2.client.registration.google.client-id= +#spring.security.oauth2.client.registration.google.client-secret= +# Custom +spring.security.oauth2.client.registration.custom.client-id= +spring.security.oauth2.client.registration.custom.client-secret= +spring.security.oauth2.client.registration.custom.client-name= +spring.security.oauth2.client.registration.custom.authorization-grant-type=authorization_code +spring.security.oauth2.client.registration.custom.scope=openid,email,profile +spring.security.oauth2.client.provider.custom.issuer-uri= + + +## Catalogue Lib ## +#catalogue-lib.jaxb.generated-classes-package-name=eu.intelcomp.xsd2java +catalogue-lib.validation.enabled=true + + +## Intelcomp Properties ## +intelcomp.admins=admin@email.com, ... +intelcomp.frontBaseUrl=http://localhost:4200 +intelcomp.loginRedirect=${intelcomp.frontBaseUrl} +intelcomp.logoutRedirect=${intelcomp.frontBaseUrl} + +openapi.info.contact.email=contact@athenarc.gr +openapi.info.contact.name=Contact Name +openapi.info.description=[Description] +openapi.info.termsOfService=[Terms] +openapi.info.title=Data Catalogue API +openapi.info.version=2.0.0 + + +## Job Service (Optional) ## +job-service.api-url=http://localhost:19000 +job-service.authorization.client-id= +job-service.authorization.client-secret= +job-service.authorization.grant-type=client_credentials +job-service.authorization.url=https://[keycloak-enpoint]/auth/realms/[default]/protocol/openid-connect/token + + +## Redis ## +spring.redis.host=localhost +spring.redis.password= +spring.redis.port=6379 + + +## Registry Properties ## +registry.host=http://${fqdn}:${server.port}/${server.servlet.contextPath}/ + +jdbc.driverClassName=org.postgresql.Driver +jdbc.url=jdbc:postgresql://${fqdn}:5432/registry +jdbc.username= +jdbc.password= + +jms.host=tcp://${fqdn}:61616 +jms.prefix= + +elasticsearch.url=${fqdn} +elasticsearch.port=9200 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0baa02f..9294095 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,70 +1,89 @@ -springdoc: - swagger-ui: - version: 3 - disable-swagger-default-url: true +management: + endpoints: + web: + exposure: + include: openapi, swagger-ui spring: - main: - allow-circular-references: true - allow-bean-definition-overriding: true - flyway: -# enabled:false - locations: classpath:migrations - baseline-on-migrate: true - batch: - job: - enabled: false - jms: - cache: - enabled: false - - security: - oauth2: - client: - registration: - google: - client-id: - client-secret: + batch: + job: + enabled: false + flyway: +# enabled: false + baseline-on-migrate: true + locations: classpath:migrations + http: + multipart: + max-file-size: 18MB + max-request-size: 20MB + jms: + cache: + enabled: false + main: + allow-bean-definition-overriding: false - cite: - client-id: - client-secret: - scope: - - openid - - email - - profile + jackson: +# serialization: +# fail-on-empty-beans: false + jackson: + default-property-inclusion: always + deserialization: + fail-on-unknown-properties: false + mapper: + auto-detect-fields: true + visibility: + all: any - provider: - cite: - issuer-uri: +## Springdoc ## +openapi: + info: + license: + name: Apache License, Version 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0 - redis: - host: - port: - password: +springdoc: + group-configs[0]: + group: catalogue + display-name: Data Catalogue + packages-to-scan: + - eu.intelcomp + - gr.athenarc.catalogue.controller + group-configs[1]: + group: catalogue-lib + display-name: Catalogue Library + packages-to-scan: + - gr.athenarc.catalogue + group-configs[2]: + group: registry + display-name: Registry Core + packages-to-scan: + - eu.openminted -server: - port: 8080 - servlet: - contextPath: /intelcomp + swagger-ui: + doc-expansion: none + operations-sorter: method + path: /swagger-ui.html + syntax-highlight: + activated: false + theme: obsidian + tags-sorter: alpha + version: 3 +## Logging ## logging: - level: - org.springframework.security.: DEBUG - org.springframework.security.web.util.: INFO - org.springframework.web.client.RestTemplate: DEBUG - org.reflections.Reflections: WARN + level: + root: INFO -intelcomp: - frontBaseUrl: http://localhost:4200 - loginRedirect: ${intelcomp.frontBaseUrl} - logoutRedirect: ${intelcomp.frontBaseUrl} - admins: - - test@test.com +## Registry Properties ## +hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + show_sql: false + format_sql: false + hbm2ddl.auto: update -job-service: - authorization: - url: - grant-type: - client-id: - client-secret: +## Elastic Properties ## +elastic: + index.max_result_window: 10000 + aggregation: + topHitsSize: 100 + bucketSize: 100 diff --git a/src/main/resources/registry.properties b/src/main/resources/registry.properties deleted file mode 100644 index 9685e36..0000000 --- a/src/main/resources/registry.properties +++ /dev/null @@ -1,29 +0,0 @@ -## Spring Properties ## -############################################################# -spring.jms.cache.enabled=false - -#spring.flyway.enabled=false -spring.flyway.locations=classpath:migrations -spring.flyway.baseline-on-migrate=true - -spring.batch.job.enabled=false - -spring.jackson.default-property-inclusion=always - -## Elastic Properties ## -############################################################# -elastic.aggregation.topHitsSize=100 -elastic.aggregation.bucketSize=100 -elastic.index.max_result_window=10000 - -## Registry DB Properties ## -############################################################# -jdbc.driverClassName=org.postgresql.Driver -hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect -hibernate.show_sql=false -hibernate.format_sql=false -hibernate.hbm2ddl.auto=update - -## Registry Properties ## -############################################################# -registry.host= From 04791d66b1ab1f4003fa0aed440cf5682a000ed8 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Mon, 29 Apr 2024 21:44:17 +0300 Subject: [PATCH 50/52] added elasticsearch.version property override --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 567e65c..8e603ff 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ 11 2.7.3 + 7.17.14 From fe9c88d0981ace2992881ff8802996e609913a3b Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Fri, 21 Jun 2024 17:42:43 +0300 Subject: [PATCH 51/52] added model resourceType --- pom.xml | 1 + src/main/resources/resourceTypes/model.json | 116 ++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 src/main/resources/resourceTypes/model.json diff --git a/pom.xml b/pom.xml index 8e603ff..eea4cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -221,6 +221,7 @@ true **/application.yml + **/resourceTypes/ **/application.properties diff --git a/src/main/resources/resourceTypes/model.json b/src/main/resources/resourceTypes/model.json new file mode 100644 index 0000000..a8411be --- /dev/null +++ b/src/main/resources/resourceTypes/model.json @@ -0,0 +1,116 @@ +{ + "indexFields": [ + { + "multivalued": false, + "name": "resource_internal_id", + "path": "$.id", + "type": "java.lang.String", + "primaryKey": true + }, + { + "multivalued": false, + "name": "model_id", + "path": "$.id", + "type": "java.lang.String", + "primaryKey": true + }, + { + "multivalued": false, + "name": "name", + "path": "$.name", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "description", + "path": "$.description", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "resourceType", + "path": "$.resourceType", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "type", + "path": "$.type", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "subType", + "path": "$.subType", + "type": "java.lang.String" + }, + { + "multivalued": false, + "name": "creationDate", + "path": "$.creationDate", + "type": "java.util.Date" + }, + { + "multivalued": false, + "name": "modificationDate", + "path": "$.modificationDate", + "type": "java.util.Date" + }, + { + "multivalued": true, + "name": "allSectionIds", + "path": "$.sections[*]..subSections[*].id", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "allSectionNames", + "path": "$.sections[*]..subSections[*].name", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "sectionIds", + "path": "$.sections[*].id", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "sectionNames", + "path": "$.sections[*].name", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "subSectionsIds", + "path": "$.sections[*].subSections[*].id", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "subSectionsNames", + "path": "$.sections[*].subSections[*].name", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "fields", + "path": "$..fields[*].id", + "type": "java.lang.String" + }, + { + "multivalued": true, + "name": "fieldNames", + "path": "$..fields[*].name", + "type": "java.lang.String" + } + ], + "indexMapperClass": "eu.openminted.registry.core.index.DefaultIndexMapper", + "name": "model", + "aliasGroup": "resourceTypes", + "payloadType": "json", + "properties": { + "class": "gr.athenarc.catalogue.ui.domain.Model" + }, + "schema": "{\n\t\"$schema\": \"https://json-schema.org/draft/2019-09/schema\"\n}" +} From 38cf01d0d8488d8f74a8958a4c4cf1b82fed37a7 Mon Sep 17 00:00:00 2001 From: Konstantinos Spyrou Date: Tue, 25 Jun 2024 17:36:09 +0300 Subject: [PATCH 52/52] updated catalogue lib --- pom.xml | 2 +- .../eu/intelcomp/catalogue/controller/DatasetController.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index eea4cf9..343c6fa 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,7 @@ gr.athenarc catalogue - 5.0.1 + 5.0.2 diff --git a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java index 4c665f3..7e974ae 100644 --- a/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java +++ b/src/main/java/eu/intelcomp/catalogue/controller/DatasetController.java @@ -1,6 +1,5 @@ package eu.intelcomp.catalogue.controller; -import eu.intelcomp.xsd2java.DatasetType; import eu.openminted.registry.core.domain.Resource; import eu.openminted.registry.core.service.SearchService; import gr.athenarc.catalogue.service.GenericItemService; @@ -27,8 +26,7 @@ public DatasetController(GenericItemService genericItemService) { @GetMapping("{id}") public ResponseEntity get(@PathVariable("id") String id) { - DatasetType dataset = genericItemService.get("dataset_type", id); - return ResponseEntity.ok(dataset); + return ResponseEntity.ok(genericItemService.get("dataset_type", id)); } // TODO: helper method, remove when job filter is implemented correctly from @CITE