diff --git a/apps/dnet-exporter-api/pom.xml b/apps/dnet-exporter-api/pom.xml index 06fde34d..36a5e924 100644 --- a/apps/dnet-exporter-api/pom.xml +++ b/apps/dnet-exporter-api/pom.xml @@ -141,6 +141,12 @@ spring-web 5.3.8 + + + com.vladmihalcea + hibernate-types-52 + + diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/AbstractExporterController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/AbstractExporterController.java index 486ee096..82b1a96b 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/AbstractExporterController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/AbstractExporterController.java @@ -16,7 +16,9 @@ import org.springframework.web.bind.annotation.ResponseStatus; import com.fasterxml.jackson.annotation.JsonAutoDetect; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.DsmApiException; +import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; import eu.dnetlib.openaire.exporter.model.dsm.Response; /** @@ -28,17 +30,26 @@ public abstract class AbstractExporterController { @ResponseBody @ExceptionHandler({ - DsmApiException.class + DsmApiException.class, CommunityException.class, Exception.class }) @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) - public ErrorMessage handleDSMException(final Exception e) { + public ErrorMessage handle500(final Exception e) { + return _handleError(e); + } + + @ResponseBody + @ExceptionHandler({ + ResourceNotFoundException.class + }) + @ResponseStatus(value = HttpStatus.NOT_FOUND) + public ErrorMessage handle404(final Exception e) { return _handleError(e); } @ResponseBody @ExceptionHandler(MethodArgumentNotValidException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) - public List processValidationError(final MethodArgumentNotValidException e) { + public List handle400(final MethodArgumentNotValidException e) { return e.getBindingResult() .getFieldErrors() .stream() diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ExporterConstants.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ExporterConstants.java index 29e4e38a..0d3d4a7b 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ExporterConstants.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ExporterConstants.java @@ -10,6 +10,7 @@ public class ExporterConstants { public final static String C_PJ = "Community projects"; public final static String C_ZC = "Community Zenodo Communities"; public final static String C_O = "Community Organizations"; + public final static String C_SUB = "Subcommunities"; public final static String DS = "Datasource"; public final static String API = "Interface"; diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClient.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClient.java index b4b279a3..9a4ffdd6 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClient.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClient.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; +import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException; import eu.dnetlib.openaire.dsm.dao.utils.IndexDsInfo; import eu.dnetlib.openaire.exporter.model.context.Context; @@ -13,18 +14,25 @@ public interface ISClient { String getObjectStoreId(String dsId) throws Exception; + @Deprecated Map getFunderContextMap() throws IOException; + @Deprecated Map getCommunityContextMap() throws IOException; + @Deprecated Map getContextMap(final List type) throws IOException; + @Deprecated void updateContextParam(String id, String name, String value, boolean toEscape); + @Deprecated void updateContextAttribute(String id, String name, String value); + @Deprecated void addConcept(String id, String categoryId, String data); + @Deprecated void removeConcept(String id, String categoryId, String conceptId); void dropCache(); @@ -38,10 +46,15 @@ public interface ISClient { * @param value * new value for the attribute */ + @Deprecated void updateConceptAttribute(String id, String name, String value); + @Deprecated void updateConceptParam(String id, String name, String value); + @Deprecated void updateConceptParamNoEscape(String id, String name, String value); + String getProfile(String profileId) throws ISLookUpException; + } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClientImpl.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClientImpl.java index 679b03e0..42bb80a8 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClientImpl.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/common/ISClientImpl.java @@ -79,18 +79,21 @@ public class ISClientImpl implements ISClient { @Override @Cacheable("context-cache-funder") + @Deprecated public Map getFunderContextMap() throws IOException { return _processContext(_getQuery(config.getFindFunderContexts())); } @Override @Cacheable("context-cache-community") + @Deprecated public Map getCommunityContextMap() throws IOException { return _processContext(_getQuery(config.getFindCommunityContexts())); } @Override @Cacheable("context-cache") + @Deprecated public Map getContextMap(final List type) throws IOException { if (Objects.isNull(type) || type.isEmpty()) { return _processContext(_getQuery(config.getFindContextProfiles())); @@ -98,16 +101,15 @@ public class ISClientImpl implements ISClient { try { final String xqueryTemplate = _getQuery(config.getFindContextProfilesByType()); final String xquery = String.format(xqueryTemplate, type.stream() - .map(t -> String.format("./RESOURCE_PROFILE/BODY/CONFIGURATION/context/@type = '%s'", t)) - .collect(Collectors.joining(" or "))); + .map(t -> String.format("./RESOURCE_PROFILE/BODY/CONFIGURATION/context/@type = '%s'", t)) + .collect(Collectors.joining(" or "))); return _processContext(xquery); - }catch(Exception e){ + } catch (final Exception e) { log.error(e.getMessage()); throw new RuntimeException(e); } - } } @@ -115,6 +117,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void updateContextParam(final String id, final String name, final String value, final boolean toEscape) { if (getSize(id, name) > 0) { try { @@ -148,6 +151,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void updateContextAttribute(final String id, final String name, final String value) { final Escaper esc = XmlEscapers.xmlAttributeEscaper(); try { @@ -162,6 +166,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void addConcept(final String id, final String categoryId, final String data) { try { _quickSeachProfile(String.format("update insert %s into collection('/db/DRIVER/ContextDSResources/ContextDSResourceType')" + @@ -175,6 +180,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void removeConcept(final String id, final String categoryId, final String conceptId) { try { _quickSeachProfile(String.format("for $concept in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType')" + @@ -190,6 +196,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-community", "context-cache-funder" }, allEntries = true) + @Deprecated public void updateConceptAttribute(final String id, final String name, final String value) { final Escaper esc = XmlEscapers.xmlAttributeEscaper(); try { @@ -205,6 +212,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void updateConceptParam(final String id, final String name, final String value) { try { _quickSeachProfile(getConceptXQuery(id, name, value)); @@ -217,6 +225,7 @@ public class ISClientImpl implements ISClient { @CacheEvict(value = { "context-cache", "context-cache-funder" }, allEntries = true) + @Deprecated public void updateConceptParamNoEscape(final String id, final String name, final String value) { try { _quickSeachProfile(getConceptXQueryNoEscape(id, name, value)); @@ -227,6 +236,7 @@ public class ISClientImpl implements ISClient { /// HELPERS + @Deprecated private String getInsertXQuery(final String id, final String paramName, final String paramValue, final boolean toEscape) { String value; if (toEscape) { @@ -243,6 +253,7 @@ public class ISClientImpl implements ISClient { } } + @Deprecated private String getXQuery(final String id, final String name, final String paramValue, final boolean toEscape) { String value = paramValue; if (toEscape) { @@ -269,6 +280,7 @@ public class ISClientImpl implements ISClient { // } // } + @Deprecated private String getConceptXQuery(final String id, final String name, final String value) { final Escaper esc = XmlEscapers.xmlContentEscaper(); if (StringUtils.isNotBlank(value)) { @@ -280,6 +292,7 @@ public class ISClientImpl implements ISClient { } } + @Deprecated private String getConceptXQueryNoEscape(final String id, final String name, final String value) { if (StringUtils.isNotBlank(value)) { @@ -291,10 +304,12 @@ public class ISClientImpl implements ISClient { } } + @Deprecated private Map _processContext(final String xquery) throws IOException { return _processContext(new LinkedBlockingQueue<>(), xquery); } + @Deprecated private Map _processContext(final Queue errors, final String xquery) throws IOException { try { return getContextProfiles(errors, xquery).stream() @@ -312,6 +327,7 @@ public class ISClientImpl implements ISClient { } } + @Deprecated private List getContextProfiles(final Queue errors, final String xquery) throws IOException { log.warn("getContextProfiles(): not using cache"); try { @@ -335,13 +351,13 @@ public class ISClientImpl implements ISClient { final List res = Lists.newArrayList(); log.debug(String.format("running xquery:\n%s", xquery)); - try{ + try { final List list = isLookUpService.quickSearchProfile(xquery); if (list != null) { res.addAll(list); } log.debug(String.format("query result size: %s", res.size())); - }catch(Exception ex){ + } catch (final Exception ex) { log.error(ex.getMessage()); throw new ISLookUpException(""); } @@ -358,4 +374,9 @@ public class ISClientImpl implements ISClient { log.debug("dropped dsManager IS cache"); } + @Override + public String getProfile(final String profileId) throws ISLookUpException { + return isLookUpService.getResourceProfile(profileId); + } + } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java index 6793dd72..ae228039 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiController.java @@ -4,12 +4,28 @@ import static eu.dnetlib.openaire.common.ExporterConstants.C; import static eu.dnetlib.openaire.common.ExporterConstants.C_CP; import static eu.dnetlib.openaire.common.ExporterConstants.C_O; import static eu.dnetlib.openaire.common.ExporterConstants.C_PJ; +import static eu.dnetlib.openaire.common.ExporterConstants.C_SUB; import static eu.dnetlib.openaire.common.ExporterConstants.C_ZC; import static eu.dnetlib.openaire.common.ExporterConstants.R; import static eu.dnetlib.openaire.common.ExporterConstants.W; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.domain.Page; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import eu.dnetlib.openaire.common.AbstractExporterController; import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; @@ -19,18 +35,8 @@ import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; import eu.dnetlib.openaire.exporter.model.community.CommunityProject; import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties; -import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; @@ -42,10 +48,10 @@ import io.swagger.v3.oas.annotations.tags.Tag; }) @ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") @Tag(name = "OpenAIRE Communities API", description = "the OpenAIRE Community API") -public class CommunityApiController { +public class CommunityApiController extends AbstractExporterController { @Autowired - private CommunityApiCore communityApiCore; + private CommunityService communityService; @RequestMapping(value = "/community/communities", produces = { "application/json" @@ -58,7 +64,34 @@ public class CommunityApiController { @ApiResponse(responseCode = "500", description = "unexpected error") }) public List listCommunities() throws CommunityException { - return communityApiCore.listCommunities(); + try { + return communityService.listCommunities(); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "add a new community profile", description = "add a new community profile", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails getCommunity(@RequestBody final CommunityDetails details) throws CommunityException { + try { + return communityService.newCommunity(details); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}", produces = { @@ -72,15 +105,21 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails getCommunity(@PathVariable final String id) throws CommunityException, ResourceNotFoundException { - return communityApiCore.getCommunity(id); + public CommunityDetails getCommunity(@PathVariable final String id) throws CommunityException { + try { + return communityService.getCommunity(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}", produces = { "application/json" }, method = RequestMethod.POST) @Operation(summary = "update community details", description = "update community details", tags = { - C, R + C, W }) @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), @@ -89,12 +128,39 @@ public class CommunityApiController { }) public void setCommunity( @PathVariable final String id, - @RequestBody final CommunityWritableProperties properties) throws CommunityException, ResourceNotFoundException { - - communityApiCore.setCommunity(id, properties); + @RequestBody final CommunityWritableProperties properties) throws CommunityException { + try { + communityService.setCommunity(id, properties); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } - @RequestMapping(value = "/community/{id}/projects", produces = { + @RequestMapping(value = "/community/{id}", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "delete a community", description = "delete a community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public void deleteCommunity(@PathVariable final String id, @RequestParam(required = false, defaultValue = "false") final boolean recursive) + throws CommunityException { + try { + communityService.deleteCommunity(id, recursive); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/projects/{page}/{size}", produces = { "application/json" }, method = RequestMethod.GET) @Operation(summary = "get community projects", description = "get community projects", tags = { @@ -105,8 +171,20 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List getCommunityProjects(@PathVariable final String id) throws CommunityException, ResourceNotFoundException { - return communityApiCore.getCommunityProjects(id); + public Page getCommunityProjects(@PathVariable final String id, + @PathVariable final Integer page, + @PathVariable final Integer size, + @RequestParam(required = false) final String funder, + @RequestParam(required = false) final String searchFilter, + @RequestParam(required = false) final String orderBy) + throws CommunityException { + try { + return communityService.getCommunityProjects(id, funder, searchFilter, page, size, orderBy); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/projects", produces = { @@ -122,9 +200,15 @@ public class CommunityApiController { }) public CommunityProject addCommunityProject( @PathVariable final String id, - @RequestBody final CommunityProject project) throws CommunityException, ResourceNotFoundException { + @RequestBody final CommunityProject project) throws CommunityException { - return communityApiCore.addCommunityProject(id, project); + try { + return communityService.addCommunityProject(id, project); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/projects", produces = { @@ -140,47 +224,83 @@ public class CommunityApiController { }) public void deleteCommunityProject( @PathVariable final String id, - @RequestBody final Integer projectId) throws CommunityException, ResourceNotFoundException { - - communityApiCore.removeCommunityProject(id, projectId); + @RequestParam final String projectId) throws CommunityException { + try { + communityService.removeCommunityProjects(id, projectId); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/projectList", produces = { - "application/json" + "application/json" }, method = RequestMethod.POST) - @Operation(summary = "associate a list of project to the community", - description = "associate a list of project to the community", tags = { - C_PJ, W + @Operation(summary = "associate a list of project to the community", description = "associate a list of project to the community", tags = { + C_PJ, W }) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List addCommunityProjectList( - @PathVariable final String id, - @RequestBody final List projectList) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.addCommunityProjectList(id, projectList); + public CommunityProject[] addCommunityProjectList( + @PathVariable final String id, + @RequestBody final CommunityProject[] projects) throws CommunityException { + try { + communityService.addCommunityProjects(id, projects); + return projects; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/projectList", produces = { - "application/json" + "application/json" }, method = RequestMethod.DELETE) - @Operation(summary = "remove a list of projects from the community", - description = "remove a list of projects from the community", tags = { - C_PJ, W + @Operation(summary = "remove a list of projects from the community", description = "remove a list of projects from the community", tags = { + C_PJ, W }) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") }) public void deleteCommunityProjectList( - @PathVariable final String id, - @RequestBody final List projectIdList) throws CommunityException, ResourceNotFoundException { + @PathVariable final String id, + @RequestBody final String[] projectIdList) throws CommunityException { + try { + communityService.removeCommunityProjects(id, projectIdList); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } - communityApiCore.removeCommunityProjectList(id, projectIdList); + @RequestMapping(value = "/community/{id}/funders", produces = { + "application/json" + }, method = RequestMethod.GET) + @Operation(summary = "get the funders of the projects of a community", description = "get the funders of the projects of a community", tags = { + C_PJ, R + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public List getCommunityFunders(@PathVariable final String id) + throws CommunityException { + try { + return communityService.getCommunityFunders(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/contentproviders", produces = { @@ -194,8 +314,14 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List getCommunityContentproviders(@PathVariable final String id) throws CommunityException, ResourceNotFoundException { - return communityApiCore.getCommunityContentproviders(id); + public List getCommunityContentproviders(@PathVariable final String id) throws CommunityException { + try { + return communityService.getCommunityContentproviders(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/contentproviders", produces = { @@ -211,9 +337,16 @@ public class CommunityApiController { }) public CommunityContentprovider addCommunityContentprovider( @PathVariable final String id, - @RequestBody final CommunityContentprovider contentprovider) throws CommunityException, ResourceNotFoundException { + @RequestBody final CommunityContentprovider contentprovider) throws CommunityException { - return communityApiCore.addCommunityContentprovider(id, contentprovider); + try { + communityService.addCommunityContentProviders(id, contentprovider); + return contentprovider; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/contentproviders", produces = { @@ -229,47 +362,62 @@ public class CommunityApiController { }) public void removeCommunityContentprovider( @PathVariable final String id, - @RequestBody final Integer contentproviderId) throws CommunityException, ResourceNotFoundException { - - communityApiCore.removeCommunityContentProvider(id, contentproviderId); + @RequestParam final String contentproviderId) throws CommunityException { + try { + communityService.removeCommunityContentProviders(id, contentproviderId); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/contentprovidersList", produces = { - "application/json" + "application/json" }, method = RequestMethod.POST) - @Operation(summary = "associate a list of content providers to the community", - description = "associate a list of content providers to the community", tags = { - C_PJ, W + @Operation(summary = "associate a list of content providers to the community", description = "associate a list of content providers to the community", tags = { + C_CP, W }) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List addCommunityContentProvidersList( - @PathVariable final String id, - @RequestBody final List contentprovidersList) throws CommunityException, ResourceNotFoundException { + public CommunityContentprovider[] addCommunityContentProvidersList( + @PathVariable final String id, + @RequestBody final CommunityContentprovider[] contentprovidersList) throws CommunityException { - return communityApiCore.addCommunityContentProvidersList(id, contentprovidersList); + try { + communityService.addCommunityContentProviders(id, contentprovidersList); + return contentprovidersList; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/contentprovidersList", produces = { - "application/json" + "application/json" }, method = RequestMethod.DELETE) - @Operation(summary = "remove a list of content providers from the community", - description = "remove a list of content providers from the community", tags = { - C_PJ, W + @Operation(summary = "remove a list of content providers from the community", description = "remove a list of content providers from the community", tags = { + C_CP, W }) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") }) public void deleteCommunityContentProvidersList( - @PathVariable final String id, - @RequestBody final List contentProviderIdList) throws CommunityException, ResourceNotFoundException { - - communityApiCore.removeCommunityContentProviderList(id, contentProviderIdList); + @PathVariable final String id, + @RequestBody final String[] contentProviderIdList) throws CommunityException { + try { + communityService.removeCommunityContentProviders(id, contentProviderIdList); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } // ADDING CODE FOR COMMUNITY ORGANIZATIONS @@ -285,8 +433,14 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List getCommunityOrganizations(@PathVariable final String id) throws CommunityException, ResourceNotFoundException { - return communityApiCore.getCommunityOrganizations(id); + public List getCommunityOrganizations(@PathVariable final String id) throws CommunityException { + try { + return communityService.getCommunityOrganizations(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/organizations", produces = { @@ -302,9 +456,40 @@ public class CommunityApiController { }) public CommunityOrganization addCommunityOrganization( @PathVariable final String id, - @RequestBody final CommunityOrganization organization) throws CommunityException, ResourceNotFoundException { + @RequestBody final CommunityOrganization organization) throws CommunityException { + try { + communityService.addCommunityOrganizations(id, organization); + return organization; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } - return communityApiCore.addCommunityOrganization(id, organization); + @RequestMapping(value = "/community/{id}/organizationList", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "associate a list of organizations to the community", description = "associate a list of organizations to the community", tags = { + C_O, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityOrganization[] addCommunityOrganizationList( + @PathVariable final String id, + @RequestBody final CommunityOrganization[] orgs) throws CommunityException { + + try { + communityService.addCommunityOrganizations(id, orgs); + return orgs; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/organizations", produces = { @@ -320,10 +505,39 @@ public class CommunityApiController { }) public void removeCommunityOrganization( @PathVariable final String id, - @RequestBody final Integer organizationId) throws CommunityException, ResourceNotFoundException { - - communityApiCore.removeCommunityOrganization(id, organizationId); + @RequestParam final String organizationName) throws CommunityException { + try { + communityService.removeCommunityOrganizations(id, organizationName); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } + + @RequestMapping(value = "/community/{id}/organizationList", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove a list of associations between some organizations and the community", description = "remove a list of associations between some organizations and the community", tags = { + C_O, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public void removeCommunityOrganizationList( + @PathVariable final String id, + @RequestBody final String[] orgNames) throws CommunityException { + try { + communityService.removeCommunityOrganizations(id, orgNames); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + // ********************** @RequestMapping(value = "/community/{id}/subjects", produces = { @@ -339,9 +553,15 @@ public class CommunityApiController { }) public CommunityDetails addCommunitySubjects( @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { + @RequestBody final String[] subjects) throws CommunityException { - return communityApiCore.addCommunitySubjects(id, subjects); + try { + return communityService.addCommunitySubjects(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/subjects", produces = { @@ -357,119 +577,204 @@ public class CommunityApiController { }) public CommunityDetails removeCommunitySubjects( @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { + @RequestBody final String[] subjects) throws CommunityException { - return communityApiCore.removeCommunitySubjects(id, subjects); - } - @RequestMapping(value = "/community/{id}/fos", produces = { "application/json" }, method = RequestMethod.POST) - @Operation( - summary = "associate a fos to the community", - description = "associate a fos to the community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails addCommunityFOS( - @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.addCommunityFOS(id, subjects); + try { + return communityService.removeCommunitySubjects(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } - @RequestMapping(value = "/community/{id}/fos", produces = { "application/json" }, method = RequestMethod.DELETE) - @Operation( - summary = "remove fos from a community", - description = "remove fos from a community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails removeCommunityFOS( - @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.removeCommunityFOS(id, subjects); - } - - - @RequestMapping(value = "/community/{id}/sdg", produces = { "application/json" }, method = RequestMethod.POST) - @Operation( - summary = "associate a sdg to the community", - description = "associate a sdg to the community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails addCommunitySDG( - @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.addCommunitySDG(id, subjects); - } - - @RequestMapping(value = "/community/{id}/sdg", produces = { "application/json" }, method = RequestMethod.DELETE) - @Operation( - summary = "remove sdg from a community", - description = "remove sdg from a community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails removeCommunitySDG( - @PathVariable final String id, - @RequestBody final List subjects) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.removeCommunitySDG(id, subjects); - } - - @RequestMapping(value = "/community/{id}/advancedConstraint", produces = { "application/json" }, method = RequestMethod.POST) - @Operation( - summary = "the set of constraints to be used to extend the association between result and community", - description = "the set of constraints to be used to extend the association between result and community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails addAdvancedConstraint( - @PathVariable final String id, - @RequestBody final SelectionCriteria advancedConstraint) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.addCommunityAdvancedConstraint(id, advancedConstraint); - } - - @RequestMapping(value = "/community/{id}/advancedConstraint", produces = { "application/json" }, method = RequestMethod.DELETE) - @Operation( - summary = "remove the constraints to extend the association result community from a community", - description = "remove the constraints to extend the association result community from a community", - tags = { C, W }) - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "OK"), - @ApiResponse(responseCode = "404", description = "not found"), - @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityDetails removeAdvancedConstraint( - @PathVariable final String id) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.removeCommunityAdvancedConstraint(id); - } - - @RequestMapping(value = "/community/{id}/zenodocommunities", produces = { + @RequestMapping(value = "/community/{id}/fos", produces = { "application/json" - }, method = RequestMethod.GET) - @Operation(summary = "get the list of Zenodo communities associated to a given community", description = "get the list of Zenodo communities associated to a given community", tags = { - C_ZC, R + }, method = RequestMethod.POST) + @Operation(summary = "associate a fos to the community", description = "associate a fos to the community", tags = { + C, W }) @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List getCommunityZenodoCommunities(@PathVariable final String id) throws CommunityException, ResourceNotFoundException { - return communityApiCore.getCommunityZenodoCommunities(id); + public CommunityDetails addCommunityFOS( + @PathVariable final String id, + @RequestBody final String[] subjects) throws CommunityException { + + try { + return communityService.addCommunityFOS(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/fos", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove fos from a community", description = "remove fos from a community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails removeCommunityFOS( + @PathVariable final String id, + @RequestBody final String[] subjects) throws CommunityException { + + try { + return communityService.removeCommunityFOS(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/sdg", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "associate a sdg to the community", description = "associate a sdg to the community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails addCommunitySDG( + @PathVariable final String id, + @RequestBody final String[] subjects) throws CommunityException { + + try { + return communityService.addCommunitySDG(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/sdg", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove sdg from a community", description = "remove sdg from a community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails removeCommunitySDG( + @PathVariable final String id, + @RequestBody final String[] subjects) throws CommunityException { + + try { + return communityService.removeCommunitySDG(id, subjects); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/advancedConstraint", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "the set of constraints to be used to extend the association between result and community", description = "the set of constraints to be used to extend the association between result and community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails addAdvancedConstraint( + @PathVariable final String id, + @RequestBody final SelectionCriteria advancedConstraint) throws CommunityException { + + try { + return communityService.addCommunityAdvancedConstraint(id, advancedConstraint); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/advancedConstraint", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove the constraints to extend the association result community from a community", description = "remove the constraints to extend the association result community from a community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails removeAdvancedConstraint( + @PathVariable final String id) throws CommunityException { + + try { + return communityService.removeCommunityAdvancedConstraint(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/removeConstraint", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "the set of constraints to be used to remove the association between result and community", description = "the set of constraints to be used to remove the association between result and community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails addRemoveConstraint( + @PathVariable final String id, + @RequestBody final SelectionCriteria removeConstraint) throws CommunityException { + + try { + return communityService.addCommunityRemoveConstraint(id, removeConstraint); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/removeConstraint", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove the constraints to remove the association beetween result and community", description = "remove the constraints to remove the association beetween result and community", tags = { + C, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public CommunityDetails removeRemoveConstraint(@PathVariable final String id) throws CommunityException { + + try { + return communityService.removeCommunityRemoveConstraint(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{id}/zenodocommunities", produces = { @@ -483,11 +788,18 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityZenodoCommunity addCommunityZenodoCommunity( + public CommunityDetails addCommunityZenodoCommunity( @PathVariable final String id, - @RequestBody final CommunityZenodoCommunity zenodocommunity) throws CommunityException, ResourceNotFoundException { + @RequestParam(required = false, defaultValue = "false") final boolean main, + @RequestParam final String zenodocommunity) throws CommunityException { - return communityApiCore.addCommunityZenodoCommunity(id, zenodocommunity); + try { + return communityService.addCommunityZenodoCommunity(id, zenodocommunity, main); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @@ -504,10 +816,15 @@ public class CommunityApiController { }) public void removeCommunityZenodoCommunity( @PathVariable final String id, - @RequestBody final Integer zenodoCommId) throws CommunityException, ResourceNotFoundException { - - communityApiCore.removeCommunityZenodoCommunity(id, zenodoCommId); - + @RequestParam(required = false, defaultValue = "false") final boolean main, + @RequestParam final String zenodocommunity) throws CommunityException { + try { + communityService.removeCommunityZenodoCommunity(id, zenodocommunity, main); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/community/{zenodoId}/openairecommunities", produces = { @@ -521,10 +838,228 @@ public class CommunityApiController { @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public CommunityOpenAIRECommunities getOpenAireCommunities( - @PathVariable final String zenodoId) throws CommunityException, ResourceNotFoundException { - - return communityApiCore.getOpenAIRECommunities(zenodoId); - + public CommunityOpenAIRECommunities getOpenAireCommunities(@PathVariable final String zenodoId) throws CommunityException { + try { + final CommunityOpenAIRECommunities res = new CommunityOpenAIRECommunities(); + res.setZenodoid(zenodoId); + res.setOpenAirecommunitylist(communityService.getOpenAIRECommunitiesByZenodoId(zenodoId)); + return res; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } + + // APIs to manage the propagationOrganizationCommunityMap + @RequestMapping(value = "/propagationOrganizationCommunityMap", produces = { + "application/json" + }, method = RequestMethod.GET) + @Operation(summary = "Get the propagationOrganizationCommunityMap", description = "propagationOrganizationCommunityMap", tags = { + C_O, R + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public Map> getPropagationOrganizationCommunityMap() throws CommunityException { + try { + return communityService.getPropagationOrganizationCommunityMap(); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/propagationOrganizations", produces = { + "application/json" + }, method = RequestMethod.GET) + @Operation(summary = "try { return the propagation organizations of a community", description = "try { return the propagation organizations of a community", tags = { + C_O, R + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public Set getPropagationOrganizationsForCommunity(@PathVariable final String id) throws CommunityException { + try { + return communityService.getPropagationOrganizationsForCommunity(id); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/propagationOrganizations", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "add an organization to the propagationOrganizationCommunityMap", description = "add an organization to the propagationOrganizationCommunityMap", tags = { + C_O, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public Set addPropagationOrganizationForCommunity(@PathVariable final String id, + @RequestParam final String organizationId) throws CommunityException { + + try { + return communityService.addPropagationOrganizationForCommunity(id, organizationId.split(",")); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/propagationOrganizations", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "delete an organization to the propagationOrganizationCommunityMap", description = "delete an organization to the propagationOrganizationCommunityMap", tags = { + C_O, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public Set removePropagationOrganizationForCommunity(@PathVariable final String id, + @RequestParam final String organizationId) throws CommunityException { + + try { + return communityService.removePropagationOrganizationForCommunity(id, organizationId.split(",")); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + // APIs to manage the sub communities + + @RequestMapping(value = "/community/{id}/subcommunities", produces = { + "application/json" + }, method = RequestMethod.GET) + @Operation(summary = "get the list of subcommunities for a given community", description = "get the list of subcommunities for a given community", tags = { + C_SUB, R + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public List getSubCommunities(@PathVariable final String id, @RequestParam(required = false, defaultValue = "false") final boolean all) + throws CommunityException { + try { + return communityService.getSubCommunities(id) + .stream() + .filter(sc -> all || sc.isBrowsable()) + .collect(Collectors.toList()); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/subcommunities", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "associate a subcommunity to the community", description = "associate a subcommunity to the community", tags = { + C_SUB, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public SubCommunity addSubCommunity( + @PathVariable final String id, + @RequestBody final SubCommunity subcommunity) throws CommunityException { + try { + communityService.addSubCommunities(id, subcommunity); + return subcommunity; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/subcommunitiesList", produces = { + "application/json" + }, method = RequestMethod.POST) + @Operation(summary = "associate a list of subcommunities to the community", description = "associate a list of subcommunities to the community", tags = { + C_SUB, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public SubCommunity[] addSubCommunityList( + @PathVariable final String id, + @RequestBody final SubCommunity[] subcommunities) throws CommunityException { + + try { + communityService.addSubCommunities(id, subcommunities); + return subcommunities; + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/subcommunities", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove the association between a subcommunity and the community", description = "remove the association between a subcommunity and the community", tags = { + C_SUB, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public void removeSubCommunity( + @PathVariable final String id, + @RequestParam final String subCommunityId) throws CommunityException { + try { + communityService.removeSubCommunities(id, subCommunityId); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/community/{id}/subcommunitiesList", produces = { + "application/json" + }, method = RequestMethod.DELETE) + @Operation(summary = "remove a list of associations between some subcommunities and the community", description = "remove a list of associations between some subcommunities and the community", tags = { + C_SUB, W + }) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public void removeSubcommunities( + @PathVariable final String id, + @RequestBody final String[] subCommunityIdList) throws CommunityException { + try { + communityService.removeSubCommunities(id, subCommunityIdList); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiCore.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiCore.java deleted file mode 100644 index 3f0d8dd5..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityApiCore.java +++ /dev/null @@ -1,517 +0,0 @@ -package eu.dnetlib.openaire.community; - -import java.util.*; -import java.util.stream.Collectors; - -import com.google.gson.Gson; - -import eu.dnetlib.openaire.exporter.exceptions.CommunityException; -import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; -import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; -import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; -import eu.dnetlib.openaire.exporter.model.community.CommunityOpenAIRECommunities; -import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; -import eu.dnetlib.openaire.exporter.model.community.CommunityProject; -import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; -import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties; -import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; -import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Component; - -import com.google.common.base.Functions; -import com.google.common.base.Joiner; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - -import eu.dnetlib.openaire.common.ISClient; - -import static eu.dnetlib.openaire.community.CommunityConstants.*; - -@Component -@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") -public class CommunityApiCore {// implements CommunityClient{ - - private static final Log log = LogFactory.getLog(CommunityApiCore.class); - - @Autowired - private CommunityClient cci; - - @Autowired - private ISClient isClient; - - @Autowired - private CommunityCommon cc; - - public List listCommunities() throws CommunityException { - return cc.listCommunities(); - - } - - public CommunityDetails getCommunity(final String id) throws CommunityException, ResourceNotFoundException { - return cc.getCommunity(id); - - } - - private void removeAdvancedConstraint(String id) throws ResourceNotFoundException, CommunityException { - cc.getCommunity(id); - isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "", false); - cc.removeAdvancedConstraint(id); - - } - - public void setCommunity(final String id, final CommunityWritableProperties details) throws CommunityException, ResourceNotFoundException { - - cc.getCommunity(id); // ensure the community exists. - - if (details.getShortName() != null) { - isClient.updateContextAttribute(id, CLABEL, details.getShortName()); - - } - if (details.getName() != null) { - isClient.updateContextParam(id, CSUMMARY_NAME, details.getName(), true); - - } - if (details.getDescription() != null) { - isClient.updateContextParam(id, CSUMMARY_DESCRIPTION, details.getDescription(), true); - - } - if (details.getLogoUrl() != null) { - isClient.updateContextParam(id, CSUMMARY_LOGOURL, details.getLogoUrl(), true); - - } - if (details.getStatus() != null) { - isClient.updateContextParam(id, CSUMMARY_STATUS, details.getStatus().name(), true); - - } - if (details.getSubjects() != null) { - isClient.updateContextParam(id, CPROFILE_SUBJECT, Joiner.on(CSV_DELIMITER).join(details.getSubjects()), true); - - } - if (details.getFos() != null) { - isClient.updateContextParam(id, CPROFILE_FOS, Joiner.on(CSV_DELIMITER).join(details.getFos()), true); - - } - if (details.getSdg() != null) { - isClient.updateContextParam(id, CPROFILE_SDG, Joiner.on(CSV_DELIMITER).join(details.getSdg()), true); - - } - if (details.getAdvancedConstraints() != null) { - isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "", false); - - } - if (details.getMainZenodoCommunity() != null) { - isClient.updateContextParam(id, CSUMMARY_ZENODOC, details.getMainZenodoCommunity(), true); - } - - cc.updateCommunity(id, details); - } - - public List getCommunityProjects(final String id) throws CommunityException, ResourceNotFoundException { - cc.getCommunity(id); // ensure the community exists. - return cc.getCommunityInfo(id, PROJECTS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityProject(id, c)); - } - - public CommunityProject addCommunityProject(final String id, final CommunityProject project) throws CommunityException, ResourceNotFoundException { - if (!StringUtils.equalsIgnoreCase(id, project.getCommunityId())) { - throw new CommunityException("parameters 'id' and project.communityId must be coherent"); - } - - return updateProject(id, project); - - } - - private CommunityProject updateProject(String id, CommunityProject project) throws CommunityException, ResourceNotFoundException { - final TreeMap projects = getCommunityProjectMap(id); - String project_id = project.getId(); - - if (project_id != null && projects.keySet().contains(Integer.valueOf(project_id))){ - if (project.getName() != null) { - isClient.updateConceptParam(id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project_id, CPROJECT_FULLNAME, project.getName()); - - } - if(project.getAcronym()!= null){ - isClient.updateConceptParam(id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project_id, CPROJECT_ACRONYM, project.getAcronym()); - - } - if (project.getOpenaireId() != null){ - isClient.updateConceptParam(id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project_id, OPENAIRE_ID, project.getOpenaireId()); - - } - if (project.getFunder() != null){ - isClient.updateConceptParam(id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project_id, CPROJECT_FUNDER, project.getFunder()); - - } - if(project.getGrantId() != null){ - isClient.updateConceptParam(id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project_id, CPROJECT_NUMBER, project.getGrantId()); - - } - }else { - project.setId(nextId(projects != null && !projects.isEmpty() ? projects.lastKey() : 0)); - - isClient.addConcept(id, id + PROJECTS_ID_SUFFIX, CommunityMappingUtils.asProjectXML(id, project)); - - } - cc.updateProject(id, project ); - return project; - } - - public List addCommunityProjectList(final String id, final List projectList) throws CommunityException, ResourceNotFoundException { - if(projectList == null || projectList.size() == 0){ - throw new CommunityException("parameter 'projectList' must be present and should contain at least one project"); - } - if (!StringUtils.equalsIgnoreCase(id, projectList.get(0).getCommunityId())) { - throw new CommunityException("parameters 'id' and project.communityId must be coherent"); - } - - List projects = new ArrayList(); - - for(CommunityProject project : projectList){ - projects.add(updateProject(id, project)); - } - - - return projects; - } - - private String nextId(final Integer id) { - return String.valueOf(id + 1); - } - - public void removeCommunityProject(final String id, final Integer projectId) throws CommunityException, ResourceNotFoundException { - final Map projects = getCommunityProjectMap(id); - if (!projects.containsKey(projectId)) { - throw new ResourceNotFoundException(String.format("project '%s' doesn't exist within context '%s'", projectId, id)); - } - isClient.removeConcept(id, id + PROJECTS_ID_SUFFIX, id + PROJECTS_ID_SUFFIX + ID_SEPARATOR + projectId); - cc.removeFromCategory(id, PROJECTS_ID_SUFFIX, String.valueOf(projectId)); - } - - public void removeCommunityProjectList(final String id, final List projectIdList) throws CommunityException, ResourceNotFoundException { - for(Integer projectId: projectIdList){ - removeCommunityProject(id, projectId); - } - } - - public List getCommunityContentproviders(final String id) throws CommunityException, ResourceNotFoundException { - cc.getCommunity(id); // ensure the community exists. - return cc.getCommunityInfo(id, CONTENTPROVIDERS_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityDataprovider(id, c)); - } - - public CommunityContentprovider addCommunityContentprovider(final String id, final CommunityContentprovider cp) - throws CommunityException, ResourceNotFoundException { - log.info("content provider to add " + cp.toString()); - if (!StringUtils.equalsIgnoreCase(id, cp.getCommunityId())) { throw new CommunityException("parameters 'id' and cp.communityId must be coherent"); } - - return updateContentprovider(id, cp); - } - - private CommunityContentprovider updateContentprovider(String id, CommunityContentprovider cp) throws CommunityException, ResourceNotFoundException { - final TreeMap cps = getCommunityContentproviderMap(id); - final String concept_id = cp.getId(); - if (concept_id != null && cps.keySet().contains(Integer.valueOf(concept_id))) { - if (cp.getName() != null) { - isClient.updateConceptParam(id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + concept_id, CCONTENTPROVIDER_NAME, cp.getName()); - } - if (cp.getOfficialname() != null) { - isClient.updateConceptParam(id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + concept_id, CCONTENTPROVIDER_OFFICIALNAME, cp.getOfficialname()); - } - if (cp.getOpenaireId() != null) { - isClient.updateConceptParam(id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + concept_id, OPENAIRE_ID, cp.getOpenaireId()); - } - if (cp.getSelectioncriteria() != null) { - isClient.updateConceptParamNoEscape(id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + concept_id, CCONTENTPROVIDER_SELCRITERIA, cp.toXML()); - } - } else { - log.info("adding new concept for community " + id); - cp.setId(nextId(!cps.isEmpty() ? cps.lastKey() : 0)); - - isClient.addConcept(id, id + CONTENTPROVIDERS_ID_SUFFIX, CommunityMappingUtils.asContentProviderXML(id, cp)); - } - - cc.updateDatasource(id, cp); - return cp; - } - - public void removeCommunityContentProvider(final String id, final Integer contentproviderId) throws CommunityException, ResourceNotFoundException { - final Map providers = getCommunityContentproviderMap(id); - if (!providers.containsKey(contentproviderId)) { - throw new ResourceNotFoundException(String.format("content provider '%s' doesn't exist within context '%s'", contentproviderId, id)); - } - isClient.removeConcept(id, id + CONTENTPROVIDERS_ID_SUFFIX, id + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + contentproviderId); - cc.removeFromCategory(id, CONTENTPROVIDERS_ID_SUFFIX, String.valueOf(contentproviderId)); - } - - public List addCommunityContentProvidersList(String id, List contentprovidersList) throws CommunityException, ResourceNotFoundException { - if(contentprovidersList == null || contentprovidersList.size() == 0){ - throw new CommunityException("parameter 'contentprovidersList' must be present and should contain at least one content provider"); - } - if (!StringUtils.equalsIgnoreCase(id, contentprovidersList.get(0).getCommunityId())) { - throw new CommunityException("parameters 'id' and contentprovider.communityId must be coherent"); - } - - List contentproviders = new ArrayList(); - - for(CommunityContentprovider contentProvider : contentprovidersList){ - contentproviders.add(updateContentprovider(id, contentProvider)); - } - - - return contentproviders; - } - - public void removeCommunityContentProviderList(final String id, final List contentProviderIdList) throws CommunityException, ResourceNotFoundException { - for(Integer contentProviderId: contentProviderIdList){ - removeCommunityContentProvider(id, contentProviderId); - } - } - - public void removeCommunityOrganization(final String id, final Integer organizationId) throws CommunityException, ResourceNotFoundException { - final Map organizations = getCommunityOrganizationMap(id); - if (!organizations.containsKey(organizationId)) { - throw new ResourceNotFoundException(String.format("organization '%s' doesn't exist within context '%s'", organizationId, id)); - } - isClient.removeConcept(id, id + ORGANIZATION_ID_SUFFIX, id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organizationId); - cc.removeFromCategory(id, ORGANIZATION_ID_SUFFIX, String.valueOf(organizationId)); - } - - public List getCommunityZenodoCommunities(final String id) throws CommunityException, ResourceNotFoundException { - - return cc.getCommunityZenodoCommunities(id); - } - - public List getCommunityOrganizations(final String id) throws CommunityException, ResourceNotFoundException { - cc.getCommunity(id); - return cc.getCommunityInfo(id, ORGANIZATION_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityOrganization(id, c)); - } - - public CommunityDetails addCommunitySubjects(final String id, final List subjects) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - final Set current = Sets.newHashSet(cc.getCommunity(id).getSubjects()); - - current.addAll(subjects); - - cd.setSubjects(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails removeCommunitySubjects(final String id, final List subjects) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - final Set current = Sets.newHashSet(cc.getCommunity(id).getSubjects()); - - current.removeAll(subjects); - - cd.setSubjects(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails addCommunityFOS(final String id, final List foss) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - final Set current = Sets.newHashSet(); - if(Optional.ofNullable(cc.getCommunity(id).getFos()).isPresent()){ - current.addAll(cc.getCommunity(id).getFos()); - } - - current.addAll(foss); - - cd.setFos(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails removeCommunityFOS(final String id, final List foss) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - final Set current = Sets.newHashSet(cc.getCommunity(id).getFos()); - - current.removeAll(foss); - - cd.setFos(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails addCommunitySDG(final String id, final List sdgs) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - final Set current = Sets.newHashSet(); - if(Optional.ofNullable(cc.getCommunity(id).getSdg()).isPresent()){ - current.addAll(cc.getCommunity(id).getSdg()); - } - - current.addAll(sdgs); - - cd.setSdg(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails removeCommunitySDG(final String id, final List sdgs) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - final Set current = Sets.newHashSet(cc.getCommunity(id).getSdg()); - - current.removeAll(sdgs); - - cd.setSdg(Lists.newArrayList(current)); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails addCommunityAdvancedConstraint(final String id, final SelectionCriteria advancedCosntraint) throws CommunityException, ResourceNotFoundException { - - final CommunityDetails cd = new CommunityDetails(); - - cd.setAdvancedConstraints(advancedCosntraint); - - setCommunity(id, CommunityWritableProperties.fromDetails(cd)); - - return cd; - } - - public CommunityDetails removeCommunityAdvancedConstraint(final String id) throws ResourceNotFoundException, CommunityException { - - removeAdvancedConstraint(id); - - return new CommunityDetails(); - } - - - - @CacheEvict(value = "community-cache", allEntries = true) - public void removeCommunityZenodoCommunity(final String id, final Integer zenodoCommId) throws CommunityException, ResourceNotFoundException { - - final Map zcomms = getZenodoCommunityMap(id); - if (!zcomms.containsKey(zenodoCommId)) { - throw new ResourceNotFoundException(String.format("Zenodo community '%s' doesn't exist within context '%s'", zenodoCommId, id)); - } - isClient.removeConcept(id, id + ZENODOCOMMUNITY_ID_SUFFIX, id + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zenodoCommId); - - cc.removeFromCategory(id, ZENODOCOMMUNITY_ID_SUFFIX, String.valueOf(zenodoCommId)); - - } - - @CacheEvict(value = "community-cache", allEntries = true) - public CommunityZenodoCommunity addCommunityZenodoCommunity(final String id, final CommunityZenodoCommunity zc) - throws CommunityException, ResourceNotFoundException { - if (!StringUtils.equalsIgnoreCase(id, zc.getCommunityId())) { throw new CommunityException("parameters 'id' and zc.communityId must be coherent"); } - if (!StringUtils.isNotBlank(zc.getZenodoid())) { throw new CommunityException("parameter zenodoid cannot be null or empty"); } - final TreeMap zcs = getZenodoCommunityMap(id); - - for (final CommunityZenodoCommunity czc : zcs.values()) { - if (czc.getZenodoid().equals(zc.getZenodoid())) { throw new CommunityException("Zenodo community already associated to the RCD"); } - } - - zc.setId(nextId(!zcs.isEmpty() ? zcs.lastKey() : 0)); - - isClient.addConcept(id, id + ZENODOCOMMUNITY_ID_SUFFIX, CommunityMappingUtils.asZenodoCommunityXML(id, zc)); - cc.updateZenodoCommunity(id, zc); - - return zc; - } - - public CommunityOpenAIRECommunities getOpenAIRECommunities(final String zenodoId) throws CommunityException, ResourceNotFoundException { - - if (cci.getInverseZenodoCommunityMap().containsKey(zenodoId)) { - return new CommunityOpenAIRECommunities().setZenodoid(zenodoId) - .setOpenAirecommunitylist(cci.getInverseZenodoCommunityMap().get(zenodoId).stream().collect(Collectors.toList())); - } - return new CommunityOpenAIRECommunities(); - - } - - // HELPERS - - private TreeMap getCommunityProjectMap(final String id) throws CommunityException, ResourceNotFoundException { - return getCommunityProjects(id).stream() - .collect(Collectors.toMap(p -> Integer.valueOf(p.getId()), Functions.identity(), (p1, p2) -> { - log.warn(String.format("duplicate project found: '%s'", p1.getId())); - return p2; - }, TreeMap::new)); - } - - private TreeMap getCommunityContentproviderMap(final String id) throws CommunityException, ResourceNotFoundException { - log.info("getting community content provider map"); - return getCommunityContentproviders(id).stream() - .collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> { - log.warn(String.format("duplicate content provider found: '%s'", cp1.getId())); - return cp2; - }, TreeMap::new)); - } - - private TreeMap getZenodoCommunityMap(final String id) throws CommunityException, ResourceNotFoundException { - return getCommunityZenodoCommunities(id).stream() - .collect(Collectors.toMap(cp -> Integer.valueOf(cp.getId()), Functions.identity(), (cp1, cp2) -> { - log.warn(String.format("duplicate Zenodo community found: '%s'", cp1.getId())); - return cp2; - }, TreeMap::new)); - } - - private TreeMap getCommunityOrganizationMap(final String id) throws CommunityException, ResourceNotFoundException { - return getCommunityOrganizations(id).stream() - .collect(Collectors.toMap(o -> Integer.valueOf(o.getId()), Functions.identity(), (o1, o2) -> { - log.warn(String.format("duplicate content provider found: '%s'", o1.getId())); - return o2; - }, TreeMap::new)); - } - - public CommunityOrganization addCommunityOrganization(final String id, final CommunityOrganization organization) - throws CommunityException, ResourceNotFoundException { - if (!StringUtils.equalsIgnoreCase(id, organization.getCommunityId())) { - throw new CommunityException("parameters 'id' and organization.communityId must be coherent"); - } - - final TreeMap cps = getCommunityOrganizationMap(id); - - final String organization_id = organization.getId(); - if (organization_id != null && cps.keySet().contains(Integer.valueOf(organization_id))) { - if (organization.getName() != null) { - isClient.updateConceptParam(id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization_id, CORGANIZATION_NAME, organization.getName()); - } - if (organization.getLogo_url() != null) { - isClient.updateConceptParam(id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization_id, CORGANIZATION_LOGOURL, Base64.getEncoder() - .encodeToString(organization.getLogo_url().getBytes())); - } - if (organization.getWebsite_url() != null) { - isClient.updateConceptParam(id + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization_id, CORGANIZATION_WEBSITEURL, Base64.getEncoder() - .encodeToString(organization.getWebsite_url().getBytes())); - } - } else { - organization.setId(nextId(!cps.isEmpty() ? cps.lastKey() : 0)); - isClient.addConcept(id, id + ORGANIZATION_ID_SUFFIX, CommunityMappingUtils.asOrganizationXML(id, organization)); - } - - cc.updateOrganization(id, organization); - return organization; - } - - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClient.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClient.java deleted file mode 100644 index 4b028a20..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClient.java +++ /dev/null @@ -1,15 +0,0 @@ -package eu.dnetlib.openaire.community; - -import java.util.Map; -import java.util.Set; - -import eu.dnetlib.openaire.exporter.exceptions.CommunityException; -import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; - -public interface CommunityClient { - - Map> getInverseZenodoCommunityMap() throws CommunityException, ResourceNotFoundException; - - void dropCache(); - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClientImpl.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClientImpl.java deleted file mode 100644 index 06ff04f6..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityClientImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package eu.dnetlib.openaire.community; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import eu.dnetlib.openaire.exporter.exceptions.CommunityException; -import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; -import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; -import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; - -import java.util.*; - -@Component -public class CommunityClientImpl implements CommunityClient { - - private static final Log log = LogFactory.getLog(CommunityClient.class); - - @Autowired - private CommunityCommon communityCommon; - - @Override - @Cacheable("community-cache") - public Map> getInverseZenodoCommunityMap () throws CommunityException, ResourceNotFoundException { - log.info("Creating the data structure. Not using cache"); - final Map> inverseListMap = new HashMap<>(); - - final List communityList = communityCommon.listCommunities(); - - for(CommunitySummary cs :communityList){ - final String communityId = cs.getId(); - List czc = communityCommon.getCommunityZenodoCommunities(communityId); - for(CommunityZenodoCommunity zc:czc){ - final String zenodoId = zc.getZenodoid(); - if(!inverseListMap.containsKey(zenodoId)) { - inverseListMap.put(zc.getZenodoid(),new HashSet<>()); - } - inverseListMap.get(zc.getZenodoid()).add(communityId); - } - final String zenodoMainCommunity = communityCommon.getCommunity(communityId).getZenodoCommunity(); - if(!inverseListMap.containsKey(zenodoMainCommunity)) { - inverseListMap.put(zenodoMainCommunity,new HashSet<>()); - } - - inverseListMap.get(zenodoMainCommunity).add(communityId); - } - return inverseListMap; - } - - - - @Override - @CacheEvict(cacheNames = { "community-cache", "context-cache-community"}, allEntries = true) - @Scheduled(fixedDelayString = "${openaire.exporter.cache.ttl}") - public void dropCache(){ - log.debug("dropped community cache"); - } - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityCommon.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityCommon.java deleted file mode 100644 index 1274e058..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityCommon.java +++ /dev/null @@ -1,489 +0,0 @@ -package eu.dnetlib.openaire.community; - -import com.google.common.base.Joiner; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import eu.dnetlib.openaire.common.ISClient; -import eu.dnetlib.openaire.exporter.exceptions.CommunityException; -import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; -import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; -import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; -import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; -import eu.dnetlib.openaire.exporter.model.community.CommunityProject; -import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; -import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties; -import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; -import eu.dnetlib.openaire.exporter.model.context.Category; -import eu.dnetlib.openaire.exporter.model.context.Concept; -import eu.dnetlib.openaire.exporter.model.context.Context; -import eu.dnetlib.openaire.exporter.model.context.Param; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static eu.dnetlib.openaire.community.CommunityConstants.*; - - -@Component -public class CommunityCommon { - - @Autowired - private ISClient isClient; - - public Map getContextMap() throws CommunityException { - try { - return isClient.getCommunityContextMap(); - } catch (IOException e) { - throw new CommunityException(e); - } - } - - public List listCommunities() throws CommunityException { - return getContextMap().values().stream() - .filter(context -> !communityBlackList.contains(context.getId())) - .map(CommunityMappingUtils::asCommunitySummary) - .collect(Collectors.toList()); - } - - - public List getCommunityInfo(final String id, final String idSuffix, final Function mapping) throws CommunityException { - final Map contextMap = getContextMap(); - final Context context = contextMap.get(id); - if (context != null) { - final Map categories = context.getCategories(); - final Category category = categories.get(id + idSuffix); - if (category != null) { - return category.getConcepts().stream() - .map(mapping) - .collect(Collectors.toList()); - } - } - return Lists.newArrayList(); - } - - public CommunityDetails getCommunity(final String id) throws CommunityException, ResourceNotFoundException { - final Context context = getContextMap().get(id); - if (context == null || CommunityConstants.communityBlackList.contains(id)) { - //ResponseStatusException(NOT_FOUND, "Unable to find resource"); - throw new ResourceNotFoundException(); - } - return CommunityMappingUtils.asCommunityProfile(context); - } - - public List getCommunityZenodoCommunities(final String id) throws CommunityException, ResourceNotFoundException { - getCommunity(id); // ensure the community exists. - return getCommunityInfo(id, ZENODOCOMMUNITY_ID_SUFFIX, c -> CommunityMappingUtils.asCommunityZenodoCommunity(id, c)); - } - - - public void updateProject(String communityId, CommunityProject project) throws CommunityException { - final Context context = getContextMap().get(communityId); - Category prj = context.getCategories().get(communityId + PROJECTS_ID_SUFFIX); - if (prj.getConcepts().stream().map(c -> c.getId()).collect(Collectors.toList()) - .contains(communityId + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project.getId())){ - prj.getConcepts().forEach(concept -> { - if (concept.getId().equals(communityId + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project.getId())) { - if (project.getName() != null) { - - concept.getParams().replace(CPROJECT_FULLNAME, Arrays.asList(new Param() - .setName(CPROJECT_FULLNAME).setValue(project.getName()))); - } - if (project.getAcronym() != null) { - if(concept.getParams().keySet().contains(CPROJECT_ACRONYM)){ - concept.getParams().replace(CPROJECT_ACRONYM, Arrays.asList(new Param() - .setName(CPROJECT_ACRONYM).setValue(project.getAcronym()))); - } - else{ - concept.getParams().put(CPROJECT_ACRONYM, Arrays.asList(new Param() - .setName(CPROJECT_ACRONYM).setValue(project.getAcronym()))); - } - - } - if (project.getOpenaireId() != null) { - if(concept.getParams().keySet().contains(OPENAIRE_ID)){ - concept.getParams().replace(OPENAIRE_ID, Arrays.asList(new Param() - .setName(OPENAIRE_ID).setValue(project.getOpenaireId()))); - } - else{ - concept.getParams().put(OPENAIRE_ID, Arrays.asList(new Param() - .setName(OPENAIRE_ID).setValue(project.getOpenaireId()))); - } - - } - if (project.getFunder() != null) { - concept.getParams().replace(CPROJECT_FUNDER, Arrays.asList(new Param() - .setName(CPROJECT_FUNDER).setValue(project.getFunder()))); - } - if (project.getGrantId() != null) { - concept.getParams().replace(CPROJECT_NUMBER, Arrays.asList(new Param() - .setName(CPROJECT_NUMBER).setValue(project.getGrantId()))); - - } - } - }); - } - else{ - Concept concept = new Concept(); - concept.setId(communityId + PROJECTS_ID_SUFFIX + ID_SEPARATOR + project.getId()); - concept.setClaim(false); - if(project.getAcronym() != null) - concept.setLabel(project.getAcronym()); - else - concept.setLabel(""); - - Map> params = new TreeMap<>(); - - if(project.getAcronym() != null){ - params.put(CPROJECT_ACRONYM, Arrays.asList(new Param().setName(CPROJECT_ACRONYM) - .setValue(project.getAcronym()))); - } - - if (project.getName() != null){ - params.put(CPROJECT_FULLNAME, Arrays.asList(new Param() - .setName(CPROJECT_FULLNAME) - .setValue(project.getName()) - )); - } - - if (project.getOpenaireId() != null){ - params.put(OPENAIRE_ID, Arrays.asList(new Param() - .setName(OPENAIRE_ID) - .setValue(project.getOpenaireId()) - )); - } - - if(project.getFunder() != null){ - params.put(CPROJECT_FUNDER, Arrays.asList(new Param() - .setName(CPROJECT_FUNDER) - .setValue(project.getFunder()) - )); - } - - if (project.getGrantId()!=null){ - params.put(CPROJECT_NUMBER, Arrays.asList(new Param() - .setName(CPROJECT_NUMBER) - .setValue(project.getGrantId()) - )); - } - - concept.setParams(params); - prj.getConcepts().add(concept); - - - } - - } - - public void removeAdvancedConstraint(String id) throws CommunityException { - final Context context = getContextMap().get(id); - context.getParams() - .replace(CPROFILE_ADVANCED_CONSTRAINT, Arrays.asList(new Param() - .setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(null))); - } - - public void updateCommunity(String id, CommunityWritableProperties community) throws CommunityException { - final Context context = getContextMap().get(id); - - if(community.getShortName() != null) { - context.setLabel(community.getShortName()); - } - - if (community.getName() != null){ - context.getParams().replace(CSUMMARY_NAME, Arrays.asList(new Param() - .setValue(community.getName()).setName(CSUMMARY_NAME))); - } - if(community.getDescription() != null) { - context.getParams() - .replace(CSUMMARY_DESCRIPTION, Arrays.asList(new Param() - .setName(CSUMMARY_DESCRIPTION).setValue(community.getDescription()))); - } - if(community.getLogoUrl() != null){ - context.getParams() - .replace(CSUMMARY_LOGOURL, Arrays.asList(new Param() - .setName(CSUMMARY_LOGOURL).setValue(community.getLogoUrl()))); - - } - if (community.getStatus() != null) { - context.getParams() - .replace(CSUMMARY_STATUS, Arrays.asList(new Param() - .setName(CSUMMARY_STATUS).setValue(community.getStatus().name()))); - } - if (community.getSubjects() != null) { - context.getParams() - .replace(CPROFILE_SUBJECT, Arrays.asList(new Param().setName(CPROFILE_SUBJECT) - .setValue(Joiner.on(CSV_DELIMITER) - .join(community.getSubjects())))); - } - if(community.getFos() != null){ - if (context.getParams().containsKey(CPROFILE_FOS)) - context.getParams() - .replace(CPROFILE_FOS, Arrays.asList(new Param().setName(CPROFILE_FOS) - .setValue(Joiner.on(CSV_DELIMITER) - .join(community.getFos())))); - else - context.getParams().put(CPROFILE_FOS, Arrays.asList(new Param().setName(CPROFILE_FOS) - .setValue(Joiner.on(CSV_DELIMITER) - .join(community.getFos())))); - } - if(community.getSdg() != null){ - if(context.getParams().containsKey(CPROFILE_SDG)) - context.getParams() - .replace(CPROFILE_SDG, Arrays.asList(new Param().setName(CPROFILE_SDG) - .setValue(Joiner.on(CSV_DELIMITER) - .join(community.getSdg())))); - else - context.getParams().put(CPROFILE_SDG, Arrays.asList(new Param().setName(CPROFILE_SDG) - .setValue(Joiner.on(CSV_DELIMITER) - .join(community.getSdg())))); - } - if (community.getAdvancedConstraints() != null) { - if(context.getParams().containsKey(CPROFILE_ADVANCED_CONSTRAINT)) - context.getParams() - .replace(CPROFILE_ADVANCED_CONSTRAINT, Arrays.asList(new Param() - .setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraints())))); - else - context.getParams().put(CPROFILE_ADVANCED_CONSTRAINT, Arrays.asList(new Param() - .setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraints())))); - } - if(community.getMainZenodoCommunity() != null){ - context.getParams() - .replace(CSUMMARY_ZENODOC, Arrays.asList(new Param() - .setName(CSUMMARY_ZENODOC).setValue(community.getMainZenodoCommunity()))); - - } - - } - - - public void removeFromCategory(String communityId, String category, String conceptId) throws CommunityException { - Map cmap = getContextMap(); - Context context = cmap.get(communityId); - Map cat = context.getCategories(); - - List concepts = cat.get(communityId + category).getConcepts() - .stream().filter(c -> !c.getId().equals(communityId + category + ID_SEPARATOR + conceptId)).collect(Collectors.toList()); - - cat.get(communityId + category).setConcepts(concepts); - } - - public void updateDatasource(String communityId, CommunityContentprovider cp) throws CommunityException { - final Context context = getContextMap().get(communityId); - Category dts = context.getCategories().get(communityId + CONTENTPROVIDERS_ID_SUFFIX); - if (dts.getConcepts().stream().map(c -> c.getId()).collect(Collectors.toList()) - .contains(communityId + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + cp.getId())){ - dts.getConcepts().forEach(concept -> { - if (concept.getId().equals(communityId + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + cp.getId())) { - - - if (cp.getName() != null) { - if(concept.getParams().keySet().contains(CCONTENTPROVIDER_NAME)){ - concept.getParams().replace(CCONTENTPROVIDER_NAME, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_NAME).setValue(cp.getName()))); - } - else{ - concept.getParams().put(CCONTENTPROVIDER_NAME, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_NAME).setValue(cp.getName()))); - } - - } - if (cp.getOfficialname() != null) { - if(concept.getParams().keySet().contains(CCONTENTPROVIDER_OFFICIALNAME)){ - concept.getParams().replace(CCONTENTPROVIDER_OFFICIALNAME, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_OFFICIALNAME).setValue(cp.getOfficialname()))); - } - else{ - concept.getParams().put(CCONTENTPROVIDER_OFFICIALNAME, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_OFFICIALNAME).setValue(cp.getOfficialname()))); - } - - } - - - if (cp.getOpenaireId() != null) { - if(concept.getParams().keySet().contains(OPENAIRE_ID)){ - concept.getParams().replace(OPENAIRE_ID, Arrays.asList(new Param() - .setName(OPENAIRE_ID).setValue(cp.getOpenaireId()))); - } - else{ - concept.getParams().put(OPENAIRE_ID, Arrays.asList(new Param() - .setName(OPENAIRE_ID).setValue(cp.getOpenaireId()))); - } - - } - - if (cp.getSelectioncriteria() != null) { - if(concept.getParams().keySet().contains(CCONTENTPROVIDER_SELCRITERIA)){ - concept.getParams().replace(CCONTENTPROVIDER_SELCRITERIA, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_SELCRITERIA).setValue(cp.toJson()))); - } - else{ - concept.getParams().put(CCONTENTPROVIDER_SELCRITERIA, Arrays.asList(new Param() - .setName(CCONTENTPROVIDER_SELCRITERIA).setValue(cp.toJson()))); - } - - } - } - }); - } - else{ - Concept concept = new Concept(); - concept.setId(communityId + CONTENTPROVIDERS_ID_SUFFIX + ID_SEPARATOR + cp.getId()); - concept.setClaim(false); - concept.setLabel(""); - - Map> params = new TreeMap<>(); - - if (cp.getName() != null) { - params.put( CCONTENTPROVIDER_NAME, Arrays.asList(new Param().setValue(cp.getName()).setName(CCONTENTPROVIDER_NAME))); - } - if(cp.getOfficialname()!= null){ - params.put( CCONTENTPROVIDER_OFFICIALNAME, Arrays.asList(new Param().setValue(cp.getOfficialname()).setName(CCONTENTPROVIDER_OFFICIALNAME))); - } - if (cp.getOpenaireId() != null){ - params.put( OPENAIRE_ID, Arrays.asList(new Param().setValue(cp.getOpenaireId()).setName(OPENAIRE_ID))); - } - if(cp.getSelectioncriteria() != null){ - params.put( CCONTENTPROVIDER_SELCRITERIA, Arrays.asList(new Param().setValue(cp.toJson()).setName(CCONTENTPROVIDER_SELCRITERIA))); - - } - - concept.setParams(params); - dts.getConcepts().add(concept); - - - } - - } - - public void updateOrganization(String communityId, CommunityOrganization organization) throws CommunityException { - - final Context context = getContextMap().get(communityId); - Category orgs = context.getCategories().get(communityId + ORGANIZATION_ID_SUFFIX); - if (orgs.getConcepts().stream().map(c -> c.getId()).collect(Collectors.toList()) - .contains(communityId + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization.getId())){ - orgs.getConcepts().forEach(concept -> { - if (concept.getId().equals(communityId + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization.getId())) { - - - if (organization.getName() != null) { - if(concept.getParams().keySet().contains(CORGANIZATION_NAME)){ - concept.getParams().replace(CORGANIZATION_NAME, Arrays.asList(new Param() - .setName(CORGANIZATION_NAME).setValue(organization.getName()))); - } - else{ - concept.getParams().put(CORGANIZATION_NAME, Arrays.asList(new Param() - .setName(CORGANIZATION_NAME).setValue(organization.getName()))); - } - - } - if (organization.getLogo_url() != null) { - if(concept.getParams().keySet().contains(CORGANIZATION_LOGOURL)){ - concept.getParams().replace(CORGANIZATION_LOGOURL, Arrays.asList(new Param() - .setName(CORGANIZATION_LOGOURL).setValue(Base64.getEncoder().encodeToString(organization.getLogo_url().getBytes())))); - } - else{ - concept.getParams().put(CORGANIZATION_LOGOURL, Arrays.asList(new Param() - .setName(CORGANIZATION_LOGOURL).setValue(Base64.getEncoder().encodeToString(organization.getLogo_url().getBytes())))); - } - - } - - - if (organization.getWebsite_url() != null) { - if(concept.getParams().keySet().contains(CORGANIZATION_WEBSITEURL)){ - concept.getParams().replace(CORGANIZATION_WEBSITEURL, Arrays.asList(new Param() - .setName(CORGANIZATION_WEBSITEURL).setValue(Base64.getEncoder().encodeToString(organization.getWebsite_url().getBytes())))); - } - else{ - concept.getParams().put(CORGANIZATION_WEBSITEURL, Arrays.asList(new Param() - .setName(CORGANIZATION_WEBSITEURL).setValue(Base64.getEncoder().encodeToString(organization.getWebsite_url().getBytes())))); - } - - } - - } - - }); - } - else{ - - Concept concept = new Concept(); - concept.setId(communityId + ORGANIZATION_ID_SUFFIX + ID_SEPARATOR + organization.getId()); - concept.setClaim(false); - concept.setLabel(""); - - Map> params = new TreeMap<>(); - - if (organization.getName() != null) { - params.put( CORGANIZATION_NAME, Arrays.asList(new Param().setValue(organization.getName()).setName(CORGANIZATION_NAME))); - } - if(organization.getLogo_url()!= null){ - - params.put( CORGANIZATION_LOGOURL, Arrays.asList(new Param().setValue(Base64.getEncoder().encodeToString(organization.getLogo_url().getBytes())).setName(CORGANIZATION_LOGOURL))); - } - if (organization.getWebsite_url() != null){ - params.put( CORGANIZATION_WEBSITEURL, Arrays.asList(new Param().setValue(Base64.getEncoder().encodeToString(organization.getWebsite_url().getBytes())).setName(CORGANIZATION_WEBSITEURL))); - } - - - concept.setParams(params); - orgs.getConcepts().add(concept); - - - } - - } - - public void updateZenodoCommunity(String communityId, CommunityZenodoCommunity zc) throws CommunityException { - final Context context = getContextMap().get(communityId); - Category zcs = context.getCategories().get(communityId + ZENODOCOMMUNITY_ID_SUFFIX); - if (zcs.getConcepts().stream().map(c -> c.getId()).collect(Collectors.toList()) - .contains(communityId + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zc.getId())){ - zcs.getConcepts().forEach(concept -> { - if (concept.getId().equals(communityId + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zc.getId())) { - - - if (zc.getZenodoid() != null) { - if(concept.getParams().keySet().contains(CZENODOCOMMUNITY_ID)){ - concept.getParams().replace(CZENODOCOMMUNITY_ID, Arrays.asList(new Param() - .setName(CZENODOCOMMUNITY_ID).setValue(zc.getZenodoid()))); - } - else{ - concept.getParams().put(CZENODOCOMMUNITY_ID, Arrays.asList(new Param() - .setName(CZENODOCOMMUNITY_ID).setValue(zc.getZenodoid()))); - } - - } - - } - - }); - } - else{ - - Concept concept = new Concept(); - concept.setId(communityId + ZENODOCOMMUNITY_ID_SUFFIX + ID_SEPARATOR + zc.getId()); - concept.setClaim(false); - - - Map> params = new TreeMap<>(); - - if (zc.getZenodoid() != null) { - params.put( CZENODOCOMMUNITY_ID, Arrays.asList(new Param().setValue(zc.getZenodoid()).setName(CZENODOCOMMUNITY_ID))); - concept.setLabel(zc.getZenodoid()); - }else{ - concept.setLabel(""); - } - concept.setParams(params); - zcs.getConcepts().add(concept); - - } - - } - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityConstants.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityConstants.java deleted file mode 100644 index 2bbd751e..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityConstants.java +++ /dev/null @@ -1,61 +0,0 @@ -package eu.dnetlib.openaire.community; - -import java.util.Set; - -import com.google.common.collect.Sets; - -public class CommunityConstants { - - public final static Set communityBlackList = Sets.newHashSet("fet-fp7", "fet-h2020"); - - // common - public final static String OPENAIRE_ID = "openaireId"; - public final static String PIPE_SEPARATOR = "||"; - public final static String ID_SEPARATOR = "::"; - public final static String CSV_DELIMITER = ","; - public final static String CLABEL = "label"; - - // id suffixes - public final static String PROJECTS_ID_SUFFIX = ID_SEPARATOR + "projects"; - public final static String CONTENTPROVIDERS_ID_SUFFIX = ID_SEPARATOR + "contentproviders"; - public final static String ZENODOCOMMUNITY_ID_SUFFIX = ID_SEPARATOR + "zenodocommunities"; - public final static String ORGANIZATION_ID_SUFFIX = ID_SEPARATOR + "organizations"; - - // community summary - public final static String CSUMMARY_DESCRIPTION = "description"; - public final static String CSUMMARY_LOGOURL = "logourl"; - public final static String CSUMMARY_STATUS = "status"; - public final static String CSUMMARY_NAME = "name"; - public final static String CSUMMARY_MANAGER = "manager"; - public final static String CSUMMARY_ZENODOC = "zenodoCommunity"; - - // community profile - public final static String CPROFILE_SUBJECT = "subject"; - public final static String CPROFILE_CREATIONDATE = "creationdate"; - public final static String CPROFILE_FOS = "fos"; - public final static String CPROFILE_SDG = "sdg"; - public final static String CPROFILE_ADVANCED_CONSTRAINT = "advancedConstraints"; - - // community project - public final static String CPROJECT_FUNDER = "funder"; - public final static String CPROJECT_NUMBER = "CD_PROJECT_NUMBER"; - public final static String CPROJECT_FULLNAME = "projectfullname"; - public final static String CPROJECT_ACRONYM = "acronym"; - - // community content provider - public final static String CCONTENTPROVIDER_NAME = "name"; - public final static String CCONTENTPROVIDER_OFFICIALNAME = "officialname"; - public final static String CCONTENTPROVIDER_ENABLED = "enabled"; - public final static String CCONTENTPROVIDERENABLED_DEFAULT = "true"; - public final static String CCONTENTPROVIDER_SELCRITERIA = "selcriteria"; - - //community zenodo community - public final static String CZENODOCOMMUNITY_ID = "zenodoid"; - - //community organization - public final static String CORGANIZATION_NAME = "name"; - public final static String CORGANIZATION_LOGOURL = "logourl"; - public final static String CORGANIZATION_WEBSITEURL = "websiteurl"; - - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityMappingUtils.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityMappingUtils.java deleted file mode 100644 index fb5da147..00000000 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityMappingUtils.java +++ /dev/null @@ -1,251 +0,0 @@ -package eu.dnetlib.openaire.community; - -import java.text.ParseException; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.google.common.escape.Escaper; -import com.google.common.xml.XmlEscapers; - -import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; -import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; -import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; -import eu.dnetlib.openaire.exporter.model.community.CommunityProject; -import eu.dnetlib.openaire.exporter.model.community.CommunityStatus; -import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; -import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity; -import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; -import eu.dnetlib.openaire.exporter.model.context.Concept; -import eu.dnetlib.openaire.exporter.model.context.Context; -import eu.dnetlib.openaire.exporter.model.context.Param; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import static eu.dnetlib.openaire.common.Utils.escape; -import static eu.dnetlib.openaire.community.CommunityConstants.*; - -public class CommunityMappingUtils { - - private final static String pattern = "yyyy-MM-dd'T'hh:mm:ss"; - - private static final Log log = LogFactory.getLog(CommunityMappingUtils.class); - - public static CommunitySummary asCommunitySummary(final Context c) { - final CommunitySummary summary = new CommunitySummary(); - - summary.setId(c.getId()); - summary.setShortName(c.getLabel()); - summary.setLastUpdateDate(c.getLastUpdateDate()); - summary.setCreationDate(c.getCreationDate()); - summary.setQueryId(c.getId() + PIPE_SEPARATOR + c.getLabel()); - summary.setType(c.getType()); - - final Map> params = c.getParams(); - if (params.containsKey(CSUMMARY_DESCRIPTION)) { - summary.setDescription(asCsv(params.get(CSUMMARY_DESCRIPTION))); - } - if (params.containsKey(CSUMMARY_LOGOURL)) { - summary.setLogoUrl(asCsv(params.get(CSUMMARY_LOGOURL))); - } - if (params.containsKey(CSUMMARY_STATUS)) { - summary.setStatus(CommunityStatus.valueOf(firstValue(params, CSUMMARY_STATUS))); - } - if (params.containsKey(CSUMMARY_NAME)) { - summary.setName(asCsv(params.get(CSUMMARY_NAME))); - } - if (params.containsKey(CSUMMARY_ZENODOC)) { - summary.setZenodoCommunity(asCsv(params.get(CSUMMARY_ZENODOC))); - } - - return summary; - } - - public static CommunityDetails asCommunityProfile(final Context c) { - - final CommunityDetails p = new CommunityDetails(asCommunitySummary(c)); - p.setLastUpdateDate(c.getLastUpdateDate()); - final Map> params = c.getParams(); - if (params.containsKey(CPROFILE_SUBJECT)) { - p.setSubjects(splitValues(asValues(params.get(CPROFILE_SUBJECT)), CSV_DELIMITER)); - } - if (params.containsKey(CPROFILE_FOS)) { - p.setFos(splitValues(asValues(params.get(CPROFILE_FOS)), CSV_DELIMITER)); - } - if (params.containsKey(CPROFILE_SDG)) { - p.setSdg(splitValues(asValues(params.get(CPROFILE_SDG)), CSV_DELIMITER)); - } - if (params.containsKey(CPROFILE_ADVANCED_CONSTRAINT)) { - //In the map the string is the serialization of the json representing the selection criteria so it is a valid json - p.setAdvancedConstraints(SelectionCriteria.fromJson(asCsv(params.get(CPROFILE_ADVANCED_CONSTRAINT)))); - - } - if (params.containsKey(CPROFILE_CREATIONDATE)){ - try { - p.setCreationDate(org.apache.commons.lang3.time.DateUtils.parseDate(asCsv(params.get(CPROFILE_CREATIONDATE)), pattern)); - }catch(ParseException e) { - log.debug("Exception on date format: " + e.getMessage()); - } - } - - return p; - } - - public static CommunityProject asCommunityProject(final String communityId, final Concept c) { - - final Map> p = c.getParams(); - final CommunityProject project = new CommunityProject(); - project.setCommunityId(communityId); - project.setId(StringUtils.substringAfterLast(c.getId(), ID_SEPARATOR)); - project.setOpenaireId(firstValue(p, OPENAIRE_ID)); - project.setFunder(firstValue(p, CPROJECT_FUNDER)); - project.setGrantId(firstValue(p, CPROJECT_NUMBER)); - project.setName(firstValue(p, CPROJECT_FULLNAME)); - project.setAcronym(firstValue(p, CPROJECT_ACRONYM)); - - return project; - } - - public static CommunityContentprovider asCommunityDataprovider(final String communityId, final Concept c) { - - final Map> p = c.getParams(); - final CommunityContentprovider d = new CommunityContentprovider(); - d.setCommunityId(communityId); - d.setId(StringUtils.substringAfterLast(c.getId(), ID_SEPARATOR)); - d.setOpenaireId(firstValue(p, OPENAIRE_ID)); - d.setName(firstValue(p, CCONTENTPROVIDER_NAME)); - d.setOfficialname(firstValue(p, CCONTENTPROVIDER_OFFICIALNAME)); - d.setSelectioncriteria(SelectionCriteria.fromJson(firstValue(p, CCONTENTPROVIDER_SELCRITERIA))); - return d; - } - - public static CommunityZenodoCommunity asCommunityZenodoCommunity(final String communityId, final Concept c){ - final CommunityZenodoCommunity z = new CommunityZenodoCommunity(); - final Map> p = c.getParams(); - z.setCommunityId(communityId); - z.setId(StringUtils.substringAfterLast(c.getId(), ID_SEPARATOR)); - z.setZenodoid(firstValue(p,CZENODOCOMMUNITY_ID)); - //z.setName(c.getLabel()); - return z; - } - - - public static CommunityOrganization asCommunityOrganization(String id, Concept c) { - final Map> p = c.getParams(); - final CommunityOrganization o = new CommunityOrganization(); - o.setCommunityId(id); - o.setId(StringUtils.substringAfterLast(c.getId(), ID_SEPARATOR)); - o.setName(firstValue(p,CORGANIZATION_NAME)); - o.setLogo_url(getDecodedUrl(firstValue(p,CORGANIZATION_LOGOURL))); - o.setWebsite_url(getDecodedUrl(firstValue(p,CORGANIZATION_WEBSITEURL))); - - return o; - } - - private static String getDecodedUrl(final String encoded_url){ - if(encoded_url == null){ - return encoded_url; - } - return new String(Base64.getDecoder().decode(encoded_url)); - } - - - private static List splitValues(final Stream stream, final String separator) { - return stream.map(s -> s.split(separator)) - .map(Arrays::asList) - .flatMap(List::stream) - .filter(StringUtils::isNotBlank) - .map(StringUtils::trim) - .collect(Collectors.toList()); - } - - private static String firstValue(final Map> p, final String paramName) { - return asValues(p.get(paramName)).findFirst().orElse(null); - } - - private static String asCsv(final List params) { - return asValues(params) - .collect(Collectors.joining(CSV_DELIMITER)); - } - - private static Stream asValues(final List params) { - return params == null ? Stream.empty() : params.stream() - .map(Param::getValue) - .map(StringUtils::trim) - .distinct(); - } - - public static String asProjectXML(final String contextId, final CommunityProject project) { - final Escaper esc = XmlEscapers.xmlAttributeEscaper(); - final StringBuilder sb = new StringBuilder(); - sb.append( - String.format( - "\n", - escape(esc, contextId), PROJECTS_ID_SUFFIX, ID_SEPARATOR, escape(esc, String.valueOf(project.getId())), escape(esc, project.getAcronym()))); - sb.append(paramXML(CPROJECT_FULLNAME, project.getName())); - sb.append(paramXML(CPROJECT_ACRONYM, project.getAcronym())); - sb.append(paramXML(CPROJECT_NUMBER, project.getGrantId())); - sb.append(paramXML(CPROJECT_FUNDER, project.getFunder())); - sb.append(paramXML(OPENAIRE_ID, project.getOpenaireId())); - sb.append("\n"); - return sb.toString(); - } - - public static String asContentProviderXML(final String contextId, final CommunityContentprovider ccp) { - log.info("creating the XML for the content provider"); - final Escaper esc = XmlEscapers.xmlAttributeEscaper(); - final StringBuilder sb = new StringBuilder(); - sb.append( - String.format( - "\n", - escape(esc, contextId), CONTENTPROVIDERS_ID_SUFFIX, ID_SEPARATOR, escape(esc, String.valueOf(ccp.getId())), escape(esc, ccp.getName()))); - sb.append(paramXML(OPENAIRE_ID, ccp.getOpenaireId())); - sb.append(paramXML(CCONTENTPROVIDER_NAME, ccp.getName())); - sb.append(paramXML(CCONTENTPROVIDER_OFFICIALNAME, ccp.getOfficialname())); - sb.append(paramXML(CCONTENTPROVIDER_ENABLED,CCONTENTPROVIDERENABLED_DEFAULT)); - sb.append(paramXMLNoEscape(CCONTENTPROVIDER_SELCRITERIA, ccp.toXML())); - sb.append("\n"); - log.info(sb.toString()); - return sb.toString(); - } - - public static String asZenodoCommunityXML(final String contextId, final CommunityZenodoCommunity zc) { - final Escaper esc = XmlEscapers.xmlAttributeEscaper(); - final StringBuilder sb = new StringBuilder(); - sb.append( - String.format( - "\n", - escape(esc, contextId), ZENODOCOMMUNITY_ID_SUFFIX, ID_SEPARATOR, escape(esc, String.valueOf(zc.getId())), escape(esc, zc.getZenodoid()))); - - sb.append(paramXML(CZENODOCOMMUNITY_ID, zc.getZenodoid())); - sb.append("\n"); - return sb.toString(); - } - - - public static String asOrganizationXML(final String contextId, CommunityOrganization organization) { - final Escaper esc = XmlEscapers.xmlAttributeEscaper(); - final StringBuilder sb = new StringBuilder(); - sb.append( - String.format( - "\n", - escape(esc, contextId), ORGANIZATION_ID_SUFFIX, ID_SEPARATOR, escape(esc, String.valueOf(organization.getId())), escape(esc, organization.getName()))); - sb.append(paramXML(CORGANIZATION_NAME, organization.getName())); - sb.append(paramXML(CORGANIZATION_LOGOURL, Base64.getEncoder().encodeToString(organization.getLogo_url().getBytes()))); - sb.append(paramXML(CORGANIZATION_WEBSITEURL,Base64.getEncoder().encodeToString(organization.getWebsite_url().getBytes()))); - sb.append("\n"); - return sb.toString(); - } - - - private static String paramXML(final String paramName, final String value) { - return String.format("%s\n", paramName, escape(XmlEscapers.xmlContentEscaper(), value)); - } - - private static String paramXMLNoEscape(final String paramName, final String value) { - return String.format("%s\n", paramName, value); - } - -} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityService.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityService.java new file mode 100644 index 00000000..defe39d1 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/CommunityService.java @@ -0,0 +1,472 @@ +package eu.dnetlib.openaire.community; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.persistence.criteria.Predicate; +import javax.transaction.Transactional; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; + +import eu.dnetlib.openaire.community.model.DbCommunity; +import eu.dnetlib.openaire.community.model.DbDatasource; +import eu.dnetlib.openaire.community.model.DbDatasourcePK; +import eu.dnetlib.openaire.community.model.DbOrganization; +import eu.dnetlib.openaire.community.model.DbProject; +import eu.dnetlib.openaire.community.model.DbProjectPK; +import eu.dnetlib.openaire.community.model.DbSubCommunity; +import eu.dnetlib.openaire.community.model.DbSupportOrg; +import eu.dnetlib.openaire.community.model.DbSupportOrgPK; +import eu.dnetlib.openaire.community.repository.DbCommunityRepository; +import eu.dnetlib.openaire.community.repository.DbDatasourceRepository; +import eu.dnetlib.openaire.community.repository.DbOrganizationRepository; +import eu.dnetlib.openaire.community.repository.DbProjectRepository; +import eu.dnetlib.openaire.community.repository.DbSubCommunityRepository; +import eu.dnetlib.openaire.community.repository.DbSupportOrgRepository; +import eu.dnetlib.openaire.community.utils.CommunityMappingUtils; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; +import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; +import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; +import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; +import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; +import eu.dnetlib.openaire.exporter.model.community.CommunityProject; +import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; +import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; +import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; +import eu.dnetlib.openaire.exporter.model.context.IISConfigurationEntry; + +@Service +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public class CommunityService { + + @Autowired + private DbCommunityRepository dbCommunityRepository; + @Autowired + private DbProjectRepository dbProjectRepository; + @Autowired + private DbDatasourceRepository dbDatasourceRepository; + @Autowired + private DbOrganizationRepository dbOrganizationRepository; + @Autowired + private DbSupportOrgRepository dbSupportOrgRepository; + @Autowired + private DbSubCommunityRepository dbSubCommunityRepository; + + private static final Log log = LogFactory.getLog(CommunityService.class); + + public List listCommunities() { + return dbCommunityRepository.findAll() + .stream() + .map(CommunityMappingUtils::toCommunitySummary) + .collect(Collectors.toList()); + } + + @Transactional + public CommunityDetails newCommunity(final CommunityDetails details) throws CommunityException { + if (StringUtils.isBlank(details.getId())) { + throw new CommunityException("Empty Id"); + } else if (dbCommunityRepository.existsById(details.getId())) { + throw new CommunityException("Community already exists: " + details.getId()); + } else { + details.setCreationDate(LocalDateTime.now()); + return saveCommunity(details); + } + + } + + @Transactional + public CommunityDetails saveCommunity(final CommunityDetails details) { + details.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(CommunityMappingUtils.toCommunity(details)); + return getCommunity(details.getId()); + } + + @Transactional + public CommunityDetails getCommunity(final String id) { + final DbCommunity c = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + return CommunityMappingUtils.toCommunityDetails(c); + } + + @Transactional + public void setCommunity(final String id, final CommunityWritableProperties details) { + final DbCommunity c = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + CommunityMappingUtils.populateCommunity(c, details); + c.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(c); + } + + @Transactional + public Page getCommunityProjects(final String id, + final String funder, + final String filter, + final int page, + final int size, + final String orderBy) throws CommunityException { + if (StringUtils.isBlank(id)) { throw new CommunityException("Empty ID"); } + try { + final Sort sort; + if (StringUtils.isBlank(orderBy)) { + sort = Sort.by("projectName"); + } else if (orderBy.equalsIgnoreCase("funder")) { + sort = Sort.by("projectFunder").and(Sort.by("projectName")); + } else if (orderBy.equalsIgnoreCase("grantId")) { + sort = Sort.by("projectCode"); + } else if (orderBy.equalsIgnoreCase("acronym")) { + sort = Sort.by("projectAcronym"); + } else if (orderBy.equalsIgnoreCase("openaireId")) { + sort = Sort.by("projectId"); + } else { + sort = Sort.by("projectName"); + } + + final PageRequest pageable = PageRequest.of(page, size, sort); + if (StringUtils.isAllBlank(filter, funder)) { + return dbProjectRepository.findByCommunity(id, pageable).map(CommunityMappingUtils::toCommunityProject); + } else { + final Specification projSpec = prepareProjectSpec(id, funder, filter); + return dbProjectRepository.findAll(projSpec, pageable).map(CommunityMappingUtils::toCommunityProject); + } + } catch (final Throwable e) { + log.error(e); + throw new CommunityException(e); + } + } + + private Specification prepareProjectSpec(final String community, final String funder, final String other) { + return (project, query, cb) -> { + + final List andConds = new ArrayList<>(); + andConds.add(cb.equal(project.get("community"), community)); + + if (StringUtils.isNotBlank(funder)) { + andConds.add(cb.equal(project.get("projectFunder"), funder)); + } + + if (StringUtils.isNotBlank(other)) { + final String s = other.toLowerCase().trim(); + + final List orConds = new ArrayList<>(); + orConds.add(cb.equal(cb.lower(project.get("projectId")), s)); + orConds.add(cb.equal(cb.lower(project.get("projectCode")), s)); + orConds.add(cb.equal(cb.lower(project.get("projectAcronym")), s)); + orConds.add(cb.like(cb.lower(project.get("projectName")), "%" + s + "%")); + if (StringUtils.isBlank(funder)) { + orConds.add(cb.equal(cb.lower(project.get("projectFunder")), s)); + } + + andConds.add(cb.or(orConds.toArray(new Predicate[orConds.size()]))); + } + + return cb.and(andConds.toArray(new Predicate[andConds.size()])); + }; + + } + + @Transactional + public CommunityProject addCommunityProject(final String id, final CommunityProject project) { + final DbProject p = CommunityMappingUtils.toDbProject(id, project); + dbProjectRepository.save(p); + return project; + } + + @Transactional + public void addCommunityProjects(final String id, final CommunityProject... projects) throws CommunityException { + try { + final List list = Arrays.stream(projects) + .map(p -> CommunityMappingUtils.toDbProject(id, p)) + .collect(Collectors.toList()); + + dbProjectRepository.saveAll(list); + } catch (final Throwable e) { + log.error(e); + throw new CommunityException(e); + } + } + + @Transactional + public void removeCommunityProjects(final String id, final String... ids) { + final List list = Arrays.stream(ids) + .map(projectId -> new DbProjectPK(id, projectId)) + .collect(Collectors.toList()); + dbProjectRepository.deleteAllById(list); + } + + public List getCommunityContentproviders(final String id) { + return dbDatasourceRepository.findByCommunity(id) + .stream() + .map(CommunityMappingUtils::toCommunityContentprovider) + .collect(Collectors.toList()); + } + + @Transactional + public void addCommunityContentProviders(final String id, final CommunityContentprovider... contentproviders) { + final List list = Arrays.stream(contentproviders) + .map(cp -> CommunityMappingUtils.toDbDatasource(id, cp)) + .collect(Collectors.toList()); + + dbDatasourceRepository.saveAll(list); + } + + @Transactional + public void removeCommunityContentProviders(final String id, final String... ids) { + final List list = Arrays.stream(ids) + .map(dsId -> new DbDatasourcePK(id, dsId)) + .collect(Collectors.toList()); + dbDatasourceRepository.deleteAllById(list); + } + + @Transactional + public void removeCommunityOrganizations(final String id, final String... orgNames) { + final List list = Arrays.stream(orgNames) + .map(name -> new DbSupportOrgPK(id, name)) + .collect(Collectors.toList()); + dbSupportOrgRepository.deleteAllById(list); + } + + @Transactional + public List getCommunityOrganizations(final String id) { + return dbSupportOrgRepository.findByCommunity(id) + .stream() + .map(CommunityMappingUtils::toCommunityOrganization) + .collect(Collectors.toList()); + } + + @Transactional + public void addCommunityOrganizations(final String id, final CommunityOrganization... orgs) { + final List list = Arrays.stream(orgs) + .map(o -> CommunityMappingUtils.toDbSupportOrg(id, o)) + .collect(Collectors.toList()); + + dbSupportOrgRepository.saveAll(list); + } + + @Transactional + public void removeSubCommunities(final String id, final String... subCommunityIds) { + dbSubCommunityRepository.deleteAllById(Arrays.asList(subCommunityIds)); + } + + @Transactional + public List getSubCommunities(final String id) { + return dbSubCommunityRepository.findByCommunity(id) + .stream() + .map(CommunityMappingUtils::toSubCommunity) + .collect(Collectors.toList()); + } + + @Transactional + public void addSubCommunities(final String id, final SubCommunity... subs) { + final List list = Arrays.stream(subs) + .map(s -> CommunityMappingUtils.toDbSubCommunity(id, s)) + .collect(Collectors.toList()); + + dbSubCommunityRepository.saveAll(list); + } + + @Transactional + public CommunityDetails addCommunitySubjects(final String id, final String... subjects) { + return modifyElementToArrayField(id, c -> c.getSubjects(), (c, subs) -> c.setSubjects(subs), false, subjects); + } + + public CommunityDetails removeCommunitySubjects(final String id, final String... subjects) { + return modifyElementToArrayField(id, c -> c.getSubjects(), (c, subs) -> c.setSubjects(subs), true, subjects); + } + + public CommunityDetails addCommunityFOS(final String id, final String... foss) { + return modifyElementToArrayField(id, c -> c.getFos(), (c, fos) -> c.setFos(fos), false, foss); + } + + public CommunityDetails removeCommunityFOS(final String id, final String... foss) { + return modifyElementToArrayField(id, c -> c.getFos(), (c, fos) -> c.setFos(fos), true, foss); + } + + public CommunityDetails addCommunitySDG(final String id, final String... sdgs) { + return modifyElementToArrayField(id, c -> c.getSdg(), (c, sdg) -> c.setSdg(sdg), false, sdgs); + } + + public CommunityDetails removeCommunitySDG(final String id, final String... sdgs) { + return modifyElementToArrayField(id, c -> c.getSdg(), (c, sdg) -> c.setSdg(sdg), true, sdgs); + } + + @Transactional + public CommunityDetails addCommunityAdvancedConstraint(final String id, final SelectionCriteria advancedCosntraint) { + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + dbEntry.setAdvancedConstraints(advancedCosntraint); + dbEntry.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(dbEntry); + return getCommunity(id); + } + + @Transactional + public CommunityDetails removeCommunityAdvancedConstraint(final String id) { + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + dbEntry.setAdvancedConstraints(null); + dbEntry.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(dbEntry); + return getCommunity(id); + } + + @Transactional + public CommunityDetails addCommunityRemoveConstraint(final String id, final SelectionCriteria removeConstraint) { + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + dbEntry.setRemoveConstraints(removeConstraint); + dbEntry.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(dbEntry); + return getCommunity(id); + } + + @Transactional + public CommunityDetails removeCommunityRemoveConstraint(final String id) { + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + dbEntry.setRemoveConstraints(null); + dbEntry.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(dbEntry); + return getCommunity(id); + } + + public CommunityDetails removeCommunityZenodoCommunity(final String id, final String zenodoCommunity, final boolean isMain) { + if (isMain) { + return updateElementToSimpleField(id, (c, val) -> c.setMainZenodoCommunity(val), null); + } else { + return modifyElementToArrayField(id, c -> c.getOtherZenodoCommunities(), (c, arr) -> c.setOtherZenodoCommunities(arr), true, zenodoCommunity); + } + } + + public CommunityDetails addCommunityZenodoCommunity(final String id, final String zenodoCommunity, final boolean isMain) { + if (isMain) { + return updateElementToSimpleField(id, (c, val) -> c.setMainZenodoCommunity(val), zenodoCommunity); + } else { + return modifyElementToArrayField(id, c -> c.getOtherZenodoCommunities(), (c, arr) -> c.setOtherZenodoCommunities(arr), false, zenodoCommunity); + } + } + + @Transactional + private CommunityDetails updateElementToSimpleField(final String id, + final BiConsumer setter, + final String value) { + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + setter.accept(dbEntry, value); + dbEntry.setLastUpdateDate(LocalDateTime.now()); + dbCommunityRepository.save(dbEntry); + return getCommunity(id); + } + + @Transactional + private CommunityDetails modifyElementToArrayField(final String id, + final Function getter, + final BiConsumer setter, + final boolean remove, + final String... values) { + + final DbCommunity dbEntry = dbCommunityRepository.findById(id).orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id)); + + final Set tmpList = new LinkedHashSet<>(); + final String[] oldValues = getter.apply(dbEntry); + if (oldValues != null) { + for (final String s : oldValues) { + tmpList.add(s); + } + } + if (remove) { + tmpList.removeAll(Arrays.asList(values)); + } else { + tmpList.addAll(Arrays.asList(values)); + } + + setter.accept(dbEntry, tmpList.toArray(new String[tmpList.size()])); + + dbEntry.setLastUpdateDate(LocalDateTime.now()); + + dbCommunityRepository.save(dbEntry); + + return getCommunity(id); + } + + @Transactional + public List getOpenAIRECommunitiesByZenodoId(final String zenodoId) { + return dbCommunityRepository.findByZenodoId(zenodoId); + } + + @Transactional + public Map> getPropagationOrganizationCommunityMap() { + return dbOrganizationRepository.findAll() + .stream() + .collect(Collectors.groupingBy(DbOrganization::getOrgId, Collectors.mapping(DbOrganization::getCommunity, Collectors.toSet()))); + } + + @Transactional + public Set getPropagationOrganizationsForCommunity(final String communityId) { + return dbOrganizationRepository.findByCommunity(communityId) + .stream() + .map(DbOrganization::getOrgId) + .collect(Collectors.toSet()); + } + + @Transactional + public Set addPropagationOrganizationForCommunity(final String communityId, final String... organizationIds) { + for (final String orgId : organizationIds) { + final DbOrganization o = new DbOrganization(communityId.trim(), orgId.trim()); + dbOrganizationRepository.save(o); + } + return getPropagationOrganizationsForCommunity(communityId); + } + + @Transactional + public Set removePropagationOrganizationForCommunity(final String communityId, final String... organizationIds) { + for (final String orgId : organizationIds) { + final DbOrganization o = new DbOrganization(communityId.trim(), orgId.trim()); + dbOrganizationRepository.delete(o); + } + return getPropagationOrganizationsForCommunity(communityId); + } + + @Transactional + public void deleteCommunity(final String id, final boolean recursive) { + if (recursive) { + dbProjectRepository.deleteByCommunity(id); + dbDatasourceRepository.deleteByCommunity(id); + dbOrganizationRepository.deleteByCommunity(id); + dbSupportOrgRepository.deleteByCommunity(id); + dbSubCommunityRepository.deleteByCommunity(id); + } + dbCommunityRepository.deleteById(id); + } + + @Transactional + public List getIISConfiguration(final String id) { + final List res = new ArrayList<>(); + + res.add(dbCommunityRepository.findById(id) + .map(CommunityMappingUtils::asIISConfigurationEntry) + .orElseThrow(() -> new ResourceNotFoundException("Community not found: " + id))); + + for (final DbSubCommunity subc : dbSubCommunityRepository.findByCommunity(id)) { + res.add(CommunityMappingUtils.asIISConfigurationEntry(subc)); + } + + return res; + } + + @Transactional + public List getCommunityFunders(final String id) { + return dbProjectRepository.findFundersByCommunity(id); + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterController.java new file mode 100644 index 00000000..3f7cefb6 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterController.java @@ -0,0 +1,87 @@ +package eu.dnetlib.openaire.community.importer; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import com.google.common.collect.Sets; + +import eu.dnetlib.common.controller.AbstractDnetController; +import eu.dnetlib.openaire.common.ISClient; +import eu.dnetlib.openaire.community.model.DbOrganization; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; +import eu.dnetlib.openaire.exporter.model.context.Context; +import io.swagger.v3.oas.annotations.tags.Tag; + +@RestController +@CrossOrigin(origins = { + "*" +}) +@ConditionalOnProperty(value = "openaire.exporter.enable.community.import", havingValue = "true") +@Tag(name = "OpenAIRE Communities: Migration API", description = "OpenAIRE Communities: Migration API") +public class CommunityImporterController extends AbstractDnetController { + + // public final static Set communityBlackList = Sets.newHashSet("fet-fp7", "fet-h2020"); + public final static Set communityBlackList = Sets.newHashSet(); + + @Autowired + private CommunityImporterService importer; + + @Autowired + private ISClient isClient; + + private static final Log log = LogFactory.getLog(CommunityImporterController.class); + + @GetMapping("/community_importer/communities") + public List importProfiles() throws CommunityException { + try { + final Map contextMap = getContextMap(); + + final List list = contextMap.keySet() + .stream() + .filter(id -> !communityBlackList.contains(id)) + .collect(Collectors.toList()); + + list.forEach(id -> { + importer.importCommunity(contextMap.get(id)); + }); + + return list; + } catch (final Throwable e) { + log.error("Error importing communities", e); + throw new CommunityException(e.getMessage()); + } + } + + @GetMapping("/community_importer/propagationOrgs") + public List importPropagationOrgs(@RequestParam final String profileId, + @RequestParam(required = false, defaultValue = "false") final boolean simulation) throws Exception { + try { + final String xml = isClient.getProfile(profileId); + return importer.importPropagationOrganizationsFromProfile(xml, simulation); + } catch (final Throwable e) { + log.error("Error importing communities", e); + throw new CommunityException(e.getMessage()); + } + } + + private Map getContextMap() throws CommunityException { + try { + return isClient.getCommunityContextMap(); + } catch (final IOException e) { + throw new CommunityException(e); + } + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterService.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterService.java new file mode 100644 index 00000000..224beee9 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/importer/CommunityImporterService.java @@ -0,0 +1,407 @@ +package eu.dnetlib.openaire.community.importer; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.transaction.Transactional; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.dom4j.DocumentHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Service; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.Lists; + +import eu.dnetlib.miscutils.functional.hash.Hashing; +import eu.dnetlib.openaire.community.CommunityService; +import eu.dnetlib.openaire.community.model.DbOrganization; +import eu.dnetlib.openaire.community.repository.DbOrganizationRepository; +import eu.dnetlib.openaire.community.utils.CommunityMappingUtils; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; +import eu.dnetlib.openaire.exporter.model.community.CommunityClaimType; +import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; +import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; +import eu.dnetlib.openaire.exporter.model.community.CommunityMembershipType; +import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; +import eu.dnetlib.openaire.exporter.model.community.CommunityProject; +import eu.dnetlib.openaire.exporter.model.community.CommunityStatus; +import eu.dnetlib.openaire.exporter.model.community.CommunityType; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; +import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; +import eu.dnetlib.openaire.exporter.model.context.Category; +import eu.dnetlib.openaire.exporter.model.context.Concept; +import eu.dnetlib.openaire.exporter.model.context.Context; +import eu.dnetlib.openaire.exporter.model.context.Param; + +@Service +@ConditionalOnProperty(value = "openaire.exporter.enable.community.import", havingValue = "true") +public class CommunityImporterService { + + // common + public final static String OPENAIRE_ID = "openaireId"; + public final static String PIPE_SEPARATOR = "||"; + public final static String ID_SEPARATOR = "::"; + public final static String CSV_DELIMITER = ","; + public final static String CLABEL = "label"; + + // id suffixes + public final static String PROJECTS_ID_SUFFIX = ID_SEPARATOR + "projects"; + public final static String CONTENTPROVIDERS_ID_SUFFIX = ID_SEPARATOR + "contentproviders"; + public final static String ZENODOCOMMUNITY_ID_SUFFIX = ID_SEPARATOR + "zenodocommunities"; + public final static String ORGANIZATION_ID_SUFFIX = ID_SEPARATOR + "organizations"; + + // community summary + public final static String CSUMMARY_DESCRIPTION = "description"; + public final static String CSUMMARY_LOGOURL = "logourl"; + public final static String CSUMMARY_STATUS = "status"; + public final static String CSUMMARY_NAME = "name"; + public final static String CSUMMARY_MANAGER = "manager"; + public final static String CSUMMARY_ZENODOC = "zenodoCommunity"; + + // community profile + public final static String CPROFILE_SUBJECT = "subject"; + public final static String CPROFILE_CREATIONDATE = "creationdate"; + public final static String CPROFILE_FOS = "fos"; + public final static String CPROFILE_SDG = "sdg"; + public final static String CPROFILE_ADVANCED_CONSTRAINT = "advancedConstraints"; + public final static String CPROFILE_REMOVE_CONSTRAINT = "removeConstraints"; + public final static String CPROFILE_SUGGESTED_ACKNOWLEDGEMENT = "suggestedAcknowledgement"; + + // community project + public final static String CPROJECT_FUNDER = "funder"; + public final static String CPROJECT_NUMBER = "CD_PROJECT_NUMBER"; + public final static String CPROJECT_FULLNAME = "projectfullname"; + public final static String CPROJECT_ACRONYM = "acronym"; + + // community content provider + public final static String CCONTENTPROVIDER_NAME = "name"; + public final static String CCONTENTPROVIDER_OFFICIALNAME = "officialname"; + public final static String CCONTENTPROVIDER_ENABLED = "enabled"; + public final static String CCONTENTPROVIDERENABLED_DEFAULT = "true"; + public final static String CCONTENTPROVIDER_SELCRITERIA = "selcriteria"; + + // community zenodo community + public final static String CZENODOCOMMUNITY_ID = "zenodoid"; + + // community organization + public final static String CORGANIZATION_NAME = "name"; + public final static String CORGANIZATION_LOGOURL = "logourl"; + public final static String CORGANIZATION_WEBSITEURL = "websiteurl"; + + @Autowired + private DbOrganizationRepository dbOrganizationRepository; + + @Autowired + private CommunityService service; + + @Autowired + private JdbcTemplate jdbcTemplate; + + private static final Log log = LogFactory.getLog(CommunityImporterService.class); + + public List importPropagationOrganizationsFromProfile(final String xml, final boolean simulation) throws Exception { + final String json = DocumentHelper.parseText(xml) + .selectSingleNode("//NODE[@name='setPropagationOrganizationCommunityMap']//PARAM[@name='parameterValue']") + .getText(); + + final List list = new ObjectMapper() + .readValue(json, new TypeReference>>() {}) + .entrySet() + .stream() + .flatMap(e -> e.getValue() + .stream() + .map(community -> { + if (e.getKey().contains("|")) { + return new DbOrganization(community, StringUtils.substringAfter(e.getKey(), "|")); + } else { + return new DbOrganization(community, e.getKey()); + } + })) + .collect(Collectors.toList()); + + if (!simulation) { + list.forEach(o -> { + try { + dbOrganizationRepository.save(o); + } catch (final Throwable e) { + log.error("ERROR saving org: " + o); + } + }); + } + + return list; + } + + @Transactional + public void importCommunity(final Context context) { + try { + + final CommunityDetails community = asCommunityDetails(context); + + final List datasources = + getCommunityInfo(context, CONTENTPROVIDERS_ID_SUFFIX, c -> asCommunityDataprovider(context.getId(), c)) + .stream() + .map(o -> { + if (o.getOpenaireId() == null) { + log.warn("Openaire ID is missing, organization: " + o.getOfficialname()); + } else if (o.getOpenaireId().contains("|")) { + o.setOpenaireId(StringUtils.substringAfter(o.getOpenaireId(), "|")); + } + return o; + }) + .filter(o -> o.getOpenaireId() != null) + .collect(Collectors.toList()); + + final List projects = + getCommunityInfo(context, PROJECTS_ID_SUFFIX, c -> asCommunityProject(context.getId(), c)) + .stream() + .map(p -> { + if (p.getOpenaireId() == null) { + if (p.getFunder().equalsIgnoreCase("EC")) { + final String ns = findNamespaceForECProject(p.getGrantId()); + if (ns != null) { + p.setOpenaireId(ns + "::" + Hashing.md5(p.getGrantId())); + } else { + log.warn("EC project not in the db: " + p.getGrantId()); + } + } else if (p.getFunder().equalsIgnoreCase("NSF")) { + p.setOpenaireId("nsf_________::" + Hashing.md5(p.getGrantId())); + } else if (p.getFunder().equalsIgnoreCase("NIH")) { + p.setOpenaireId("nih_________::" + Hashing.md5(p.getGrantId())); + } else { + log.warn("Openaire ID is missing, funder: " + p.getFunder()); + } + } else if (p.getOpenaireId().contains("|")) { + p.setOpenaireId(StringUtils.substringAfter(p.getOpenaireId(), "|")); + } + return p; + }) + .filter(p -> p.getOpenaireId() != null) + .collect(Collectors.toList()); + + final List orgs = + getCommunityInfo(context, ORGANIZATION_ID_SUFFIX, c -> asCommunityOrganization(context.getId(), c)); + + final List otherZenodoCommunities = + getCommunityInfo(context, ZENODOCOMMUNITY_ID_SUFFIX, c -> asZenodoCommunity(c)); + + community.setOtherZenodoCommunities(otherZenodoCommunities); + + final List subs = context.getCategories() + .entrySet() + .stream() + .filter(e -> !e.getKey().equals(context.getId() + CONTENTPROVIDERS_ID_SUFFIX)) + .filter(e -> !e.getKey().equals(context.getId() + PROJECTS_ID_SUFFIX)) + .filter(e -> !e.getKey().equals(context.getId() + ORGANIZATION_ID_SUFFIX)) + .filter(e -> !e.getKey().equals(context.getId() + ZENODOCOMMUNITY_ID_SUFFIX)) + .map(e -> e.getValue()) + .map(cat -> asSubCommunities(context.getId(), null, cat.getLabel(), cat.getConcepts())) + .flatMap(List::stream) + .collect(Collectors.toList()); + + service.saveCommunity(community); + service.addCommunityProjects(context.getId(), projects.toArray(new CommunityProject[projects.size()])); + service.addCommunityContentProviders(context.getId(), datasources.toArray(new CommunityContentprovider[datasources.size()])); + service.addCommunityOrganizations(context.getId(), orgs.toArray(new CommunityOrganization[orgs.size()])); + service.addSubCommunities(context.getId(), subs.toArray(new SubCommunity[subs.size()])); + } catch ( + + final Exception e) { + throw new RuntimeException("Error importing community: " + context.getId(), e); + } + } + + private List getCommunityInfo(final Context context, final String idSuffix, final Function mapping) + throws CommunityException { + if (context != null) { + final Map categories = context.getCategories(); + final Category category = categories.get(context.getId() + idSuffix); + if (category != null) { return category.getConcepts() + .stream() + .map(mapping) + .collect(Collectors.toList()); } + } + return Lists.newArrayList(); + } + + private static CommunityDetails asCommunityDetails(final Context c) { + + final CommunityDetails details = new CommunityDetails(); + + details.setId(c.getId()); + details.setShortName(c.getLabel()); + details.setLastUpdateDate(CommunityMappingUtils.asLocalDateTime(c.getLastUpdateDate())); + details.setCreationDate(CommunityMappingUtils.asLocalDateTime(c.getCreationDate())); + details.setQueryId(c.getId() + PIPE_SEPARATOR + c.getLabel()); + details.setType(CommunityType.valueOf(c.getType())); + details.setMembership(CommunityMembershipType.open); + details.setClaim(CommunityClaimType.all); + details.setDescription(asCsv(CSUMMARY_DESCRIPTION, c.getParams())); + details.setLogoUrl(asCsv(CSUMMARY_LOGOURL, c.getParams())); + + final String status = firstValue(CSUMMARY_STATUS, c.getParams()); + if (StringUtils.isNotBlank(status)) { + details.setStatus(CommunityStatus.valueOf(status)); + } else { + details.setStatus(CommunityStatus.hidden); + } + + details.setName(StringUtils.firstNonBlank(asCsv(CSUMMARY_NAME, c.getParams()), c.getLabel())); + details.setZenodoCommunity(asCsv(CSUMMARY_ZENODOC, c.getParams())); + details.setSubjects(splitValues(asValues(CPROFILE_SUBJECT, c.getParams()), CSV_DELIMITER)); + details.setFos(splitValues(asValues(CPROFILE_FOS, c.getParams()), CSV_DELIMITER)); + details.setSdg(splitValues(asValues(CPROFILE_SDG, c.getParams()), CSV_DELIMITER)); + // In the map the string is the serialization of the json representing the selection criteria so it is a valid json + details.setAdvancedConstraints(SelectionCriteria.fromJson(asCsv(CPROFILE_ADVANCED_CONSTRAINT, c.getParams()))); + // In the map the string is the serialization of the json representing the selection criteria so it is a valid json + details.setRemoveConstraints(SelectionCriteria.fromJson(asCsv(CPROFILE_REMOVE_CONSTRAINT, c.getParams()))); + details.setSuggestedAcknowledgements(splitValues(asValues(CPROFILE_SUGGESTED_ACKNOWLEDGEMENT, c.getParams()), CSV_DELIMITER)); + details.setPlan(null); + try { + details.setCreationDate(CommunityMappingUtils.asLocalDateTime(asCsv(CPROFILE_CREATIONDATE, c.getParams()))); + } catch (final Exception e) { + log.debug("Exception on date format: " + e.getMessage()); + } + + return details; + } + + private static CommunityProject asCommunityProject(final String communityId, final Concept c) { + final List p = c.getParams(); + final CommunityProject project = new CommunityProject(); + project.setCommunityId(communityId); + project.setOpenaireId(firstValue(OPENAIRE_ID, p)); + project.setFunder(firstValue(CPROJECT_FUNDER, p)); + project.setGrantId(firstValue(CPROJECT_NUMBER, p)); + project.setName(firstValue(CPROJECT_FULLNAME, p)); + project.setAcronym(firstValue(CPROJECT_ACRONYM, p)); + project.setAvailableSince(LocalDate.of(2017, 2, 25)); // Birillo Birth Date + return project; + } + + private static CommunityContentprovider asCommunityDataprovider(final String communityId, final Concept c) { + final List p = c.getParams(); + final CommunityContentprovider d = new CommunityContentprovider(); + d.setCommunityId(communityId); + d.setOpenaireId(firstValue(OPENAIRE_ID, p)); + d.setName(firstValue(CCONTENTPROVIDER_NAME, p)); + d.setOfficialname(firstValue(CCONTENTPROVIDER_OFFICIALNAME, p)); + d.setEnabled(BooleanUtils.toBoolean(firstValue(CCONTENTPROVIDER_ENABLED, p))); + d.setSelectioncriteria(SelectionCriteria.fromJson(firstValue(CCONTENTPROVIDER_SELCRITERIA, p))); + return d; + } + + private static CommunityOrganization asCommunityOrganization(final String id, final Concept c) { + final List p = c.getParams(); + final CommunityOrganization o = new CommunityOrganization(); + o.setCommunityId(id); + o.setName(firstValue(CORGANIZATION_NAME, p)); + o.setLogo_url(getDecodedUrl(firstValue(CORGANIZATION_LOGOURL, p))); + o.setWebsite_url(getDecodedUrl(firstValue(CORGANIZATION_WEBSITEURL, p))); + return o; + } + + private static String asZenodoCommunity(final Concept c) { + return firstValue(CZENODOCOMMUNITY_ID, c.getParams()); + } + + private static List asSubCommunities(final String communityId, final String parent, final String category, final List concepts) { + final List list = new ArrayList<>(); + for (final Concept c : concepts) { + final SubCommunity sc = new SubCommunity(); + sc.setSubCommunityId(c.getId()); + sc.setCommunityId(communityId); + sc.setParent(parent); + sc.setCategory(category); + sc.setLabel(c.getLabel()); + sc.setParams(c.getParams()); + sc.setClaim(c.isClaim()); + sc.setBrowsable(false); + list.add(sc); + list.addAll(asSubCommunities(communityId, c.getId(), category, c.getConcepts())); + } + return list; + } + + private String findNamespaceForECProject(final String code) { + final List list = + jdbcTemplate.queryForList("SELECT substr(id, 1, 12) from projects where code = ? and id like 'corda%'", String.class, code); + return list.isEmpty() ? null : list.get(0); + } + + private static String getDecodedUrl(final String encoded_url) { + if (encoded_url == null || encoded_url.startsWith("http")) { return encoded_url; } + try { + return new String(Base64.getDecoder().decode(encoded_url)); + } catch (final Exception e) { + log.warn("Invalid base64: " + encoded_url); + return encoded_url; + } + } + + private static List splitValues(final Stream stream, final String separator) { + return stream.map(s -> s.split(separator)) + .map(Arrays::asList) + .flatMap(List::stream) + .filter(StringUtils::isNotBlank) + .map(StringUtils::trim) + .collect(Collectors.toList()); + } + + private static String firstValue(final String name, final List params) { + return asValues(name, params).findFirst().orElse(null); + } + + private static String asCsv(final String name, final List params) { + return asValues(name, params).collect(Collectors.joining(CSV_DELIMITER)); + } + + private static Stream asValues(final String name, final List params) { + return params == null ? Stream.empty() + : params.stream() + .filter(p -> p != null) + .filter(p -> StringUtils.isNotBlank(p.getName())) + .filter(p -> p.getName().trim().equals(name.trim())) + .map(Param::getValue) + .map(StringUtils::trim) + .distinct(); + } + + protected DbOrganizationRepository getDbOrganizationRepository() { + return dbOrganizationRepository; + } + + protected void setDbOrganizationRepository(final DbOrganizationRepository dbOrganizationRepository) { + this.dbOrganizationRepository = dbOrganizationRepository; + } + + protected CommunityService getService() { + return service; + } + + protected void setService(final CommunityService service) { + this.service = service; + } + + protected JdbcTemplate getJdbcTemplate() { + return jdbcTemplate; + } + + protected void setJdbcTemplate(final JdbcTemplate jdbcTemplate) { + this.jdbcTemplate = jdbcTemplate; + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbCommunity.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbCommunity.java new file mode 100644 index 00000000..49313f01 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbCommunity.java @@ -0,0 +1,280 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; +import org.hibernate.annotations.TypeDefs; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; + +import com.vladmihalcea.hibernate.type.array.StringArrayType; +import com.vladmihalcea.hibernate.type.json.JsonBinaryType; +import com.vladmihalcea.hibernate.type.json.JsonStringType; + +import eu.dnetlib.openaire.community.utils.CommunityClaimTypeConverter; +import eu.dnetlib.openaire.community.utils.CommunityMembershipTypeConverter; +import eu.dnetlib.openaire.exporter.model.community.CommunityClaimType; +import eu.dnetlib.openaire.exporter.model.community.CommunityMembershipType; +import eu.dnetlib.openaire.exporter.model.community.CommunityStatus; +import eu.dnetlib.openaire.exporter.model.community.CommunityType; +import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; + +@Entity +@Table(name = "communities") +@TypeDefs({ + @TypeDef(name = "string-array", typeClass = StringArrayType.class), + @TypeDef(name = "json", typeClass = JsonStringType.class), + @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) +}) +public class DbCommunity implements Serializable { + + private static final long serialVersionUID = 4315597783109726539L; + + @Id + @Column(name = "id") + private String id; + + @Column(name = "name") + private String name; + + @Column(name = "shortname") + private String shortName; + + @Column(name = "description") + private String description; + + @Column(name = "status") + @Enumerated(EnumType.STRING) + private CommunityStatus status = CommunityStatus.hidden; + + @Column(name = "membership") + @Convert(converter = CommunityMembershipTypeConverter.class) + private CommunityMembershipType membership = CommunityMembershipType.byInvitation; + + @Column(name = "type") + @Enumerated(EnumType.STRING) + private CommunityType type; + + @Column(name = "claim") + @Convert(converter = CommunityClaimTypeConverter.class) + private CommunityClaimType claim; + + @Type(type = "string-array") + @Column(name = "subjects", columnDefinition = "text[]") + private String[] subjects; + + @Type(type = "string-array") + @Column(name = "fos", columnDefinition = "text[]") + private String[] fos; + + @Type(type = "string-array") + @Column(name = "sdg", columnDefinition = "text[]") + private String[] sdg; + + @Type(type = "jsonb") + @Column(name = "adv_constraints") + private SelectionCriteria advancedConstraints; + + @Type(type = "jsonb") + @Column(name = "remove_constraints") + private SelectionCriteria removeConstraints; + + @Column(name = "main_zenodo_community") + private String mainZenodoCommunity; + + @Type(type = "string-array") + @Column(name = "other_zenodo_communities", columnDefinition = "text[]") + private String[] otherZenodoCommunities; + + @CreatedDate + @Column(name = "creation_date") + private LocalDateTime creationDate; + + @LastModifiedDate + @Column(name = "last_update") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private LocalDateTime lastUpdateDate; + + @Column(name = "logo_url") + private String logoUrl; + + @Type(type = "string-array") + @Column(name = "suggested_acknowledgements", columnDefinition = "text[]") + private String[] suggestedAcknowledgements; + + @Column(name = "plan") + private String plan; + + public String getId() { + return id; + } + + public void setId(final String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + public String getShortName() { + return shortName; + } + + public void setShortName(final String shortName) { + this.shortName = shortName; + } + + public String getDescription() { + return description; + } + + public void setDescription(final String description) { + this.description = description; + } + + public CommunityStatus getStatus() { + return status; + } + + public void setStatus(final CommunityStatus status) { + this.status = status; + } + + public CommunityMembershipType getMembership() { + return membership; + } + + public void setMembership(final CommunityMembershipType membership) { + this.membership = membership; + } + + public CommunityType getType() { + return type; + } + + public void setType(final CommunityType type) { + this.type = type; + } + + public CommunityClaimType getClaim() { + return claim; + } + + public void setClaim(final CommunityClaimType claim) { + this.claim = claim; + } + + public String[] getSubjects() { + return subjects; + } + + public void setSubjects(final String[] subjects) { + this.subjects = subjects; + } + + public String[] getFos() { + return fos; + } + + public void setFos(final String[] fos) { + this.fos = fos; + } + + public String[] getSdg() { + return sdg; + } + + public void setSdg(final String[] sdg) { + this.sdg = sdg; + } + + public SelectionCriteria getAdvancedConstraints() { + return advancedConstraints; + } + + public void setAdvancedConstraints(final SelectionCriteria advancedConstraints) { + this.advancedConstraints = advancedConstraints; + } + + public SelectionCriteria getRemoveConstraints() { + return removeConstraints; + } + + public void setRemoveConstraints(final SelectionCriteria removeConstraints) { + this.removeConstraints = removeConstraints; + } + + public String getMainZenodoCommunity() { + return mainZenodoCommunity; + } + + public void setMainZenodoCommunity(final String mainZenodoCommunity) { + this.mainZenodoCommunity = mainZenodoCommunity; + } + + public String[] getOtherZenodoCommunities() { + return otherZenodoCommunities; + } + + public void setOtherZenodoCommunities(final String[] otherZenodoCommunities) { + this.otherZenodoCommunities = otherZenodoCommunities; + } + + public LocalDateTime getCreationDate() { + return creationDate; + } + + public void setCreationDate(final LocalDateTime creationDate) { + this.creationDate = creationDate; + } + + public LocalDateTime getLastUpdateDate() { + return lastUpdateDate; + } + + public void setLastUpdateDate(final LocalDateTime lastUpdateDate) { + this.lastUpdateDate = lastUpdateDate; + } + + public String getLogoUrl() { + return logoUrl; + } + + public void setLogoUrl(final String logoUrl) { + this.logoUrl = logoUrl; + } + + public String[] getSuggestedAcknowledgements() { + return suggestedAcknowledgements; + } + + public void setSuggestedAcknowledgements(final String[] suggestedAcknowledgements) { + this.suggestedAcknowledgements = suggestedAcknowledgements; + } + + public String getPlan() { + return plan; + } + + public void setPlan(final String plan) { + this.plan = plan; + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasource.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasource.java new file mode 100644 index 00000000..685b141c --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasource.java @@ -0,0 +1,101 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +import org.hibernate.annotations.Type; + +import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria; + +@Entity +@Table(name = "community_datasources") +@IdClass(DbDatasourcePK.class) +public class DbDatasource implements Serializable { + + private static final long serialVersionUID = -8782576185861694228L; + + @Id + @Column(name = "community") + private String community; + + @Id + @Column(name = "ds_id") + private String dsId; + + @Column(name = "ds_name") + private String dsName; + + @Column(name = "ds_officialname") + private String dsOfficialName; + + @Column(name = "enabled") + private Boolean enabled; + + @Type(type = "jsonb") + @Column(name = "constraints") + private SelectionCriteria constraints; + + public DbDatasource() {} + + public DbDatasource(final String community, final String dsId, final String dsName, final String dsOfficialName, final SelectionCriteria constraints) { + this.community = community; + this.dsId = dsId; + this.dsName = dsName; + this.dsOfficialName = dsOfficialName; + this.constraints = constraints; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getDsId() { + return dsId; + } + + public void setDsId(final String dsId) { + this.dsId = dsId; + } + + public String getDsName() { + return dsName; + } + + public void setDsName(final String dsName) { + this.dsName = dsName; + } + + public String getDsOfficialName() { + return dsOfficialName; + } + + public void setDsOfficialName(final String dsOfficialName) { + this.dsOfficialName = dsOfficialName; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(final Boolean enabled) { + this.enabled = enabled; + } + + public SelectionCriteria getConstraints() { + return constraints; + } + + public void setConstraints(final SelectionCriteria constraints) { + this.constraints = constraints; + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasourcePK.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasourcePK.java new file mode 100644 index 00000000..e02afaa7 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbDatasourcePK.java @@ -0,0 +1,55 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.util.Objects; + +public class DbDatasourcePK implements Serializable { + + private static final long serialVersionUID = -8073510491611213955L; + + private String community; + + private String dsId; + + public DbDatasourcePK() {} + + public DbDatasourcePK(final String community, final String dsId) { + this.community = community; + this.dsId = dsId; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getDsId() { + return dsId; + } + + public void setDsId(final String dsId) { + this.dsId = dsId; + } + + @Override + public int hashCode() { + return Objects.hash(community, dsId); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { return true; } + if (!(obj instanceof DbDatasourcePK)) { return false; } + final DbDatasourcePK other = (DbDatasourcePK) obj; + return Objects.equals(community, other.community) && Objects.equals(dsId, other.dsId); + } + + @Override + public String toString() { + return String.format("CommunityDatasourcePK [community=%s, dsId=%s]", community, dsId); + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganization.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganization.java new file mode 100644 index 00000000..6ed99e92 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganization.java @@ -0,0 +1,54 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +@Entity +@Table(name = "community_orgs") +@IdClass(DbOrganizationPK.class) +public class DbOrganization implements Serializable { + + private static final long serialVersionUID = -602114117980437763L; + + @Id + @Column(name = "community") + private String community; + + @Id + @Column(name = "org_id") + private String orgId; + + public DbOrganization() {} + + public DbOrganization(final String community, final String orgId) { + this.community = community; + this.orgId = orgId; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getOrgId() { + return orgId; + } + + public void setOrgId(final String orgId) { + this.orgId = orgId; + } + + @Override + public String toString() { + return String.format("DbOrganization [community=%s, orgId=%s]", community, orgId); + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganizationPK.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganizationPK.java new file mode 100644 index 00000000..b23b8a68 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbOrganizationPK.java @@ -0,0 +1,54 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.util.Objects; + +public class DbOrganizationPK implements Serializable { + + private static final long serialVersionUID = -6720182815397534837L; + + private String community; + + private String orgId; + + public DbOrganizationPK() {} + + public DbOrganizationPK(final String community, final String orgId) { + this.community = community; + this.orgId = orgId; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getOrgId() { + return orgId; + } + + public void setOrgId(final String orgId) { + this.orgId = orgId; + } + + @Override + public int hashCode() { + return Objects.hash(community, orgId); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { return true; } + if (!(obj instanceof DbDatasourcePK)) { return false; } + final DbOrganizationPK other = (DbOrganizationPK) obj; + return Objects.equals(community, other.community) && Objects.equals(orgId, other.orgId); + } + + @Override + public String toString() { + return String.format("CommunityOrgPK [community=%s, orgId=%s]", community, orgId); + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProject.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProject.java new file mode 100644 index 00000000..7ac348bf --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProject.java @@ -0,0 +1,113 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.time.LocalDate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +import org.springframework.data.annotation.CreatedDate; + +@Entity +@Table(name = "community_projects") +@IdClass(DbProjectPK.class) +public class DbProject implements Serializable { + + private static final long serialVersionUID = 1649065971750517925L; + + @Id + @Column(name = "community") + private String community; + + @Id + @Column(name = "project_id") + private String projectId; + + @Column(name = "project_code") + private String projectCode; + + @Column(name = "project_name") + private String projectName; + + @Column(name = "project_acronym") + private String projectAcronym; + + @Column(name = "project_funder") + private String projectFunder; + + @CreatedDate + @Column(name = "available_since") + private LocalDate availableSince; + + public DbProject() {} + + public DbProject(final String community, final String projectId, final String projectCode, final String projectName, final String projectAcronym, + final String projectFunder, final LocalDate availableSince) { + this.community = community; + this.projectId = projectId; + this.projectCode = projectCode; + this.projectName = projectName; + this.projectAcronym = projectAcronym; + this.projectFunder = projectFunder; + this.availableSince = availableSince; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(final String projectId) { + this.projectId = projectId; + } + + public String getProjectCode() { + return projectCode; + } + + public void setProjectCode(final String projectCode) { + this.projectCode = projectCode; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(final String projectName) { + this.projectName = projectName; + } + + public String getProjectAcronym() { + return projectAcronym; + } + + public void setProjectAcronym(final String projectAcronym) { + this.projectAcronym = projectAcronym; + } + + public String getProjectFunder() { + return projectFunder; + } + + public void setProjectFunder(final String projectFunder) { + this.projectFunder = projectFunder; + } + + public LocalDate getAvailableSince() { + return availableSince; + } + + public void setAvailableSince(final LocalDate availableSince) { + this.availableSince = availableSince; + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProjectPK.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProjectPK.java new file mode 100644 index 00000000..558abcf9 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbProjectPK.java @@ -0,0 +1,54 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.util.Objects; + +public class DbProjectPK implements Serializable { + + private static final long serialVersionUID = -4236577148534835803L; + + private String community; + + private String projectId; + + public DbProjectPK() {} + + public DbProjectPK(final String community, final String projectId) { + this.community = community; + this.projectId = projectId; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(final String projectId) { + this.projectId = projectId; + } + + @Override + public int hashCode() { + return Objects.hash(community, projectId); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { return true; } + if (!(obj instanceof DbProjectPK)) { return false; } + final DbProjectPK other = (DbProjectPK) obj; + return Objects.equals(community, other.community) && Objects.equals(projectId, other.projectId); + } + + @Override + public String toString() { + return String.format("CommunityProjectPK [community=%s, projectId=%s]", community, projectId); + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSubCommunity.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSubCommunity.java new file mode 100644 index 00000000..c54c4524 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSubCommunity.java @@ -0,0 +1,122 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; +import org.hibernate.annotations.TypeDefs; + +import com.vladmihalcea.hibernate.type.array.StringArrayType; +import com.vladmihalcea.hibernate.type.json.JsonBinaryType; +import com.vladmihalcea.hibernate.type.json.JsonStringType; + +import eu.dnetlib.openaire.exporter.model.context.Param; + +@Entity +@Table(name = "community_subs") +@TypeDefs({ + @TypeDef(name = "string-array", typeClass = StringArrayType.class), + @TypeDef(name = "json", typeClass = JsonStringType.class), + @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) +}) +public class DbSubCommunity implements Serializable { + + private static final long serialVersionUID = 7104936574383307358L; + + @Id + @Column(name = "sub_id") + private String id; + + @Column(name = "community") + private String community; + + @Column(name = "label") + private String label; + + @Column(name = "category") + private String category; + + @Type(type = "jsonb") + @Column(name = "params") + private List params = new ArrayList<>(); + + @Column(name = "parent") + private String parent; + + @Column(name = "claim") + private boolean claim = false; + + @Column(name = "browsable") + private boolean browsable = false; + + public String getId() { + return id; + } + + public void setId(final String id) { + this.id = id; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getLabel() { + return label; + } + + public void setLabel(final String label) { + this.label = label; + } + + public String getCategory() { + return category; + } + + public void setCategory(final String category) { + this.category = category; + } + + public List getParams() { + return params; + } + + public void setParams(final List params) { + this.params = params; + } + + public String getParent() { + return parent; + } + + public void setParent(final String parent) { + this.parent = parent; + } + + public boolean isClaim() { + return claim; + } + + public void setClaim(final boolean claim) { + this.claim = claim; + } + + public boolean isBrowsable() { + return browsable; + } + + public void setBrowsable(final boolean browsable) { + this.browsable = browsable; + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrg.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrg.java new file mode 100644 index 00000000..848b5c3a --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrg.java @@ -0,0 +1,64 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +@Entity +@Table(name = "community_support_orgs") +@IdClass(DbSupportOrgPK.class) +public class DbSupportOrg implements Serializable { + + private static final long serialVersionUID = 1308759097276753411L; + + @Id + @Column(name = "community") + private String community; + + @Id + @Column(name = "org_name") + private String orgName; + + @Column(name = "org_url") + private String orgUrl; + + @Column(name = "org_logourl") + private String orgLogoUrl; + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(final String orgName) { + this.orgName = orgName; + } + + public String getOrgUrl() { + return orgUrl; + } + + public void setOrgUrl(final String orgUrl) { + this.orgUrl = orgUrl; + } + + public String getOrgLogoUrl() { + return orgLogoUrl; + } + + public void setOrgLogoUrl(final String orgLogoUrl) { + this.orgLogoUrl = orgLogoUrl; + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrgPK.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrgPK.java new file mode 100644 index 00000000..616e2659 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/model/DbSupportOrgPK.java @@ -0,0 +1,55 @@ +package eu.dnetlib.openaire.community.model; + +import java.io.Serializable; +import java.util.Objects; + +public class DbSupportOrgPK implements Serializable { + + private static final long serialVersionUID = -4117154543803798310L; + + private String community; + + private String orgName; + + public DbSupportOrgPK() {} + + public DbSupportOrgPK(final String community, final String orgName) { + this.community = community; + this.orgName = orgName; + } + + public String getCommunity() { + return community; + } + + public void setCommunity(final String community) { + this.community = community; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(final String orgName) { + this.orgName = orgName; + } + + @Override + public int hashCode() { + return Objects.hash(community, orgName); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { return true; } + if (!(obj instanceof DbSupportOrgPK)) { return false; } + final DbSupportOrgPK other = (DbSupportOrgPK) obj; + return Objects.equals(community, other.community) && Objects.equals(orgName, other.orgName); + } + + @Override + public String toString() { + return String.format("CommunitySupportOrgPK [community=%s, orgName=%s]", community, orgName); + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbCommunityRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbCommunityRepository.java new file mode 100644 index 00000000..75b8b3a4 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbCommunityRepository.java @@ -0,0 +1,17 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; + +import eu.dnetlib.openaire.community.model.DbCommunity; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbCommunityRepository extends JpaRepository { + + @Query(value = "select id from communities where ?1 = ANY(array_append(other_zenodo_communities, main_zenodo_community))", nativeQuery = true) + List findByZenodoId(String zenodoId); + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbDatasourceRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbDatasourceRepository.java new file mode 100644 index 00000000..6afbd38b --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbDatasourceRepository.java @@ -0,0 +1,17 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.jpa.repository.JpaRepository; + +import eu.dnetlib.openaire.community.model.DbDatasource; +import eu.dnetlib.openaire.community.model.DbDatasourcePK; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbDatasourceRepository extends JpaRepository { + + List findByCommunity(String community); + + void deleteByCommunity(String id); +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbOrganizationRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbOrganizationRepository.java new file mode 100644 index 00000000..105a4fa6 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbOrganizationRepository.java @@ -0,0 +1,18 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.jpa.repository.JpaRepository; + +import eu.dnetlib.openaire.community.model.DbOrganization; +import eu.dnetlib.openaire.community.model.DbOrganizationPK; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbOrganizationRepository extends JpaRepository { + + List findByCommunity(String community); + + void deleteByCommunity(String id); + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbProjectRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbProjectRepository.java new file mode 100644 index 00000000..f0e19942 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbProjectRepository.java @@ -0,0 +1,25 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import eu.dnetlib.openaire.community.model.DbProject; +import eu.dnetlib.openaire.community.model.DbProjectPK; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbProjectRepository extends JpaRepository, JpaSpecificationExecutor { + + Page findByCommunity(String community, Pageable page); + + void deleteByCommunity(String id); + + @Query(value = "select distinct project_funder from community_projects where community = ?1 order by project_funder", nativeQuery = true) + List findFundersByCommunity(String id); + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSubCommunityRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSubCommunityRepository.java new file mode 100644 index 00000000..2b0dc7d3 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSubCommunityRepository.java @@ -0,0 +1,19 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.jpa.repository.JpaRepository; + +import eu.dnetlib.openaire.community.model.DbSubCommunity; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbSubCommunityRepository extends JpaRepository { + + List findByCommunity(String community); + + List findByCommunityAndParent(String community, String parent); + + void deleteByCommunity(String id); + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSupportOrgRepository.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSupportOrgRepository.java new file mode 100644 index 00000000..78d8798c --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/repository/DbSupportOrgRepository.java @@ -0,0 +1,18 @@ +package eu.dnetlib.openaire.community.repository; + +import java.util.List; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.data.jpa.repository.JpaRepository; + +import eu.dnetlib.openaire.community.model.DbSupportOrg; +import eu.dnetlib.openaire.community.model.DbSupportOrgPK; + +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") +public interface DbSupportOrgRepository extends JpaRepository { + + List findByCommunity(String community); + + void deleteByCommunity(String id); + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityClaimTypeConverter.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityClaimTypeConverter.java new file mode 100644 index 00000000..219325a8 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityClaimTypeConverter.java @@ -0,0 +1,29 @@ +package eu.dnetlib.openaire.community.utils; + +import javax.persistence.AttributeConverter; + +import org.apache.commons.lang3.StringUtils; + +import eu.dnetlib.openaire.exporter.model.community.CommunityClaimType; + +public class CommunityClaimTypeConverter implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(final CommunityClaimType attribute) { + if (attribute == null) { + return null; + } else { + return attribute.getDescription(); + } + } + + @Override + public CommunityClaimType convertToEntityAttribute(final String dbData) { + if (StringUtils.isBlank(dbData)) { + return null; + } else { + return CommunityClaimType.fromDescription(dbData); + } + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMappingUtils.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMappingUtils.java new file mode 100644 index 00000000..ed2de6a4 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMappingUtils.java @@ -0,0 +1,301 @@ +package eu.dnetlib.openaire.community.utils; + +import java.text.ParseException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.google.common.collect.Lists; + +import eu.dnetlib.openaire.community.importer.CommunityImporterService; +import eu.dnetlib.openaire.community.model.DbCommunity; +import eu.dnetlib.openaire.community.model.DbDatasource; +import eu.dnetlib.openaire.community.model.DbProject; +import eu.dnetlib.openaire.community.model.DbSubCommunity; +import eu.dnetlib.openaire.community.model.DbSupportOrg; +import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; +import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; +import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; +import eu.dnetlib.openaire.exporter.model.community.CommunityProject; +import eu.dnetlib.openaire.exporter.model.community.CommunitySummary; +import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; +import eu.dnetlib.openaire.exporter.model.context.IISConfigurationEntry; + +public class CommunityMappingUtils { + + public final static String PIPE_SEPARATOR = "||"; + + private static final List DATE_PATTERN = Lists.newArrayList("yyyy-MM-dd'T'hh:mm:ss", "yyyy-MM-dd'T'hh:mm:ssXXX", "yyyy-MM-dd'T'hh:mm:ss+00:00"); + + private static final Log log = LogFactory.getLog(CommunityMappingUtils.class); + + public static CommunitySummary toCommunitySummary(final DbCommunity c) { + final CommunitySummary summary = new CommunitySummary(); + populateSummary(summary, c); + return summary; + } + + public static DbCommunity toCommunity(final CommunityDetails details) { + final DbCommunity c = new DbCommunity(); + c.setId(details.getId()); + c.setName(details.getName()); + c.setShortName(details.getShortName()); + c.setDescription(details.getDescription()); + c.setStatus(details.getStatus()); + c.setLogoUrl(details.getLogoUrl()); + c.setMembership(details.getMembership()); + c.setType(details.getType()); + c.setClaim(details.getClaim()); + c.setSubjects(toStringArray(details.getSubjects())); + c.setFos(toStringArray(details.getFos())); + c.setSdg(toStringArray(details.getSdg())); + c.setAdvancedConstraints(details.getAdvancedConstraints()); + c.setRemoveConstraints(details.getRemoveConstraints()); + c.setMainZenodoCommunity(details.getZenodoCommunity()); + c.setOtherZenodoCommunities(toStringArray(details.getOtherZenodoCommunities())); + c.setSuggestedAcknowledgements(toStringArray(details.getSuggestedAcknowledgements())); + c.setPlan(details.getPlan()); + c.setCreationDate(ObjectUtils.firstNonNull(details.getCreationDate(), LocalDateTime.now())); + c.setLastUpdateDate(LocalDateTime.now()); + return c; + } + + public static void populateCommunity(final DbCommunity c, final CommunityWritableProperties details) { + if (StringUtils.isNotBlank(details.getName())) { + c.setName(details.getName()); + } + if (StringUtils.isNotBlank(details.getShortName())) { + c.setShortName(details.getShortName()); + } + if (StringUtils.isNotBlank(details.getDescription())) { + c.setDescription(details.getDescription()); + } + if (details.getStatus() != null) { + c.setStatus(details.getStatus()); + } + if (details.getMembership() != null) { + c.setMembership(details.getMembership()); + } + if (details.getType() != null) { + c.setType(details.getType()); + } + if (details.getClaim() != null) { + c.setClaim(details.getClaim()); + } + if (StringUtils.isNotBlank(details.getLogoUrl())) { + c.setLogoUrl(details.getLogoUrl()); + } + if (details.getFos() != null) { + c.setFos(toStringArray(details.getFos())); + } + if (details.getSdg() != null) { + c.setSdg(toStringArray(details.getSdg())); + } + if (details.getSubjects() != null) { + c.setSubjects(toStringArray(details.getSubjects())); + } + if (details.getAdvancedConstraints() != null) { + c.setAdvancedConstraints(details.getAdvancedConstraints()); + } + if (details.getRemoveConstraints() != null) { + c.setRemoveConstraints(details.getRemoveConstraints()); + } + if (StringUtils.isNotBlank(details.getMainZenodoCommunity())) { + c.setMainZenodoCommunity(details.getMainZenodoCommunity()); + } + if (details.getOtherZenodoCommunities() != null) { + c.setOtherZenodoCommunities(toStringArray(details.getOtherZenodoCommunities())); + } + if (details.getPlan() != null) { + c.setPlan(details.getPlan()); + } + + c.setLastUpdateDate(LocalDateTime.now()); + } + + public static CommunityDetails toCommunityDetails(final DbCommunity c) { + final CommunityDetails details = new CommunityDetails(); + populateSummary(details, c); + details.setAdvancedConstraints(c.getAdvancedConstraints()); + details.setRemoveConstraints(c.getRemoveConstraints()); + details.setFos(Arrays.asList(c.getFos())); + details.setSdg(Arrays.asList(c.getSdg())); + details.setSubjects(Arrays.asList(c.getSubjects())); + details.setOtherZenodoCommunities(Arrays.asList(c.getOtherZenodoCommunities())); + details.setSuggestedAcknowledgements(Arrays.asList(c.getSuggestedAcknowledgements())); + return details; + } + + private static void populateSummary(final CommunitySummary summary, final DbCommunity c) { + summary.setId(c.getId()); + summary.setShortName(c.getShortName()); + summary.setName(c.getName()); + summary.setLastUpdateDate(c.getLastUpdateDate()); + summary.setCreationDate(c.getCreationDate()); + summary.setQueryId(c.getId() + PIPE_SEPARATOR + c.getShortName()); + summary.setType(c.getType()); + summary.setDescription(c.getDescription()); + summary.setLogoUrl(c.getLogoUrl()); + summary.setStatus(c.getStatus()); + summary.setClaim(c.getClaim()); + summary.setMembership(c.getMembership()); + summary.setZenodoCommunity(c.getMainZenodoCommunity()); + summary.setPlan(c.getPlan()); + } + + public static CommunityProject toCommunityProject(final DbProject dbEntry) { + final CommunityProject cp = new CommunityProject(); + cp.setCommunityId(dbEntry.getCommunity()); + cp.setOpenaireId(dbEntry.getProjectId()); + cp.setName(dbEntry.getProjectName()); + cp.setAcronym(dbEntry.getProjectAcronym()); + cp.setFunder(dbEntry.getProjectFunder()); + cp.setGrantId(dbEntry.getProjectCode()); + cp.setAvailableSince(dbEntry.getAvailableSince()); + return cp; + } + + public static DbProject toDbProject(final String id, final CommunityProject project) { + final DbProject p = new DbProject(); + p.setCommunity(id); + p.setProjectId(project.getOpenaireId()); + p.setProjectName(project.getName()); + p.setProjectAcronym(project.getAcronym()); + p.setProjectCode(project.getGrantId()); + p.setProjectFunder(project.getFunder()); + if (project.getAvailableSince() != null) { + p.setAvailableSince(project.getAvailableSince()); + } else { + p.setAvailableSince(LocalDate.now()); + } + return p; + } + + public static CommunityContentprovider toCommunityContentprovider(final DbDatasource dbEntry) { + final CommunityContentprovider ccp = new CommunityContentprovider(); + ccp.setCommunityId(dbEntry.getCommunity()); + ccp.setOpenaireId(dbEntry.getDsId()); + ccp.setName(dbEntry.getDsName()); + ccp.setOfficialname(dbEntry.getDsOfficialName()); + ccp.setSelectioncriteria(dbEntry.getConstraints()); + ccp.setEnabled(dbEntry.getEnabled() != null ? dbEntry.getEnabled() : true); + return ccp; + } + + public static DbDatasource toDbDatasource(final String id, final CommunityContentprovider provider) { + final DbDatasource ds = new DbDatasource(); + ds.setCommunity(id); + ds.setDsId(provider.getOpenaireId()); + ds.setDsName(provider.getName()); + ds.setDsOfficialName(provider.getOfficialname()); + ds.setConstraints(provider.getSelectioncriteria()); + ds.setEnabled(provider.isEnabled()); + return ds; + } + + public static CommunityOrganization toCommunityOrganization(final DbSupportOrg dbEntry) { + final CommunityOrganization co = new CommunityOrganization(); + co.setCommunityId(dbEntry.getCommunity()); + co.setName(dbEntry.getOrgName()); + co.setWebsite_url(dbEntry.getOrgUrl()); + co.setLogo_url(dbEntry.getOrgLogoUrl()); + return co; + } + + public static DbSupportOrg toDbSupportOrg(final String id, final CommunityOrganization org) { + final DbSupportOrg dbo = new DbSupportOrg(); + dbo.setCommunity(id); + dbo.setOrgName(org.getName()); + dbo.setOrgUrl(org.getWebsite_url()); + dbo.setOrgLogoUrl(org.getLogo_url()); + return dbo; + } + + public static DbSubCommunity toDbSubCommunity(final String id, final SubCommunity sub) { + final DbSubCommunity dbsc = new DbSubCommunity(); + dbsc.setCommunity(id); + dbsc.setId(sub.getSubCommunityId()); + dbsc.setCategory(sub.getCategory()); + dbsc.setLabel(sub.getLabel()); + dbsc.setParams(sub.getParams()); + dbsc.setParent(sub.getParent()); + dbsc.setClaim(sub.isClaim()); + dbsc.setBrowsable(sub.isBrowsable()); + return dbsc; + } + + public static SubCommunity toSubCommunity(final DbSubCommunity sub) { + final SubCommunity sc = new SubCommunity(); + sc.setSubCommunityId(sub.getId()); + sc.setCategory(sub.getCategory()); + sc.setCommunityId(sub.getCommunity()); + sc.setLabel(sub.getLabel()); + sc.setParams(sub.getParams()); + sc.setParent(sub.getParent()); + sc.setClaim(sub.isClaim()); + sc.setBrowsable(sub.isBrowsable()); + return sc; + } + + public static LocalDateTime asLocalDateTime(final String s) { + if (StringUtils.isBlank(s)) { return null; } + + for (final String pattern : DATE_PATTERN) { + try { + final Date res = DateUtils.parseDate(s, pattern); + if (res != null) { return asLocalDateTime(res); } + } catch (final ParseException e) {} + } + log.warn("Invalid Date: " + s); + return null; + } + + public static LocalDateTime asLocalDateTime(final Date date) { + return date.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime(); + } + + private static String[] toStringArray(final List list) { + return list != null ? list.toArray(new String[list.size()]) : new String[0]; + } + + public static IISConfigurationEntry asIISConfigurationEntry(final DbCommunity c) { + final IISConfigurationEntry conf = new IISConfigurationEntry(); + conf.setId(c.getId()); + conf.setLabel(c.getName()); + conf.addParams(CommunityImporterService.CSUMMARY_DESCRIPTION, c.getDescription()); + conf.addParams(CommunityImporterService.CSUMMARY_LOGOURL, c.getLogoUrl()); + conf.addParams(CommunityImporterService.CSUMMARY_STATUS, c.getStatus().toString()); + conf.addParams(CommunityImporterService.CSUMMARY_NAME, c.getName()); + conf.addParams(CommunityImporterService.CSUMMARY_ZENODOC, c.getMainZenodoCommunity()); + conf.addParams(CommunityImporterService.CPROFILE_SUBJECT, c.getSubjects()); + conf.addParams(CommunityImporterService.CPROFILE_FOS, c.getFos()); + conf.addParams(CommunityImporterService.CPROFILE_SDG, c.getSdg()); + conf.addParams(CommunityImporterService.CPROFILE_ADVANCED_CONSTRAINT, c.getAdvancedConstraints() != null ? c.getAdvancedConstraints().toJson() : null); + conf.addParams(CommunityImporterService.CPROFILE_REMOVE_CONSTRAINT, c.getRemoveConstraints() != null ? c.getRemoveConstraints().toJson() : null); + conf.addParams(CommunityImporterService.CPROFILE_SUGGESTED_ACKNOWLEDGEMENT, c.getSuggestedAcknowledgements()); + conf.addParams(CommunityImporterService.CPROFILE_CREATIONDATE, c.getCreationDate() != null ? c.getCreationDate().toString() : null); + return conf; + } + + public static IISConfigurationEntry asIISConfigurationEntry(final DbSubCommunity subc) { + final IISConfigurationEntry conf = new IISConfigurationEntry(); + conf.setId(subc.getId()); + conf.setLabel(subc.getLabel()); + if (subc.getParams() != null) { + conf.getParams().addAll(subc.getParams()); + } + return conf; + } +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMembershipTypeConverter.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMembershipTypeConverter.java new file mode 100644 index 00000000..66ef5b55 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/community/utils/CommunityMembershipTypeConverter.java @@ -0,0 +1,29 @@ +package eu.dnetlib.openaire.community.utils; + +import javax.persistence.AttributeConverter; + +import org.apache.commons.lang3.StringUtils; + +import eu.dnetlib.openaire.exporter.model.community.CommunityMembershipType; + +public class CommunityMembershipTypeConverter implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(final CommunityMembershipType attribute) { + if (attribute == null) { + return null; + } else { + return attribute.getDescription(); + } + } + + @Override + public CommunityMembershipType convertToEntityAttribute(final String dbData) { + if (StringUtils.isBlank(dbData)) { + return null; + } else { + return CommunityMembershipType.fromDescription(dbData); + } + } + +} diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java index f8fcc9e9..f2f37f24 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiController.java @@ -1,8 +1,13 @@ package eu.dnetlib.openaire.context; import java.util.List; -import java.util.Optional; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.CrossOrigin; @@ -12,10 +17,16 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import eu.dnetlib.openaire.exporter.exceptions.ContextException; +import eu.dnetlib.openaire.common.AbstractExporterController; +import eu.dnetlib.openaire.community.CommunityService; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; +import eu.dnetlib.openaire.exporter.exceptions.ResourceNotFoundException; +import eu.dnetlib.openaire.exporter.model.community.CommunityType; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; import eu.dnetlib.openaire.exporter.model.context.CategorySummary; import eu.dnetlib.openaire.exporter.model.context.ConceptSummary; import eu.dnetlib.openaire.exporter.model.context.ContextSummary; +import eu.dnetlib.openaire.exporter.model.context.IISConfigurationEntry; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; @@ -25,12 +36,14 @@ import io.swagger.v3.oas.annotations.tags.Tag; @CrossOrigin(origins = { "*" }) -@ConditionalOnProperty(value = "openaire.exporter.enable.context", havingValue = "true") +@ConditionalOnProperty(value = "openaire.exporter.enable.community", havingValue = "true") @Tag(name = "OpenAIRE Context API", description = "the OpenAIRE Context API") -public class ContextApiController { +public class ContextApiController extends AbstractExporterController { @Autowired - private ContextApiCore contextApiCore; + private CommunityService communityService; + + private static final Log log = LogFactory.getLog(ContextApiController.class); @RequestMapping(value = "/contexts", produces = { "application/json" @@ -38,10 +51,28 @@ public class ContextApiController { @Operation(summary = "list brief information about all the context profiles", description = "list brief information about all the context profiles") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) - public List listContexts(@RequestParam(required = false, defaultValue = "") final List type) throws ContextException { - return contextApiCore.listContexts(type); + public List listContexts(@RequestParam(required = false) final Set type) throws CommunityException { + try { + return communityService.listCommunities() + .stream() + .filter(c -> type == null || type.contains(c.getType())) + .map(c -> { + final ContextSummary ctx = new ContextSummary(); + ctx.setId(c.getId()); + ctx.setLabel(c.getName()); + ctx.setStatus(c.getStatus().toString()); + ctx.setType(c.getType().toString()); + return ctx; + }) + .collect(Collectors.toList()); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/context/{contextId}", produces = { @@ -50,14 +81,52 @@ public class ContextApiController { @Operation(summary = "list the categories defined within a context", description = "list the categories defined within a context") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) public List listCategories( @PathVariable final String contextId, - @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { + @RequestParam(required = false, defaultValue = "false") final boolean all) throws CommunityException { - final Boolean allFilter = Optional.ofNullable(all).orElse(false); - return contextApiCore.listCategories(contextId, allFilter); + try { + return communityService.getSubCommunities(contextId) + .stream() + .filter(sc -> all || sc.isClaim()) + .map(sc -> { + final String[] parts = StringUtils.split(sc.getSubCommunityId(), "::"); + if (parts.length < 3) { throw new RuntimeException("Invalid conceptId (It should have 3 (or more) parts): " + sc.getSubCommunityId()); } + final CategorySummary cat = new CategorySummary(); + cat.setId(parts[0] + "::" + parts[1]); + cat.setLabel(sc.getCategory()); + cat.setHasConcept(true); + return cat; + }) + .distinct() + .collect(Collectors.toList()); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + } + + @RequestMapping(value = "/context/iis/conf/{contextId}", produces = { + "application/json" + }, method = RequestMethod.GET) + @Operation(summary = "return a list of entries for IIS", description = "return a list of entries for IIS") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), + @ApiResponse(responseCode = "500", description = "unexpected error") + }) + public List getIISConfiguration(@PathVariable final String contextId) throws CommunityException { + try { + return communityService.getIISConfiguration(contextId); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } } @RequestMapping(value = "/context/category/{categoryId}", produces = { @@ -66,14 +135,30 @@ public class ContextApiController { @Operation(summary = "list the concepts defined within a category", description = "list the concepts defined within a category") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) public List listConcepts( @PathVariable final String categoryId, - @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { + @RequestParam(required = false, defaultValue = "false") final boolean all) throws CommunityException { + try { + final String[] parts = StringUtils.split(categoryId, "::"); + if (parts.length != 2) { + log.error("Invalid category id (it should have 2 parts): " + categoryId); + throw new CommunityException("Invalid category id (it should have 2 parts): " + categoryId); + } + + final String contextId = parts[0]; + + final List list = findSubCommunities(categoryId + "::", all, contextId); + + return processSubCommunities(null, list); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } - final Boolean allFilter = Optional.ofNullable(all).orElse(false); - return contextApiCore.listConcepts(categoryId, allFilter); } @RequestMapping(value = "/context/category/concept/{conceptId}", produces = { @@ -82,14 +167,53 @@ public class ContextApiController { @Operation(summary = "list the concepts defined within a category", description = "list the concepts defined within a category") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse(responseCode = "404", description = "not found"), @ApiResponse(responseCode = "500", description = "unexpected error") }) public List listSubConcepts( @PathVariable final String conceptId, - @RequestParam(required = false, defaultValue = "false") final Boolean all) throws ContextException { + @RequestParam(required = false, defaultValue = "false") final boolean all) throws CommunityException { + try { + final String[] parts = StringUtils.split(conceptId, "::"); + if (parts.length < 3) { + log.error("Invalid concept id (it should have 3 (or more) parts): " + conceptId); + throw new CommunityException("Invalid concept id (it should have 3 (or more) parts): " + conceptId); + } - final Boolean allFilter = Optional.ofNullable(all).orElse(false); - return contextApiCore.listSubConcepts(conceptId, allFilter); + final String contextId = parts[0]; + + final List list = findSubCommunities(conceptId + "::", all, contextId); + + return processSubCommunities(conceptId, list); + } catch (final ResourceNotFoundException e) { + throw e; + } catch (final Throwable e) { + throw new CommunityException(e); + } + + } + + private List findSubCommunities(final String prefix, final boolean all, final String contextId) throws CommunityException { + return communityService.getSubCommunities(contextId) + .stream() + .filter(sc -> all || sc.isClaim()) + .filter(sc -> sc.getSubCommunityId().startsWith(prefix)) + .collect(Collectors.toList()); + } + + private List processSubCommunities(final String parent, final List list) { + return list.stream() + .filter(sc -> Objects.equals(sc.getParent(), parent)) + .map(sc -> { + final List childs = processSubCommunities(sc.getSubCommunityId(), list); + final ConceptSummary concept = new ConceptSummary(); + concept.setId(sc.getSubCommunityId()); + concept.setLabel(sc.getLabel()); + concept.setHasSubConcept(!childs.isEmpty()); + concept.setConcept(childs); + return concept; + }) + .collect(Collectors.toList()); } } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiCore.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiCore.java index f33712c8..ae531003 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiCore.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextApiCore.java @@ -8,14 +8,12 @@ import java.util.stream.Stream; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Component; import com.google.common.base.Splitter; import com.google.common.collect.Lists; import eu.dnetlib.openaire.common.ISClient; -import eu.dnetlib.openaire.exporter.exceptions.ContextException; +import eu.dnetlib.openaire.exporter.exceptions.CommunityException; import eu.dnetlib.openaire.exporter.model.context.Category; import eu.dnetlib.openaire.exporter.model.context.CategorySummary; import eu.dnetlib.openaire.exporter.model.context.Concept; @@ -23,8 +21,9 @@ import eu.dnetlib.openaire.exporter.model.context.ConceptSummary; import eu.dnetlib.openaire.exporter.model.context.Context; import eu.dnetlib.openaire.exporter.model.context.ContextSummary; -@Component -@ConditionalOnProperty(value = "openaire.exporter.enable.context", havingValue = "true") +// @Component +// @ConditionalOnProperty(value = "openaire.exporter.enable.context", havingValue = "true") +@Deprecated public class ContextApiCore { private static final String SEPARATOR = "::"; @@ -32,18 +31,24 @@ public class ContextApiCore { @Autowired private ISClient isClient; - public List listContexts(final List type) throws ContextException { + public List listContexts(final List type) throws CommunityException { + return getContextMap(type).values() .stream() .map(c -> new ContextSummary() .setId(c.getId()) .setType(c.getType()) .setLabel(c.getLabel()) - .setStatus(c.getParams().containsKey("status") ? c.getParams().get("status").get(0).getValue() : "")) + .setStatus(c.getParams() + .stream() + .filter(p -> p.getName().equals("status")) + .map(p -> p.getValue()) + .findFirst() + .orElse(""))) .collect(Collectors.toList()); } - public List listCategories(final String contextId, final Boolean all) throws ContextException { + public List listCategories(final String contextId, final Boolean all) throws CommunityException { final Stream categories = getContextMap().get(contextId).getCategories().values().stream(); return all ? asCategorySummaries(categories) : asCategorySummaries(categories.filter(Category::isClaim)); } @@ -57,7 +62,7 @@ public class ContextApiCore { .collect(Collectors.toList()); } - public List listConcepts(final String categoryId, final Boolean all) throws ContextException { + public List listConcepts(final String categoryId, final Boolean all) throws CommunityException { final String contextId = StringUtils.substringBefore(categoryId, SEPARATOR); final Stream concepts = getContextMap().get(contextId) .getCategories() @@ -77,9 +82,9 @@ public class ContextApiCore { .collect(Collectors.toList()); } - public List listSubConcepts(final String conceptId, final Boolean all) throws ContextException { + public List listSubConcepts(final String conceptId, final Boolean all) throws CommunityException { final List ids = Splitter.on(SEPARATOR).splitToList(conceptId); - if (ids.size() < 3) { throw new ContextException(""); } + if (ids.size() < 3) { throw new CommunityException(""); } final String contextId = ids.get(0); final String categoryId = contextId + SEPARATOR + ids.get(1); @@ -105,15 +110,15 @@ public class ContextApiCore { .collect(Collectors.toList()); } - private Map getContextMap() throws ContextException { + private Map getContextMap() throws CommunityException { return getContextMap(Lists.newArrayList()); } - private Map getContextMap(final List type) throws ContextException { + private Map getContextMap(final List type) throws CommunityException { try { return isClient.getContextMap(type); } catch (final IOException e) { - throw new ContextException(e); + throw new CommunityException(e); } } diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextMappingUtils.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextMappingUtils.java index e7311c2a..c7c0b0d1 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextMappingUtils.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/context/ContextMappingUtils.java @@ -1,7 +1,6 @@ package eu.dnetlib.openaire.context; import java.text.ParseException; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -11,6 +10,8 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; @@ -26,25 +27,31 @@ import eu.dnetlib.openaire.exporter.model.context.Context; import eu.dnetlib.openaire.exporter.model.context.Param; import eu.dnetlib.openaire.exporter.model.funders.FunderDetails; +@Deprecated public class ContextMappingUtils { private static final List DATE_PATTERN = Lists.newArrayList("yyyy-MM-dd'T'hh:mm:ss", "yyyy-MM-dd'T'hh:mm:ssXXX", "yyyy-MM-dd'T'hh:mm:ss+00:00"); + private static final Log log = LogFactory.getLog(ContextMappingUtils.class); + public static Context parseContext(final String s, final Queue errors) { try { final Document doc = DocumentHelper.parseText(s); final Element eContext = (Element) doc.selectSingleNode("/RESOURCE_PROFILE/BODY/CONFIGURATION/context"); final String creationDate = eContext.valueOf("./param[./@name='creationdate']/text()"); + final String otherDate = doc.valueOf("/RESOURCE_PROFILE/HEADER/DATE_OF_CREATION/@value"); final Context c = new Context() .setId(eContext.attributeValue("id")) .setLabel(eContext.attributeValue("label")) .setType(eContext.attributeValue("type")) - .setLastUpdateDate(asDate(doc.valueOf("/RESOURCE_PROFILE/HEADER/DATE_OF_CREATION/@value"))) + .setLastUpdateDate(asDate(otherDate)) .setParams(parseParams(eContext)) .setCategories(parseCategories(eContext)); // the creation date will be added in the param elements of the community profile. Funders may not have it, hence the check. if (StringUtils.isNotBlank(creationDate)) { c.setCreationDate(asDate(creationDate)); + } else { + c.setCreationDate(asDate(otherDate)); } return c; } catch (final DocumentException e) { @@ -54,11 +61,15 @@ public class ContextMappingUtils { } private static Date asDate(final String s) { + if (StringUtils.isBlank(s)) { return null; } + for (final String pattern : DATE_PATTERN) { try { - return DateUtils.parseDate(s, pattern); + final Date res = DateUtils.parseDate(s, pattern); + if (res != null) { return res; } } catch (final ParseException e) {} } + log.warn("Invalid Date: " + s); return null; } @@ -93,18 +104,12 @@ public class ContextMappingUtils { return BooleanUtils.toBooleanObject(StringUtils.isNotBlank(claim) ? claim : "false"); } - private static Map> parseParams(final Element e) { + private static List parseParams(final Element e) { final List params = e.selectNodes("./param"); return params.stream() .map(n -> (Element) n) - .map(p -> new Param() - .setName(p.attributeValue("name")) - .setValue(p.getTextTrim())) - .collect(Collectors.toMap(Param::getName, Lists::newArrayList, (p1, p2) -> { - final List p = new ArrayList<>(p1); - p.addAll(p2); - return p; - })); + .map(p -> new Param().setName(p.attributeValue("name")).setValue(p.getTextTrim())) + .collect(Collectors.toList()); } public static FunderDetails asFunderDetails(final Context c) { diff --git a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmCore.java b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmCore.java index c3ba1a8b..f5da20ea 100644 --- a/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmCore.java +++ b/apps/dnet-exporter-api/src/main/java/eu/dnetlib/openaire/dsm/DsmCore.java @@ -36,7 +36,6 @@ import eu.dnetlib.enabling.datasources.common.DsmException; import eu.dnetlib.enabling.datasources.common.DsmForbiddenException; import eu.dnetlib.enabling.datasources.common.DsmNotFoundException; import eu.dnetlib.openaire.common.ISClient; -import eu.dnetlib.openaire.community.CommunityClient; import eu.dnetlib.openaire.dsm.dao.CountryTermRepository; import eu.dnetlib.openaire.dsm.dao.DatasourceDao; import eu.dnetlib.openaire.dsm.dao.MongoLoggerClient; @@ -91,9 +90,6 @@ public class DsmCore { @Autowired private JdbcTemplate jdbcTemplate; - @Autowired - private CommunityClient communityClient; - public List listCountries() throws DsmApiException { final List countries = Lists.newArrayList(); final Vocabulary v = vocabularyClient.getCountries(); @@ -321,7 +317,6 @@ public class DsmCore { mongoLoggerClient.dropCache(); isClient.dropCache(); vocabularyClient.dropCache(); - communityClient.dropCache(); } // HELPERS ////////////// diff --git a/apps/dnet-exporter-api/src/main/resources/application.properties b/apps/dnet-exporter-api/src/main/resources/application.properties index 9d1b9961..3aeb5b58 100644 --- a/apps/dnet-exporter-api/src/main/resources/application.properties +++ b/apps/dnet-exporter-api/src/main/resources/application.properties @@ -25,6 +25,7 @@ management.endpoints.web.path-mapping.health = health # ENABLE / DISABLE CONTROLLERS openaire.exporter.enable.dsm = true openaire.exporter.enable.community = true +openaire.exporter.enable.community.import = false openaire.exporter.enable.context = true openaire.exporter.enable.funders = false openaire.exporter.enable.project = true diff --git a/apps/dnet-exporter-api/src/main/resources/global.properties b/apps/dnet-exporter-api/src/main/resources/global.properties index c92fca73..8368c3e9 100644 --- a/apps/dnet-exporter-api/src/main/resources/global.properties +++ b/apps/dnet-exporter-api/src/main/resources/global.properties @@ -1,7 +1,8 @@ +services.is.protocol = http services.is.host = localhost services.is.port = 8280 -services.is.protocol = http services.is.context = app + services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp @@ -15,8 +16,8 @@ openaire.exporter.cxfClientConnectTimeout = 60000 openaire.exporter.cxfClientReceiveTimeout = 120000 # JDBC -#openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus -openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280 +openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus +#openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280 openaire.exporter.jdbc.user = dnetapi openaire.exporter.jdbc.pwd = dnetPwd openaire.exporter.jdbc.minIdle = 1 diff --git a/apps/dnet-exporter-api/src/main/resources/sql/community-schema.sql b/apps/dnet-exporter-api/src/main/resources/sql/community-schema.sql new file mode 100644 index 00000000..d90a256c --- /dev/null +++ b/apps/dnet-exporter-api/src/main/resources/sql/community-schema.sql @@ -0,0 +1,83 @@ +DROP TABLE IF EXISTS community_subs; +DROP TABLE IF EXISTS community_projects; +DROP TABLE IF EXISTS community_datasources; +DROP TABLE IF EXISTS community_support_orgs; +DROP TABLE IF EXISTS community_orgs; +DROP TABLE IF EXISTS communities; + +CREATE TABLE communities ( + id text PRIMARY KEY, + name text NOT NULL, + shortname text NOT NULL, -- in the profile is label + description text NOT NULL DEFAULT '', + status text NOT NULL DEFAULT 'hidden', -- all, manager, hidden, members + membership text NOT NULL DEFAULT 'by-invitation', -- open, by-invitation + type text NOT NULL, -- community, ri + claim text, -- managers-only, members-only, all + subjects text[], + fos text[], + sdg text[], + adv_constraints jsonb, + remove_constraints jsonb, + main_zenodo_community text, + other_zenodo_communities text[], + creation_date timestamp NOT NULL DEFAULT now(), + last_update timestamp NOT NULL DEFAULT now(), + logo_url text, + suggested_acknowledgements text[], + plan text +); + +CREATE TABLE community_projects ( + community text NOT NULL REFERENCES communities(id), + project_id text NOT NULL, + project_code text NOT NULL, + project_name text NOT NULL, + project_acronym text, + project_funder text NOT NULL, + available_since date NOT NULL default now(), + PRIMARY KEY (community, project_id) +); + +CREATE TABLE community_datasources ( + community text NOT NULL REFERENCES communities(id), + ds_id text NOT NULL, + ds_name text NOT NULL, + ds_officialname text NOT NULL, + enabled boolean NOT NULL DEFAULT true; + constraints jsonb, + PRIMARY KEY (community, ds_id) +); + +CREATE TABLE community_support_orgs ( + community text NOT NULL REFERENCES communities(id), + org_name text NOT NULL, + org_url text NOT NULL, + org_logourl text NOT NULL, + PRIMARY KEY (community, org_name) +); + +CREATE TABLE community_orgs ( + community text NOT NULL REFERENCES communities(id), + org_id text NOT NULL, + PRIMARY KEY (community, org_id) +); + + +CREATE TABLE community_subs ( + sub_id text NOT NULL PRIMARY KEY, + community text NOT NULL REFERENCES communities(id), + label text NOT NULL, + category text NOT NULL, + claim boolean NOT NULL DEFAULT false, + browsable boolean NOT NULL DEFAULT false, + params jsonb, + parent text REFERENCES community_subs(sub_id) -- NULL for the first level +); + +CREATE INDEX community_projects_community ON community_projects(community); +CREATE INDEX community_datasources_community ON community_datasources(community); +CREATE INDEX community_support_orgs_community ON community_support_orgs(community); +CREATE INDEX community_orgs_community ON community_orgs(community); +CREATE INDEX community_subs_community ON community_subs(community); +CREATE INDEX community_subs_parent ON community_subs(parent); diff --git a/apps/dnet-exporter-api/src/main/resources/sql/export_nwo_projects.sql b/apps/dnet-exporter-api/src/main/resources/sql/export_nwo_projects.sql new file mode 100644 index 00000000..13d01503 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/resources/sql/export_nwo_projects.sql @@ -0,0 +1,11 @@ +\copy ( + SELECT + 'netherlands' AS community, + 'nwo_________::'||md5(substr(id, 15)) AS project_id, + code AS project_code, + title AS project_name, + acronym AS project_acronym, + 'NWO' AS project_funder + FROM projects + WHERE id LIKE 'nwo\_\_\_\_\_\_\_\_\_::%' +) TO '/tmp/nwo_community_projects.csv' CSV HEADER; diff --git a/apps/dnet-exporter-api/src/main/resources/sql/import_nwo_projects.sql b/apps/dnet-exporter-api/src/main/resources/sql/import_nwo_projects.sql new file mode 100644 index 00000000..91f41172 --- /dev/null +++ b/apps/dnet-exporter-api/src/main/resources/sql/import_nwo_projects.sql @@ -0,0 +1 @@ +\copy community_projects FROM '/tmp/nwo_community_projects.csv' CSV HEADER; diff --git a/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/CommunityApiControllerTest.java b/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/CommunityApiControllerTest.java index 94d9ee7f..4f1ffe2a 100644 --- a/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/CommunityApiControllerTest.java +++ b/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/CommunityApiControllerTest.java @@ -8,7 +8,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.nio.charset.Charset; -import java.util.Date; +import java.time.LocalDateTime; import java.util.List; import org.junit.jupiter.api.Test; @@ -46,7 +46,7 @@ public class CommunityApiControllerTest { final CommunitySummary cs = new CommunitySummary(); cs.setDescription("the description"); cs.setId("id1"); - cs.setLastUpdateDate(new Date()); + cs.setLastUpdateDate(LocalDateTime.now()); cs.setName("X"); cs.setShortName("x"); final List csList = singletonList(cs); diff --git a/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/importer/CommunityImporterServiceTest.java b/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/importer/CommunityImporterServiceTest.java new file mode 100644 index 00000000..5141b89e --- /dev/null +++ b/apps/dnet-exporter-api/src/test/java/eu/dnetlib/openaire/community/importer/CommunityImporterServiceTest.java @@ -0,0 +1,161 @@ +package eu.dnetlib.openaire.community.importer; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.jdbc.core.JdbcTemplate; + +import eu.dnetlib.openaire.community.CommunityService; +import eu.dnetlib.openaire.community.model.DbOrganization; +import eu.dnetlib.openaire.community.repository.DbOrganizationRepository; +import eu.dnetlib.openaire.context.ContextMappingUtils; +import eu.dnetlib.openaire.exporter.model.community.CommunityContentprovider; +import eu.dnetlib.openaire.exporter.model.community.CommunityDetails; +import eu.dnetlib.openaire.exporter.model.community.CommunityOrganization; +import eu.dnetlib.openaire.exporter.model.community.CommunityProject; +import eu.dnetlib.openaire.exporter.model.community.SubCommunity; +import eu.dnetlib.openaire.exporter.model.context.Context; + +@ExtendWith(MockitoExtension.class) +class CommunityImporterServiceTest { + + // Class under test + private CommunityImporterService importer; + + @Mock + private DbOrganizationRepository dbOrganizationRepository; + + @Mock + private CommunityService service; + + @Mock + private JdbcTemplate jdbcTemplate; + + @BeforeEach + public void setUp() { + importer = new CommunityImporterService(); + importer.setDbOrganizationRepository(dbOrganizationRepository); + importer.setService(service); + importer.setJdbcTemplate(jdbcTemplate); + } + + @Test + public void testImportPropagationOrganizationsFromProfile() throws Exception { + final String profile = IOUtils.toString(getClass().getResourceAsStream("old_provision_wf.xml"), StandardCharsets.UTF_8.toString()); + final List list = importer.importPropagationOrganizationsFromProfile(profile, true); + // list.forEach(System.out::println); + + assertEquals(245, list.size()); + assertEquals(1, list.stream().filter(o -> o.getOrgId().equals("openorgs____::9dd5545aacd3d8019e00c3f837269746")).count()); + assertEquals(2, list.stream().filter(o -> o.getOrgId().equals("openorgs____::d11f981828c485cd23d93f7f24f24db1")).count()); + assertEquals(14, list.stream().filter(o -> o.getCommunity().equals("beopen")).count()); + } + + @SuppressWarnings("unchecked") + @Test + public void testImportCommunity() throws Exception { + final String profile = IOUtils.toString(getClass().getResourceAsStream("old_community_profile.xml"), StandardCharsets.UTF_8.toString()); + + final Queue errors = new LinkedList<>(); + final Context context = ContextMappingUtils.parseContext(profile, errors); + assertTrue(errors.isEmpty()); + + Mockito.when(jdbcTemplate.queryForList(Mockito.anyString(), Mockito.any(Class.class), Mockito.anyString())).thenReturn(Arrays.asList("corda_______")); + importer.importCommunity(context); + + final ArgumentCaptor detailsCapture = ArgumentCaptor.forClass(CommunityDetails.class); + final ArgumentCaptor projectsCapture = ArgumentCaptor.forClass(CommunityProject.class); + final ArgumentCaptor datasourcesCapture = ArgumentCaptor.forClass(CommunityContentprovider.class); + final ArgumentCaptor orgsCapture = ArgumentCaptor.forClass(CommunityOrganization.class); + final ArgumentCaptor subCommunitiesCapture = ArgumentCaptor.forClass(SubCommunity.class); + + Mockito.verify(service, Mockito.times(1)).saveCommunity(detailsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityProjects(Mockito.anyString(), projectsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityContentProviders(Mockito.anyString(), datasourcesCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityOrganizations(Mockito.anyString(), orgsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addSubCommunities(Mockito.anyString(), subCommunitiesCapture.capture()); + + final CommunityDetails details = detailsCapture.getValue(); + assertEquals("egi", details.getId()); + // System.out.println(details); + + final List projects = projectsCapture.getAllValues(); + assertEquals(83, projects.size()); + // projects.forEach(System.out::println); + + final List datasources = datasourcesCapture.getAllValues(); + assertEquals(1, datasources.size()); + // datasources.forEach(System.out::println); + + final List orgs = orgsCapture.getAllValues(); + assertEquals(1, orgs.size()); + // orgs.forEach(System.out::println); + + final List subs = subCommunitiesCapture.getAllValues(); + assertEquals(688, subs.size()); + // subs.forEach(System.out::println); + + } + + @SuppressWarnings("unchecked") + @Test + public void testImportCommunityFetFp7() throws Exception { + final String profile = IOUtils.toString(getClass().getResourceAsStream("old_community_profile_fet-fp7.xml"), StandardCharsets.UTF_8.toString()); + + final Queue errors = new LinkedList<>(); + final Context context = ContextMappingUtils.parseContext(profile, errors); + assertTrue(errors.isEmpty()); + + // Mockito.when(jdbcTemplate.queryForList(Mockito.anyString(), Mockito.any(Class.class), + // Mockito.anyString())).thenReturn(Arrays.asList("corda_______")); + importer.importCommunity(context); + + final ArgumentCaptor detailsCapture = ArgumentCaptor.forClass(CommunityDetails.class); + final ArgumentCaptor projectsCapture = ArgumentCaptor.forClass(CommunityProject.class); + final ArgumentCaptor datasourcesCapture = ArgumentCaptor.forClass(CommunityContentprovider.class); + final ArgumentCaptor orgsCapture = ArgumentCaptor.forClass(CommunityOrganization.class); + final ArgumentCaptor subCommunitiesCapture = ArgumentCaptor.forClass(SubCommunity.class); + + Mockito.verify(service, Mockito.times(1)).saveCommunity(detailsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityProjects(Mockito.anyString(), projectsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityContentProviders(Mockito.anyString(), datasourcesCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addCommunityOrganizations(Mockito.anyString(), orgsCapture.capture()); + Mockito.verify(service, Mockito.times(1)).addSubCommunities(Mockito.anyString(), subCommunitiesCapture.capture()); + + final CommunityDetails details = detailsCapture.getValue(); + assertEquals("fet-fp7", details.getId()); + // System.out.println(details); + + final List projects = projectsCapture.getAllValues(); + assertEquals(0, projects.size()); + // projects.forEach(System.out::println); + + final List datasources = datasourcesCapture.getAllValues(); + assertEquals(0, datasources.size()); + // datasources.forEach(System.out::println); + + final List orgs = orgsCapture.getAllValues(); + assertEquals(0, orgs.size()); + // orgs.forEach(System.out::println); + + final List subs = subCommunitiesCapture.getAllValues(); + assertEquals(151, subs.size()); + subs.forEach(System.out::println); + + } + +} diff --git a/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile.xml b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile.xml new file mode 100644 index 00000000..0522cd4f --- /dev/null +++ b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile.xml @@ -0,0 +1,3327 @@ + +
+ + + + + +
+ + + + manager + <p>EGI is the federation of computing and storage resource providers united by a mission of delivering advanced computing and data analytics services for research and innovation.</p> + + https://documents.egi.eu/public/RetrieveFile?docid=2905&filename=EGI%20Logo%20-%20no%20background%201000px%20%281%29.png&version=2 + EGI : advanced computing for research + giuseppe.larocca@egi.eu + + egi + + + 1 + + 1.1 + + 1.1.1 + + + 1.1.2 + + + 1.1.3 + + + 1.1.99 + + + + 1.2 + + 1.2.1 + + + 1.2.2 + + + 1.2.3 + + + 1.2.4 + + + 1.2.5 + + + 1.2.6 + + + 1.2.7 + + + 1.2.8 + + + 1.2.9 + + + 1.2.10 + + + 1.2.11 + + + 1.2.12 + + + 1.2.13 + + + 1.2.14 + + + 1.2.15 + + + 1.2.99 + + + + 1.3 + + 1.3.1 + + + 1.3.2 + + + 1.3.3 + + + 1.3.4 + + + 1.3.5 + + + 1.3.6 + + + 1.3.99 + + + + 1.4 + + 1.4.1 + + + 1.4.2 + + + 1.4.3 + + + 1.4.4 + + + 1.4.5 + + + 1.4.6 + + + 1.4.7 + + + 1.4.8 + + + 1.4.9 + + + 1.4.10 + + + 1.4.11 + + + 1.4.12 + + + 1.4.99 + + + + 1.5 + + 1.5.1 + + + 1.5.2 + + + 1.5.3 + + + 1.5.4 + + + 1.5.5 + + + 1.5.6 + + + 1.5.7 + + + 1.5.8 + + + 1.5.9 + + + 1.5.10 + + + 1.5.11 + + + 1.5.12 + + + 1.5.13 + + + 1.5.14 + + + 1.5.15 + + + 1.5.16 + + + 1.5.17 + + + 1.5.18 + + + 1.5.19 + + + 1.5.20 + + + 1.5.21 + + + 1.5.22 + + + 1.5.23 + + + 1.5.24 + + + 1.5.25 + + + 1.5.26 + + + 1.5.27 + + + 1.5.28 + + + 1.5.29 + + + 1.5.99 + + + + 1.6 + + 1.6.1 + + + 1.6.2 + + + 1.6.3 + + + 1.6.4 + + + 1.6.5 + + + 1.6.6 + + + 1.6.7 + + + 1.6.8 + + + 1.6.9 + + + 1.6.10 + + + 1.6.11 + + + 1.6.12 + + + 1.6.13 + + + 1.6.14 + + + 1.6.15 + + + 1.6.16 + + + 1.6.17 + + + 1.6.18 + + + 1.6.19 + + + 1.6.20 + + + 1.6.21 + + + 1.6.22 + + + 1.6.23 + + + 1.6.24 + + + 1.6.25 + + + 1.6.26 + + + 1.6.99 + + + + 1.7 + + 1.7.1 + + + 1.7.2 + + + 1.7.3 + + + 1.7.4 + + + 1.7.5 + + + 1.7.6 + + + 1.7.7 + + + 1.7.8 + + + 1.7.9 + + + 1.7.10 + + + 1.7.99 + + + + + 2 + + 2.1 + + 2.1.1 + + + 2.1.2 + + + 2.1.3 + + + 2.1.4 + + + 2.1.5 + + + 2.1.99 + + + + 2.2 + + 2.2.1 + + + 2.2.2 + + + 2.2.3 + + + 2.2.4 + + + 2.2.99 + + + + 2.3 + + 2.3.1 + + + 2.3.2 + + + 2.3.3 + + + 2.3.4 + + + 2.3.5 + + + 2.3.99 + + + + 2.4 + + 2.4.1 + + + 2.4.2 + + + 2.4.99 + + + + 2.5 + + 2.5.1 + + + 2.5.2 + + + 2.5.99 + + + + 2.6 + + 2.6.1 + + + 2.6.2 + + + 2.6.3 + + + 2.6.4 + + + 2.6.5 + + + 2.6.99 + + + + 2.7 + + 2.7.1 + + + 2.7.2 + + + 2.7.99 + + + + 2.8 + + 2.8.1 + + + 2.8.2 + + + 2.8.3 + + + 2.8.4 + + + 2.8.5 + + + 2.8.6 + + + 2.8.7 + + + 2.8.8 + + + 2.8.99 + + + + 2.9 + + 2.9.1 + + + 2.9.2 + + + 2.9.99 + + + + 2.10 + + 2.10.1 + + + 2.10.2 + + + 2.10.3 + + + 2.10.4 + + + 2.10.5 + + + 2.10.6 + + + 2.10.7 + + + 2.10.8 + + + 2.10.99 + + + + 2.11 + + 2.11.1 + + + 2.11.2 + + + 2.11.99 + + + + + 3 + + 3.1 + + 3.1.1 + + + 3.1.2 + + + 3.1.3 + + + 3.1.4 + + + 3.1.5 + + + 3.1.6 + + + 3.1.7 + + + 3.1.8 + + + 3.1.9 + + + 3.1.99 + + + + 3.2 + + 3.2.1 + + + 3.2.2 + + + 3.2.3 + + + 3.2.4 + + + 3.2.5 + + + 3.2.6 + + + 3.2.7 + + + 3.2.8 + + + 3.2.9 + + + 3.2.10 + + + 3.2.11 + + + 3.2.12 + + + 3.2.13 + + + 3.2.14 + + + 3.2.15 + + + 3.2.16 + + + 3.2.17 + + + 3.2.18 + + + 3.2.19 + + + 3.2.20 + + + 3.2.21 + + + 3.2.22 + + + 3.2.23 + + + 3.2.24 + + + 3.2.25 + + + 3.2.26 + + + 3.2.27 + + + 3.2.28 + + + 3.2.29 + + + 3.2.99 + + + + 3.3 + + 3.3.1 + + + 3.3.2 + + + 3.3.3 + + + 3.3.4 + + + 3.3.5 + + + 3.3.6 + + + 3.3.7 + + + 3.3.8 + + + 3.3.9 + + + 3.3.10 + + + 3.3.11 + + + 3.3.12 + + + 3.3.13 + + + 3.3.14 + + + 3.3.99 + + + + 3.4 + + 3.4.1 + + + 3.4.2 + + + 3.4.3 + + + 3.4.4 + + + 3.4.5 + + + 3.4.6 + + + 3.4.99 + + + + + 4 + + 4.1 + + 4.1.1 + + + 4.1.2 + + + 4.1.3 + + + 4.1.4 + + + 4.1.5 + + + 4.1.6 + + + 4.1.99 + + + + 4.2 + + 4.2.1 + + + 4.2.2 + + + 4.2.3 + + + 4.2.4 + + + 4.2.99 + + + + 4.3 + + 4.3.1 + + + 4.3.2 + + + 4.3.3 + + + 4.3.4 + + + 4.3.5 + + + 4.3.6 + + + 4.3.7 + + + 4.3.99 + + + + 4.4 + + 4.4.1 + + + 4.4.2 + + + 4.4.3 + + + 4.4.4 + + + 4.4.5 + + + 4.4.6 + + + 4.4.7 + + + 4.4.99 + + + + + 5 + + 5.1 + + 5.1.1 + + + 5.1.2 + + + 5.1.3 + + + 5.1.4 + + + 5.1.5 + + + 5.1.6 + + + 5.1.7 + + + 5.1.8 + + + 5.1.9 + + + 5.1.10 + + + 5.1.11 + + + 5.1.99 + + + + 5.2 + + 5.2.1 + + + 5.2.2 + + + 5.2.3 + + + 5.2.4 + + + 5.2.99 + + + + 5.3 + + 5.3.1 + + + 5.3.2 + + + 5.3.99 + + + + 5.4 + + 5.4.1 + + + 5.4.2 + + + 5.4.3 + + + 5.4.4 + + + 5.4.5 + + + 5.4.5 + + + 5.4.7 + + + 5.4.8 + + + 5.4.99 + + + + 5.5 + + 5.5.1 + + + 5.5.2 + + + 5.5.3 + + + 5.5.4 + + + 5.5.5 + + + 5.5.6 + + + 5.5.7 + + + 5.5.8 + + + 5.5.9 + + + 5.5.99 + + + + 5.6 + + 5.6.1 + + + 5.6.2 + + + 5.6.3 + + + 5.6.4 + + + 5.6.5 + + + 5.6.6 + + + 5.6.7 + + + 5.6.8 + + + 5.6.99 + + + + 5.7 + + 5.7.1 + + + 5.7.2 + + + 5.7.3 + + + 5.7.99 + + + + 5.8 + + 5.8.1 + + + 5.8.2 + + + 5.8.3 + + + 5.8.4 + + + 5.8.99 + + + + + 6 + + 6.1 + + 6.1.1 + + + 6.1.2 + + + 6.1.99 + + + + 6.2 + + 6.2.1 + + + 6.2.2 + + + 6.2.3 + + + 6.2.4 + + + 6.2.5 + + + 6.2.6 + + + 6.2.99 + + + + 6.3 + + 6.3.1 + + + 6.3.2 + + + 6.3.3 + + + 6.3.4 + + + 6.3.5 + + + 6.3.99 + + + + 6.4 + + 6.4.1 + + + 6.4.2 + + + 6.4.3 + + + 6.4.4 + + + 6.4.5 + + + 6.4.99 + + + + + 7 + + 7.1 + + + 7.2 + + + 7.3 + + + 7.99 + + + + + + orp_________::9b49c76cf40a93f89944889678b741f9 + EGI Applications Database + EGI Applications Database + true + + + + + + Engaging the EGI Community towards an Open Science Commons + (Acknowledgement) + The European Grid Initiative (EGI) is partner in EGI-ENGAGE + 654142 + H2020-EU.1.4.1.3. + https://www.egi.eu/about/egi-engage/ + EC + + + INDIGO-DataCloud - INtegrating Distributed data Infrastructures for Global ExplOitation + (Acknowledgement) + + 653549 + H2020-EU.1.4.1.3. + + EC + + + Authentication and Authorisation for Research and Collaboration (AARC) + (Acknowledgement) + + 653965 + H2020-EU.1.4.1.3. + + EC + + + Education for Data Intensive Science to Open New science frontiers + (Acknowledgement) + + 675419 + H2020-EU.1.4.2.2. + + EC + + + Environmental Research Infrastructures Providing Shared Solutions for Science and Society + (Acknowledgement) + + 654182 + H2020-EU.1.4.1.1. + + EC + + + ELITRANS-Facilitating the transformation of ELI from ERDF funded, distributed infrastructures towards a unified ELI-ERIC + (Acknowledgement) + + 676627 + H2020-EU.1.4.1.1. + + EC + + + Helix Nebula – The Science Cloud + (Acknowledgement) + + 687614 + H2020-EU.2.1.1. + + EC + + + Next Generation GEOSS for Innovation Business + (Acknowledgement) + + 730329 + H2020-EU.3.5.5. + + EC + + + Accelerating user-driven e-infrastructure innovation in Food Agriculture + (Acknowledgement) + + 731001 + H2020-EU.1.4.1.3. + + EC + + + The European Open Science Cloud for Research Pilot Project + (Acknowledgement) + + 739563 + H2020-EU.1.4.1.1. + + EC + + + European Research Infrastructures in the International Landscape + (Acknowledgement) + + 730974 + H2020-EU.1.4.3. + + EC + + + Advanced European Network of E-infrastructuresfor Astronomy with the SKA + (Acknowledgement) + + 731016 + H2020-EU.1.4. + + EC + + + European E-Infrastructure Services Gateway + (Acknowledgement) + + 731049 + H2020-EU.1.4. + + EC + + + Cherenkov Telescope Array: Infrastructure Development and Start of Implementation + (Acknowledgement) + + 676134 + H2020-EU.1.4.1.1. + + EC + + + Astroparticle and Oscillations Research with Cosmics in the Abyss (ARCA and ORCA) + (Acknowledgement) + + 739560 + H2020-EU.1.4.1.1. + + EC + + + Searching for The Origin of Cosmic Rays and Neutrinos with LOFAR + (Acknowledgement) + + 640130 + H2020-EU.1.4.1.1. + + EC + + + Final Design, Construction and Operations of the Large Synoptic Survey Telescope (LSST) + (Acknowledgement) + + 1258333 + + + NSF + + + Integrated Structural Biology Infrastructure + (Acknowledgement) + + 211252 + FP7-INFRASTRUCTURES + + EC + + + Biobanking and Biomolecular Resources Research Infrastructure + (Acknowledgement) + + 212111 + FP7-INFRASTRUCTURES + + EC + + + Life Watch + (Acknowledgement) + + 211372 + FP7-INFRASTRUCTURES + + EC + + + Distributed Research Infrastructure for Hydro-Meteorology + (Acknowledgement) + + 283568 + FP7-INFRASTRUCTURES + + EC + + + Building data bridges from biology to medicine in Europe + (Acknowledgement) + The European Grid Initiative (EGI) is partner in BioMedBridges + 284209 + http://www.biomedbridges.eu/ + FP7-INFRASTRUCTURES + EC + + + Biodiversity Virtual e-Laboratory + (Acknowledgement) + The European Grid Initiative (EGI) is partner in BioVel + 283359 + http://www.biovel.eu/ + EC + + + Digital Cultural Heritage - Roadmap for Preservation + (Acknowledgement) + The European Grid Initiative (EGI) is partner in DCH-RP + 312274 + http://www.dch-rp.eu/ + FP7-INFRASTRUCTURES + EC + + + Distributed Research Infrastructure for Hydro-Meteorology Study + (Acknowledgement) + (rule) + 246703 + http://www.drihms.eu/ + EC + + + Financial Study for Sustainable Computing e-Infrastructures + (Acknowledgement) + The European Grid Initiative (EGI) is partner in e-Fiscal + 283449 + http://efiscal.eu/ + FP7-INFRASTRUCTURES + EC + + + e-ScienceTalk + (Acknowledgement) + Coordinated by the European Grid Initiative (EGI) + 260733 + http://www.e-sciencetalk.org/ + FP7-INFRASTRUCTURES + EC + + + Initiative for Globus in Europe + (Acknowledgement) + Memorandum of Understanding between IGE and EGI + 261560 + http://www.ige-project.eu/ + FP7-INFRASTRUCTURES + EC + + + European Desktop Grid Initiative + (Acknowledgement) + Memorandum of Understanding between EDGI and EGI-Inspire + 261556 + www.edgi-project.eu + FP7-INFRASTRUCTURES + EC + + + European Grid Initiative: Integrated Sustainable Pan-European Infrastructure for Researchers in Europe + The authors acknowledge the use of resources provided by the European Grid Infrastructure. For more information, please reference the EGI-InSPIRE paper (http://go.egi.eu/pdnon). + Coordinated by the European Grid Initiative (EGI) + 261323 + https://www.egi.eu/about/egi-inspire/ + FP7-INFRASTRUCTURES + EC + + + Common Operations of Environmental Research Infrastructures + (Acknowledgement) + The European Grid Initiative (EGI) is partner in ENVRI + 283465 + http://envri.eu/ + EC + + + European Research Community through interoperable workflows and data sharing + (Acknowledgement) + The European Grid Initiative (EGI) is partner in ER-Flow + 312579 + http://www.erflow.eu/ + FP7-INFRASTRUCTURES + EC + + + Scalable Software Services for Life Science + (Acknowledgement) + Memorandum of Understanding between MAPPER and EGI-InSpire + 261523 + http://www.scalalife.eu/ + FP7-INFRASTRUCTURES + EC + + + SCIentific gateway Based User Support + (Acknowledgement) + Memorandum of Understanding between SCI-BUS and EGI + 283481 + http://www.sci-bus.eu/ + FP7-INFRASTRUCTURES + EC + + + SHaring Interoperable Workflows for large-scale scientific simulations on Available DCIs + (Acknowledgement) + Memorandum of Understanding between SHIWA and EGI-Inspire + 261585 + http://www.shiwa-workflow.eu/ + FP7-INFRASTRUCTURES + EC + + + Standards and Interoperability for e-Infrastructure Implementation Initiative + (Acknowledgement) + Memorandum of Understanding between SIENA and EGI-Inspire + 261575 + http://www.sienainitiative.eu/ + FP7-INFRASTRUCTURES + EC + + + StratusLab + (Acknowledgement) + Memorandum of Understanding between StratusLab and EGI-Inspire + 261552 + http://stratuslab.eu/ + FP7-INFRASTRUCTURES + EC + + + Virtual Earthquake and seismology Research Community in Europe e-science environment + (Acknowledgement) + (rule) + 283543 + http://www.verce.eu/ + FP7-INFRASTRUCTURES + EC + + + A worldwide e-Infrastructure for NMR and structural biology + (Acknowledgement) + Memorandum of Understanding between WENMR and EGI + 261572 + http://www.wenmr.eu/ + FP7-INFRASTRUCTURES + EC + + + Helix Nebula - The Science Cloud + (Acknowledgement) + The European Grid Initiative (EGI) is partner in Helix Nebula + 312301 + http://helix-nebula.eu/ + EC + + + Implementing service management in federated e-Infrastructures + (Acknowledgement) + The European Grid Initiative (EGI) is partner in FedSM + 312851 + http://www.fedsm.eu/ + FP7-INFRASTRUCTURES + EC + + + eXtreme DataCloud + XDC + 777367 + EC + corda__h2020::bc39648d03d80db1a0d8ccc58a5b2f7f + + + Photon and Neutron Open Science Cloud + PaNOSC + 823852 + EC + corda__h2020::1bee3b3a56ad05cd3c579e30dab98b53 + + + Transforming Research through Innovative Practices for Linked interdisciplinary Exploration + TRIPLE + 863420 + EC + corda__h2020::94b1b8e5309715e7aa2ab9d87dcc1dfe + + + EOSC Photon and Neutron Data Services + ExPaNDS + 857641 + EC + corda__h2020::9d87a9fbd7da1345ec6ba3a4710c4f68 + + + Interactive and agile/responsive sharing mesh of storage, data and applications for EOSC + CS3MESH4EOSC + 863353 + EC + corda__h2020::efad077563c9db396d9f0dc16d057250 + + + European Open Science Cloud - Expanding Capacities by building Capabilities + EOSC-synergy + 857647 + EC + corda__h2020::276be245d267a8f210f0cabb584fb493 + + + Authentication and Authorisation For Research and Collaboration + AARC2 + 730941 + EC + corda__h2020::17c76b3b4adc182e4d5812fb5d5b4358 + + + Collaborative Proposal: Enhanced Gravitational Wave Search via Simultaneous Advanced LIGO/Virgo and Evryscope Detection + + 1806651 + NSF + nsf_________::b56132b73ea9d8b4b7bb5090e5b83014 + + + Collaborative Proposal: Enhanced Gravitational Wave Search via Simultaneous Advanced LIGO/Virgo and Evryscope Detection + + 1806625 + NSF + nsf_________::a07fc84a0a3d14522c531edea510dbe0 + + + EGI Advanced Computing for EOSC + EGI-ACE + 101017567 + EC + corda__h2020::4d14150c6863206dc57453ec042c50ff + + + Integrating and managing services for the European Open Science Cloud + EOSC-hub + 777536 + EC + corda__h2020::5f29eb8fd762816208e20c6a156435a9 + + + Enhancing the EOSC portal and connecting thematic clouds + EOSC Enhance + 871160 + EC + corda__h2020::f7925a8b2939ab29779e36a87d997cdb + + + EOSC Future + EOSC Future + 101017536 + EC + corda__h2020::256485716fdb9f5ca69007b7ca5a072b + + + European Federation of Data Driven Innovation Hubs + EUHubs4Data + 951771 + EC + corda__h2020::1181bbd5a4431d18f0467e1e44d072dc + + + European Federation of Data Driven Innovation Hubs + EUHubs4Data + 951771 + EC + corda__h2020::1181bbd5a4431d18f0467e1e44d072dc + + + AN AI ON-DEMAND PLATFORM TO SUPPORT RESEARCH EXCELLENCE IN EUROPE + AI4EUROPE + 101070000 + EC + corda_____he::357fe0aade31301ce04f06d230d22718 + + + Automated, Transparent Citizen-Centric Public Policy Making based on Trusted Artificial Intelligence + AI4PublicPolicy + 101004480 + EC + corda__h2020::891235b6b2b9cf2cbadf2346418169db + + + operAtional seNsing lifE technologies for maRIne ecosystemS + ANERIS + 101094924 + EC + corda_____he::e82ffe09e25f376dfd068deb21a7ba6e + + + BD4NRG: Big Data for Next Generation Energy + BD4NRG + 872613 + EC + corda__h2020::a3d6ae6b7075764a1a54c09317fef1b4 + + + A federated European FAIR and Open Research Ecosystem for oceans, seas, coastal and inland waters + Blue-Cloud 2026 + 101094227 + EC + corda_____he::3af56818d6bb019793a6fae45c9260ec + + + Creating a Robust Accessible Federated Technology for Open Access + CRAFT-OA + 101094397 + EC + corda_____he::c54aa74d92a200869544259903b8671e + + + Copernicus - eoSC AnaLytics Engine + C-SCALE + 101017529 + EC + corda__h2020::96945f03d96929e0e48bd7a0bf3fa95c + + + DATA Monetization, Interoperability, Trading & Exchange + DATAMITE + 101092989 + EC + corda_____he::8ed6ec195e0b0c6080644e3f9cf41a01 + + + eviDEnce and Cloud for more InformeD and effective pOlicies + DECIDO + 101004605 + EC + corda__h2020::b9c962dd65b8c26abe4f8f0a39d4e024 + + + Providing an open collaborative space for digital biology in Europe + EOSC-Life + 824087 + EC + corda__h2020::b5827cc3dcc9a82dd052fcfa0a6ee04f + + + leveraging the European compute infrastructures for data-intensive research guided by FAIR principles + EuroScienceGateway + 101057388 + EC + corda_____he::2641f1fd24670a0dda126225c89c1273 + + + GraspOS: next Generation Research Assessment to Promote Open Science + GraspOS + 101095129 + EC + corda_____he::6f17d6d6d3e7c3ed44ad6f92b76e870d + + + Imaging data and services for aquatic science + iMagine + 101058625 + EC + corda_____he::cee20577a3cf295391e596e40621449f + + + An interdisciplinary Digital Twin Engine for science + interTwin + 101058386 + EC + corda_____he::c437390f6c091018ae84b8e703b8528c + + + Land-Based Solutions for Plastics in the Sea + LABPLAS + 101003954 + EC + corda__h2020::865e31f9be6af7764c32f30550435a96 + + + LETHE (λήθη) – A personalized prediction and intervention model for early detection and reduction of risk factors causing dementia, based on AI and distributed Machine Learning + LETHE + 101017405 + EC + corda__h2020::056647d4430f4f7f568624d873051379 + + + Tools and methods for extended plant PHENotyping and EnviroTyping services of European Research Infrastructures + PHENET + 101094587 + EC + corda_____he::15c9f24a425d0fa039d7322bfc6d1a30 + + + Plasmasphere Ionosphere Thermosphere Integrated Research Environment and Access services: a Network of Research Facilities + PITHIA-NRF + 101007599 + EC + corda__h2020::0bb8fd73c5e595d4eab73332e7876e4f + + + Stairway to AI: Ease the Engagement of Low-Tech users to the AI-on-Demand platform through AI + StairwAI + 101017142 + EC + corda__h2020::b1923975d67f7eccc4d0927fa8b28b9a + + + Digital Technologies ActiNg as a Gatekeeper to information and data flOws + TANGO + 101070052 + EC + corda_____he::0d33cea17196f335263fd69b89e7ad47 + + + EOSC Focus + EOSC Focus + 101058432 + EC + corda_____he::f66dfbc3c3ef813cbc9944a6b5ad6ae1 + + + HealthyCloud – Health Research & Innovation Cloud + HealthyCloud + 965345 + EC + corda__h2020::3257085945ac3b3fb05346ccb78d5aba + + + SoBigData RI Preparatory Phase Project + SoBigData RI PPP + 101079043 + EC + corda_____he::be32eead9cdc9d1d636b75101f30b0d0 + + + SoBigData++: European Integrated Infrastructure for Social Mining and Big Data Analytics + SoBigData-PlusPlus + 871042 + EC + corda__h2020::a45280b6e42e263da0c4e85e5bf6845b + + + Unlocking the Cloud Edge IoT demand potential in Europe + UNLOCK-CEI + 101070571 + EC + corda_____he::0abae4136e9beb18068a36ff0860f30c + + + On the road to sustainability: paving the way for OPERAS as an efficient open Social Sciences and Humanities scholarly communication Research Infrastructure + OPERAS-PLUS + 101079608 + EC + corda_____he::fad6e19d7ead030721d4ead45194cafc + + + Horizon Cloud – The Forum for Strategy Focused Cloud Stakeholders + H-CLOUD + 871920 + EC + corda__h2020::bd886c247660d95f323f5d9343f9f8da + + + + + ETFBL + + + BELNET + + + IICT-BAS + + + SWiNG + CERN + + + CyGrid + + + CESNET + + + Gauss-Allianz + EMBL + + + DCSC + + + EENet + + + CSIC + + + CSC + + + CNRS + + + GRNET + + + SRCE + + + NIIF + + + Grid-Ireland + + + IUCC + + + INFN + + + VU + + + RESTENA + + + LUMII + + + UoM + + + MARGI + + + NCF + + + UNINETT Sigma AS + + + CYFRONET AGH + + + UMIC + + + ICI + + + IPB + + + ARNES + + + SlovakGrid + + + SNIC + + + ULAKBIM + + + JISC + + + IIAP NAS RA + + + RENAM + + + e-ARENA + + + + + Bosnia and Herzegovina + + + Belgium + + + Bulgaria + + + Switzerland + + + Cyprus + + + Czech Republic + + + Germany + + + Denmark + + + Estonia + + + Spain + + + Finland + + + France + + + Greece + + + Croatia + + + Hungary + + + Ireland + + + Israel + + + Italy + + + Lithuania + + + Luxembourg + + + Latvia + + + Montenegro + + + Macedonia + + + the Netherlands + + + Norway + + + Poland + + + Portugal + + + Romania + + + Serbia + + + Slovenia + + + Slovakia + + + Sweden + + + Turkey + + + United Kingdom + + + Armenia + + + Moldova + + + Russia + + + Germany + + + Switzerland + + + + + vo.grand-est.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.grand-est.fr/ + http://www.grand-est.fr + Results obtained in this paper were computed on the vo.grand-est.fr virtual organization of the EGI Infrastructure through resources from IPHC. We thank EGI, France Grilles and the IPHC Computing team for providing the technical support, computing and storage facilities. + + + astron + http://register.matrix.sara.nl/ + http://www.astron.nl + + + theophys + + + + + vo.londongrid.ac.uk + https://voms.gridpp.ac.uk:8443/voms/vo.londongrid.ac.uk/register/start.action + https://www.gridpp.ac.uk/wiki/Vo.londongrid.ac.uk + + + vo.grif.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.grif.fr/ + http://www.grif.fr/ + + + eo-grid.ikd.kiev.ua + https://voms.grid.ikd.kiev.ua:8443/voms/eo-grid.ikd.kiev.ua + http://inform.ikd.kiev.ua/eo-grid/ + + + ops.ndgf.org + https://voms.ndgf.org:8443/voms/ops.ndgf.org + http://www.ndgf.org/ + + + vo.msfg.fr + http://www.lupm.univ-montp2.fr/article.php3?id_article=79 + http://www.lupm.univ-montp2.fr/article.php3?id_article=79 + + + ilc + https://grid-voms.desy.de:8443/voms/ilc/ + http://www-flc.desy.de/flc/ + This work benefited from services provided by the ILC Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + gr-sim.grid.auth.gr + https://voms.hellasgrid.gr:8443/voms/gr-sim/register/start.action + http://www.grid.auth.gr + + + chem.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/chem.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Chemical Ibergrid Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.sbg.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.sbg.in2p3.fr/ + http://www.iphc.cnrs.fr + Results obtained in this paper were computed on the vo.sbg.in2p3.fr virtual organization of the EGI Infrastructure through resources from IPHC. We thank EGI, France Grilles and the IPHC Computing team for providing the technical support, computing and storage facilities + + + comet.j-parc.jp + https://voms.gridpp.ac.uk:8443/voms/comet.j-parc.jp/register/start.action + http://comet.kek.jp + + + vo.earthserver.eu + https://voms.ct.infn.it:8443/voms/vo.earthserver.eu + http://earthserver-sg.consorzio-cometa.it/ + This work benefited from services and resources provided by the vo.earthserver.eu Virtual Organization, supported by the national resource providers of the EGI Federation. + + + vo.sn2ns.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.sn2ns.in2p3.fr/register/start.action + http://irfu.cea.fr/Projets/SN2NS + This work benefited from services provided by the vo.sn2ns.in2p3.fr Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + trgridd + https://voms.ulakbim.gov.tr:8443/voms/trgridd/ + https://voms.ulakbim.gov.tr:8443/voms/trgridd/ + + + vo.pic.es + https://voms.pic.es:8443/voms/vo.pic.es + http://www.pic.es + + + zeus + https://grid-voms.desy.de:8443/voms/zeus + http://www-zeus.desy.de/ + + + supernemo.vo.eu-egee.org + https://voms.gridpp.ac.uk:8443/voms/supernemo.vo.eu-egee.org/register/start.action + http://nemo.in2p3.fr + + + biomed + https://cclcgvomsli01.in2p3.fr:8443/voms/biomed + http://lsgc.org/en/Biomed:home + + This work was achieved using the biomed virtual organisation of the EGI infrastructure, with the dedicated support of resource centres BEINJING-LCG2, IN2P3-IRES, OBSPM, INFN-FERRARA, GARR-01-DIR, INFN-CATANIA, INFN-ROMA3, INFN-BARI, CREATIS-INSA-LYON, NCG-INGRID-PT, INFN-PISA, CESNET-MetaCloud and CLOUFIN , resource centres in UK hosted by GridPP collaboration, and the additional support of the resource centres listed here: http://operations-portal.egi.eu/vapor/resources/GL2Browser?VOfilter=biomed + + + + prod.vo.eu-eela.eu + https://voms.grid.unam.mx:8443/voms/prod.vo.eu-eela.eu + http://www.e-science.unam.mx/ + + + vo.ops.csic.es + https://voms.ific.uv.es:8443/voms/vo.ops.csic.es/ + http://www.grid.csic.es/ + + + euindia + https://voms2.cnaf.infn.it:8443/voms/euindia/ + http://www.euindiagrid.eu/ + + + vo.northgrid.ac.uk + https://voms.gridpp.ac.uk:8443/voms/vo.northgrid.ac.uk + https://voms.gridpp.ac.uk:8443/voms/vo.northgrid.ac.uk + + + drihm.eu + https://vomsmania.cnaf.infn.it:8443/voms/drihm.eu/ + http://www.drihm.eu/ + This work used the EGI infrastructure with the support of AM-01-IIAP, HG-02-IASA, HG-03-AUTH, HG-08-Okeanos, INFN-PADOVA + + + ict.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/ict.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Ibergrid ICT Virtual Organisation, supported by the national resource providers of the EGI Federation + + + hyperk.org + https://voms.gridpp.ac.uk:8443/voms/hyperk.org/register/start.action + http://www.hyperk.org + + + vo.eu-decide.eu + http://applications.eu-decide.eu + https://voms.ct.infn.it:8443/voms/vo.eu-decide.eu + This work benefited from services and resources provided by the vo.eu-decide.eu Virtual Organization, supported by the national resource providers of the EGI Federation. + + + superbvo.org + http://superb.infn.it/how-to-join-us + http://superb.infn.it/home + + + gilda + https://voms.ct.infn.it:8443/voms/gilda + https://gilda.ct.infn.it + + + xenon.biggrid.nl + https://voms.grid.sara.nl:8443/voms/xenon.biggrid.nl + https://wiki.biggrid.nl/wiki/index.php/Xenon + + + balticgrid + https://voms.balticgrid.org:8443/voms/balticgrid/ + http://www.balticgrid.org + + + gerda.mpg.de + https://vomsmania.cnaf.infn.it:8443/voms/gerda.mpg.de/ + http://www.mpi-hd.mpg.de/gerda + + + belle + https://voms.cc.kek.jp:8443/voms/belle + http://belle2.kek.jp/ + + + vo.stratuslab.eu + https://voms.grid.auth.gr:8443/voms/vo.stratuslab.eu/register/start.action + http://www.stratuslab.eu + + + camont + http://www.hep.phy.cam.ac.uk/~parker/camtology/camont.html + http://www.hep.phy.cam.ac.uk/~parker/camtology/camont.html + + + peachnote.com + https://perun.metacentrum.cz/perun-registrar-cert/?vo=peachnote.com + http://www.peachnote.com + This work used the EGI infrastructure with the dedicated support of CESNET-MetaCloud + + + ific + https://swevo.ific.uv.es:8443/voms/ific + http://ific.uv.es + + + pacs.infn.it + + + + + oxgrid.ox.ac.uk + http://oxgrid-vom.oerc.ox.ac.uk/cgi-bin/application.pl + http://www.oerc.ox.ac.uk/resources/oxgrid + + + glast.org + https://voms2.cnaf.infn.it:8443/voms/glast.org/ + http://glast.gsfc.nasa.gov/ + We would like to thank the INFN GRID Data Centers of ..., ..., ..., and ..., ... + + + demo.vo.edges-grid.eu + http://edgi-project.eu/ + http://edgi-project.eu/ + + + vo.dorii.eu + https://voms.grid.auth.gr:8443/voms/vo.dorii.eu/ + http://www.dorii.eu/applications + + + vo.u-psud.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.u-psud.fr/register/start.action + http://www.lri.fr/Demain/?cat=18 + + + vo.cta.in2p3.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.cta.in2p3.fr/register/start.action + http://www.mpi-hd.mpg.de/hfm/CTA/ + This work used the EGI Infrastructure and is co-funded by the EGI-Engage project (Horizon 2020) under Grant number 654142. + + + hgdemo + https://voms.grid.auth.gr:8443/voms/hgdemo + http://www.grid.auth.gr/en/services/ + + + ngs.ac.uk + http://www.ngs.ac.uk/ukca/apply + http://www.ngs.ac.uk + + + mpi-kickstart.egi.eu + https://egee.cesnet.cz/mpi/registration/prihlaska_priprav.php + https://www.metacentrum.cz/en/VO/MPI/index.html + + + ops.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/ops.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + + + trgride + https://voms.ulakbim.gov.tr:8443/voms/trgride/ + https://voms.ulakbim.gov.tr:8443/voms/trgride/ + + + vo.indicate-project.eu + https://voms.ct.infn.it:8443/voms/vo.indicate-project.eu + http://indicate-gw.consorzio-cometa.it/ + This work benefited from services and resources provided by the vo.indicate-project.eu Virtual Organization, supported by the national resource providers of the EGI Federation. + + + vo.lpnhe.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.lpnhe.in2p3.fr + http://lpnhe.in2p3.fr + This work benefited from services provided by the LPNHE Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + planck + https://voms.cnaf.infn.it:8443/voms/planck/register/start.action + http://www.oats.inaf.it/it/tematiche-ricerca/macroarea-5/265-planck-lfi + This work benefited from services provided by the planck Virtual Organisation, supported by the national resource providers of the EGI Federation + + + egeode + https://cclcgvomsli01.in2p3.fr:8443/voms/egeode/ + http://www.egeode.org + + + vo.sim-e-child.org + https://voms.gnubila.fr:8443/voms/vo.sim-e-child.org + http://sec-portal.maatg.fr + + + uniandes.edu.co + https://caribe.uniandes.edu.co:8443/voms/uniandes.edu.co/register/start.action + https://caribe.uniandes.edu.co:8443/voms/uniandes.edu.co/user/home.action + + + oper.vo.eu-eela.eu + https://voms.eela.ufrj.br:8443/voms/oper.vo.eu-eela.eu + http://www.eu-eela.eu + + + vo.france-grilles.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.france-grilles.fr + http://www.france-grilles.fr/ + The authors acknowledge the support of France Grilles for providing computing resources on the French National Grid Infrastructure. + + + ncf + https://voms.grid.sara.nl:8443/voms/ncf/admin/home.action + https://www.surfsara.nl/systems/grid/new-users + + + vo.astro.pic.es + https://voms01.pic.es:8443/voms/vo.astro.pic.es + http://www.cosmo.pic.es + + + hess + https://cagraidsvr10.cs.tcd.ie:8443/voms/vo.hess-experiment.eu/webui/request/user/create + http://www.mpi-hd.mpg.de/hfm/HESS/ + + + sgdemo + https://voms.grid.auth.gr:8443/voms/sgdemo + + + + phys.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/phys.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Ibergrid Physics Virtual Organisation, supported by the national resource providers of the EGI Federation + + + infngrid + https://voms.cnaf.infn.it:8443/voms/infngrid/ + http://grid.infn.it + This work benefited from services provided to the INFNGRID Virtual Organisation by the national resource providers of the EGI Federation + + + embrace + https://cclcgvomsli01.in2p3.fr:8443/voms/embrace/register/start.action + http://www.embracegrid.info/ + + + bbmri.nl + https://voms.grid.sara.nl:8443/voms/bbmri.nl + http://www.bbmri.nl + + + gridit + https://voms.cnaf.infn.it:8443/voms/gridit/ + http://www.italiangrid.org/ + This work benefited from services provided to the GRIDIT Virtual Organisation by the national resource providers of the EGI Federation + + + vo.aginfra.eu + https://voms.ipb.ac.rs:8443/voms/vo.aginfra.eu/ + http://www.aginfra.eu/ + + + shiwa-workflow.eu + https://cclcgvomsli01.in2p3.fr:8443/voms/shiwa-workflow.eu/ + http://www.shiwa-workflow.eu + + + igi.italiangrid.it + https://vomsmania.cnaf.infn.it:8443/voms/igi.italiangrid.it/ + http://www.italiangrid.it/ + + + armgrid.grid.am + https://voms.grid.am:8443/voms/armgrid.grid.am/ + http://www.grid.am + + + gridcc + https://voms.grid.auth.gr:8443/voms/gridcc + http://www.gridcc.org/ + + + vo.turbo.pic.es + https://voms01.pic.es:8443/voms/vo.turbo.pic.es/register/start.action + http://www.pic.es + + + hone + https://grid-voms.desy.de:8443/voms/hone/ + http://www-h1.desy.de/ + We thank to all partners contributing to the WLCG computing infrastructure for their support for the H1 Collaboration (list of publications: http://www-h1.desy.de/h1/www/publications/H1publication.short_list.html#YEAR2013) + + + eng.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/eng.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Ibergrid Engeneering Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + earth.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/earth.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Earth Ibergrid Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + projects.nl + https://voms.grid.sara.nl:8443/voms/projects.nl + https://e-infra.surfsara.nl/ + This work was carried out on the Dutch national e­infrastructure with the support of SURF Cooperative. + + + pierre auger + https://egee.cesnet.cz/auger/registration/ + http://www.auger.org + no statement defined + + + vo.lpsc.in2p3.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.mure.in2p3.fr/admin/home.action + http://lpsc.in2p3.fr + + + eela + https://voms.lip.pt:8443/voms/eela/webui/request/user/create + http://www.eu-eela.org/ + + + trgridb + https://voms.ulakbim.gov.tr:8443/voms/trgridb/ + https://voms.ulakbim.gov.tr:8443/voms/trgridb/ + + + proactive + https://grid12.lal.in2p3.fr:8443/voms/proactive/register/start.action + http://www-sop.inria.fr/oasis/ProActive/ + + + desktopgrid.vo.edges-grid.eu + http://idgf-sp.eu/ + http://idgf-sp.eu/ + + + vo.delphi.cern.ch + https://voms.cern.ch:8443/voms/vo.delphi.cern.ch/register/start.action + http://delphiwww.cern.ch/ + + + vo.gridcl.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.gridcl.fr/ + http://www.labex-p2io.fr + + + ildg + https://grid-voms.desy.de:8443/voms/ildg + http://plone.jldg.org/ + + + bg-edu.grid.acad.bg + https://voms.ipp.acad.bg:8443/voms/bg-edu.grid.acad.bg/register/start.action + http://www.grid.bas.bg + + + desy + https://grid-voms.desy.de:8443/voms/desy + http://grid.desy.de + + + lhcb + https://lcg-voms.cern.ch:8443/vo/lhcb/vomrs + http://lhcb.web.cern.ch/lhcb/ + The Tier1 computing centres are supported by IN2P3 (France), KIT and BMBF (Germany), INFN (Italy), NWO and SURF (The Netherlands), PIC (Spain), GridPP (United Kingdom). We are thankful for the computing resources put at our disposal by Yandex LLC (Russia), as well as to the communities behind the multiple open source software packages that we depend on. + + + esr + https://voms.grid.sara.nl:8443/voms/esr + http://www.euearthsciencegrid.org/content/esr-vo-introduction + This work benefited from services provided by the ESR Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + inaf + https://voms.cnaf.infn.it:8443/voms/inaf + http://www.inaf.it + This work benefited from services provided by the inaf Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.grid.auth.gr + https://voms.grid.auth.gr:8443/voms/vo.grid.auth.gr + http://www.grid.auth.gr/en/ + + + argo + https://voms.cnaf.infn.it:8443/voms/argo + http://argo.na.infn.it/ + + + see + https://www.grid.auth.gr/services/voms/SEE/request.php + http://www.hellasgrid.gr/about/see-vo/ + This work used the European Grid Infrastructure (EGI) through the National Grid Infrastructures NGI_GRNET , HellasGRID as part of the SEE Virtual Organisation [and is supported by the EC-funded project PRJ_NAME Grant number XXXXX]” + + + kzvo.isragrid.org.il + https://ngi-il-voms3.isragrid.org.il:8443/voms/isravo.isragrid.org.il/ + https://www.isragrid.org.il/ + + + neurogrid.incf.org + https://voms.gridpp.ac.uk:8443/voms/neurogrid.incf.org/ + http://www.incf.org + + + gaussian + https://voms.cyf-kr.edu.pl:8443/voms/gaussian + http://egee.grid.cyfronet.pl/gaussian + + + pheno + https://voms.gridpp.ac.uk:8443/voms/pheno/user/create!input.action + http://www.phenogrid.dur.ac.uk/ + + + hermes + https://grid-voms.desy.de:8443/voms/hermes + http://www-hermes.desy.de + + + mice + https://voms.gridpp.ac.uk:8443/voms/mice/register/start.action + http://www.mice.iit.edu/ + + + vo.lal.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.lal.in2p3.fr/ + http://www.lal.in2p3.fr/ + + + magic + https://voms01.pic.es:8443/voms/magic/register/start.action + http://magic.mppmu.mpg.de + n/a (List of publications http://magic.mppmu.mpg.de/publications/articles/index.html) + + + vo.neugrid.eu + https://voms.gnubila.fr:8443/voms/vo.neugrid.eu + http://neugrid.eu + The authors thank all the partners of the neuGRID4you project (N4U: www.neugrid4you.eu). The project has been co-funded by the Seventh Framework Programme of the European Union for research, technological development and demonstration under grant agreement no. 283562. This work benefited from services provided by the vo.neugrid.eu Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + iber.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/iber.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + + + vo.scotgrid.ac.uk + http://www.scotgrid.ac.uk/ + http://www.scotgrid.ac.uk/ + + + geant4 + https://lcg-voms.cern.ch:8443/vo/geant4/vomrs + http://geant4.web.cern.ch/geant4/ + + + vo.ipno.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.ipno.in2p3.fr + http://ipnweb.in2p3.fr + This work benefited from services provided by the vo.ipno.in2p3.fr Virtual Organisation, supported by the LCG distributed Tier-2 GRIF of the EGI Federation. + + + apesci + https://voms.grid.sinica.edu.tw:8443/voms/apesci/register/start.action + http://www.twgrid.org/aproc/services/vom/ + + + compchem + https://voms.cnaf.infn.it:8443/voms/compchem/ + https://www3.compchem.unipg.it + This work benefited from services and resources provided by the Compchem Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + ops + https://lcg-voms.cern.ch:8443/vo/ops/vomrs + https://wiki.egi.eu/wiki/OPS_vo + + + vo.agata.org + https://www.agata.org/grid/avo + http://www.agata.org/grid/ + + + na62.vo.gridpp.ac.uk + https://voms.gridpp.ac.uk:8443/voms/na62.vo.gridpp.ac.uk/ + http://na62.web.cern.ch/na62/ + This work benefited from services provided by the NA62 Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + seegrid + https://voms.irb.hr:8443/voms/seegrid/webui/request/user/create + http://www.see-grid.eu/ + + + snoplus.snolab.ca + https://voms.gridpp.ac.uk:8443/voms/snoplus.snolab.ca + http://snoplus.phy.queensu.ca/Home.html + + + vo.irfu.cea.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.irfu.cea.fr + http://irfu.cea.fr/ + + + gridpp + https://voms.gridpp.ac.uk:8443/voms/gridpp + http://www.gridpp.ac.uk + + + ukmhd.ac.uk + https://voms.gridpp.ac.uk:8443/voms/ukmhd.ac.uk/register/start.action + http://www.uksolphys.org/information/computing-resources/ + + + euasia.euasiagrid.org + http://aproc.twgrid.org/index.php?option=com_content&task=view&id=22&Itemid=31 + http://www.euasiagrid.org/ + + + vo.mure.in2p3.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.mure.in2p3.fr + http://lpsc.in2p3.fr/gpr/MURE/html/MURE/MURE.html + This work benefited from services provided by the vo.mure.in2p3.fr Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + icecube + https://grid-voms.desy.de:8443/voms/icecube/ + http://www.icecube.wisc.edu/ + They suggest to name in addtion to DFG (Deutsche Forschungsgemeinschaft) or NSF (National Science Foundation) also EGI resouces/help. + + + ghep + https://grid-voms.desy.de:8443/voms/ghep/register/start.action + http://grid.desy.de/ + + + pvier + https://voms.grid.sara.nl:8443/voms/pvier + http://poc.vl-e.nl/ + + + neiss.org.uk + https://voms.gridpp.ac.uk:8443/voms/neiss.org.uk/admin/home.action + http://drupals.humanities.manchester.ac.uk/neiss3/ + + + eumed + https://voms2.cnaf.infn.it:8443/voms/eumed + http://www.eumedgrid.eu + This work benefited from services and resources provided by the eumed Virtual Organization, supported by the national resource providers of the EGI Federation. + + + moldyngrid + http://moldyngrid.org + http://moldyngrid.org + + + israelvo.isragrid.org.il + https://ngi-il-voms1.isragrid.org.il:8443/voms/israel + http://www.isragrid.org.il + + + twgrid + https://voms.grid.sinica.edu.tw:8443/voms/twgrid/register/start.action + http://www.twgrid.org/aproc/services/vom/ + + + enmr.eu + https://voms2.cnaf.infn.it:8443/voms/enmr.eu/ + http://www.wenmr.eu + + The FP7 WeNMR (project# 261572), H2020 West-Life (project# 675858) and the EOSC-hub (project# 777536) European e-Infrastructure projects are acknowledged for the use of their web portals, which make use of the EGI infrastructure with the dedicated support of CESNET-MetaCloud, INFN-PADOVA, NCG-INGRID-PT, TW-NCHC, SURFsara and NIKHEF, and the additional support of the national GRID Initiatives of Belgium, France, Italy, Germany, the Netherlands, Poland, Portugal, Spain, UK, Taiwan and the US Open Science Grid + + + + xfel.eu + https://grid-voms.desy.de:8443/voms/xfel.eu + http://www.xfel.eu + + + alice + http://alien2.cern.ch/index.php?option=com_content&view=article&id=17&Itemid=90 + http://aliceinfo.cern.ch + The ALICE collaboration gratefully acknowledges the resources and support provided by all Grid centres and the Worldwide LHC Computing Grid (WLCG) collaboration. + + + hungrid + https://grid11.kfki.hu:8443/voms/hungrid + http://grid.kfki.hu/hungrid + + + euchina + https://voms2.cnaf.infn.it:8443/voms/euchina + http://www.euchinagrid.org/euchina_vo.html + + + meteo.see-grid-sci.eu + https://voms.grid.auth.gr:8443/voms/meteo.see-grid-sci.eu/register/start.action + http://wiki.egee-see.org/index.php/SG_Meteo_VO + + + vlemed + https://voms.grid.sara.nl:8443/voms/vlemed + http://www.ebioscience.amc.nl/ + + + vo.gear.cern.ch + + + + + vo.aleph.cern.ch + https://voms-admin.cern.ch:8443/voms/vo.aleph.cern.ch/ + http://cern.ch/voaleph + + + vo.complex-systems.eu + https://voms.grid.auth.gr:8443/voms/vo.complex-systems.eu/register/start.action + http://wiki.grid.auth.gr/wiki/bin/view/ComplexityScienceSSC/VO + + + atlas + https://lcg-voms.cern.ch:8443/vo/atlas/vomrs + https://www.racf.bnl.gov/docs/howto/grid/joinvo + The crucial computing support from all WLCG partners is acknowledged gratefully, in particular from CERN and the ATLAS Tier-1 facilities at TRIUMF (Canada), NDGF (Denmark, Norway, Sweden), CCIN2P3 (France), KIT/GridKA (Germany), INFN-CNAF (Italy), NL-T1 (Netherlands), PIC (Spain), ASGC (Taiwan), RAL (UK) and BNL (USA) and in the Tier-2 facilities worldwide. + + + virgo + https://voms.cnaf.infn.it:8443/voms/virgo + http://wwwcascina.virgo.infn.it/ + + + enea + https://voms.cnaf.infn.it:8443/voms/enea/ + http://www.afs.enea.it/project/eneaegee/VOenea/ + + + aegis + https://voms.ipb.ac.rs:8443/voms/aegis/ + http://www.aegis.rs/ + Numerical simulations were run on the PARADOX supercomputing facility at the Scientific Computing Laboratory of the Institute of Physics Belgrade, supported in part by the Ministry of Education, Science, and Technological Development of the Republic of Serbia under project no. ON171071 and OI1611005 + + + cdf + https://www.opensciencegrid.org/bin/view/VirtualOrganizations/VOInfo/FERMILAB + http://www-cdf.fnal.gov/ + + + epic.vo.gridpp.ac.uk + https://voms.gridpp.ac.uk:8443/voms/epic.vo.gridpp.ac.uk/admin/home.action + http://www.sruc.ac.uk/epic/ + + + vo.southgrid.ac.uk + https://voms.gridpp.ac.uk:8443/voms/vo.southgrid.ac.uk/ + http://www.southgrid.ac.uk/VO/ + + + life.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/life.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Ibergrid Life Sciences Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.general.csic.es + https://voms.ific.uv.es:8443/voms/vo.general.csic.es + http://www.grid.csic.es/ + + + tut.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/tut.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Tutorial Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.france-asia.org + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.france-asia.org/register/start.action + http://www.france-asia.org + + + vo.up.pt + https://voms.up.pt:8443/voms/vo.up.pt + http://voms.up.pt + + + lattice.itep.ru + + http://www.lattice.itep.ru/ + + + belle2.org + https://voms.cc.kek.jp:8443/voms/belle2.org + http://belle2.kek.jp/ + + + auvergrid + https://cclcgvomsli01.in2p3.fr:8443/voms/auvergrid/register/start.action + http://www.auvergrid.fr/ + + + fusion + http://fusion.bifi.unizar.es/?page_id=122 + http://fusion.bifi.unizar.es/ + This work benefited from services provided by the Fusion Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.panda.gsi.de + https://grid12.lal.in2p3.fr:8443/voms/vo.panda.gsi.de + http://panda-wiki.gsi.de/cgi-bin/view/Computing/PandaGrid + + + comput-er.it + https://voms2.cnaf.infn.it:8443/voms/comput-er.it/ + http://www.comput-er.it/ + + + nordugrid.org + https://voms.ndgf.org:8443/voms/nordugrid.org + http://www.nordugrid.org/NorduGridVO + + + gridmosi.ici.ro + https://voms.grid.ici.ro:8443/voms/gridmosi.ici.ro/ + http://www.gridmosi.ro + + + cms + https://lcg-voms.cern.ch:8443/vo/cms/vomrs + http://cms.cern.ch/iCMS/ + We thank the computing centres in the Worldwide LHC computing Grid for the provisioning and excellent performance of computing infrastructure essential to our analyses. + + + icarus-exp.org + https://vomsmania.cnaf.infn.it:8443/voms/icarus-exp.org + http://icarus.lngs.infn.it + + + vo.renabi.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.renabi.fr + http://www.renabi.fr + + + env.see-grid-sci.eu + https://voms.ipp.acad.bg:8443/voms/env.see-grid-sci.eu/ + http://wiki.egee-see.org/index.php/SG_Environmental_VO + + + vo.apc.univ-paris7.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.apc.univ-paris7.fr/register/start.action + http://www.apc.univ-paris7.fr/ + + + calice + https://grid-voms.desy.de:8443/voms/calice/register/start.action + https://twiki.cern.ch/twiki/bin/view/CALICE/ + The support on the computing elements (CE) from all the worldwide GRID, and the support on the storage elements (SE), in particular Germany DESY GRID SE and France Lyon SE, are acknowledged gratefully. (List of publications https://twiki.cern.ch/twiki/bin/view/CALICE/CalicePapers) + + + vo.metacentrum.cz + http://metavo.metacentrum.cz/en/application/index.html + http://vo.metacentrum.cz/ + The access to computing and storage facilities owned by parties and projects contributing to the National Grid Infrastructure MetaCentrum, provided under the programme "Projects of Large Infrastructure for Research, Development, and Innovations" (LM2010005) is highly appreciated/acknowledged. + + + vo.llr.in2p3.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.llr.in2p3.fr + http://polywww.in2p3.fr + + + vo.ingv.it + https://vomsmania.cnaf.infn.it:8443/voms/vo.ingv.it/ + http://vo.ingv.it + + + ams02.cern.ch + http://ams.cern.ch + http://ams.cern.ch + + + dech + https://glite-io.scai.fraunhofer.de:8443/voms/dech/ + https://twiki.cern.ch/twiki/bin/view/EGEE/DECHFirstJobs + + + trgrida + https://voms.ulakbim.gov.tr:8443/voms/trgrida/ + https://voms.ulakbim.gov.tr:8443/voms/trgrida/ + + + envirogrids.vo.eu-egee.org + https://lcg-voms.cern.ch:8443/vo/envirogrids.vo.eu-egee.org/vomrs + http://www.envirogrids.net/ + + + dteam + https://voms.hellasgrid.gr:8443/voms/dteam + http://wiki.egi.eu/wiki/Dteam_vo + + + cesga + https://voms.egi.cesga.es:8443/voms/cesga/admin/home.action + http://www.egee.cesga.es/vo.html + + + imath.cesga.es + i-math.cesga.es + i-math.cesga.es + + + uscms + + + + + pamela + https://voms.cnaf.infn.it:8443/voms/pamela/register/start.action + http://pamela.roma2.infn.it + + + vo.formation.idgrilles.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.formation.idgrilles.fr + http://www.france-grilles.fr + + + vo.rhone-alpes.idgrilles.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.rhone-alpes.idgrilles.fr + http://www.tidra.org + + + vo.paus.pic.es + https://voms.pic.es:8443/voms/vo.paus.pic.es + http://www.ice.csic.es/research/PAU/PAU-welcome.html + + + fedcloud.egi.eu + https://perun.metacentrum.cz/perun-registrar-cert/?vo=fedcloud.egi.eu + http://www.egi.eu/infrastructure/cloud/ + + + vo.lpta.in2p3.fr + + + + + d4science.research-infrastructures.eu + https://voms.research-infrastructures.eu:8443/voms/d4science.research-infrastructures.eu/ + http://www.d4science.org + + + isravo.isragrid.org.il + https://ngi-il-voms3.isragrid.org.il:8443/voms/isravo.isragrid.org.il/ + http://www.isragrid.org.il + + + cppm + https://marvoms.in2p3.fr:8443/voms/cppm/ + http://marwww.in2p3.fr + + + astro.vo.eu-egee.org + https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/register + https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/ + + + km3net.org + https://voms02.scope.unina.it:8443/voms/km3net.org/ + http://www.km3net.org/home.php + This work benefited from services, data and scientific results provided by the KM3NeT.org Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + ipv6.hepix.org + https://voms2.cnaf.infn.it:8443/voms/ipv6.hepix.org/admin/home.action + https://voms2.cnaf.infn.it:8443/voms/ipv6.hepix.org/admin/home.action + + + atlas.ac.il + https://voms.hep.tau.ac.il:8443/voms/atlas.ac.il/ + https://voms.hep.tau.ac.il:8443/voms/atlas.ac.il/ + The crucial computing support from all WLCG partners is acknowledged gratefully, in particular from CERN and the ATLAS Tier-1 facilities at TRIUMF (Canada), NDGF (Denmark, Norway, Sweden), CCIN2P3 (France), KIT/GridKA (Germany), INFN-CNAF (Italy), NL-T1 (Netherlands), PIC (Spain), ASGC (Taiwan), RAL (UK) and BNL (USA) and in the Tier-2 facilities worldwide" + + + vo.ipnl.in2p3.fr + http://www.ipnl.in2p3.fr/spip.php?article302&lang=fr + http://www.ipnl.in2p3.fr/spip.php?article302&lang=fr + + + bing.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/bing.vo.ibergrid.eu/admin/home.action + http://www.brainimaging.pt + + + vo.lapp.in2p3.fr + https://cclcgvomsli01.in2p3.fr:8443/voms/vo.lapp.in2p3.fr + http://lapp.in2p3.fr/spip.php?rubrique80 + + + swetest + https://swevo.ific.uv.es:8443/voms/swetest/register/start.action + http://swevo.ific.uv.es/vo/swetest/vo-swetest.html + This work benefited from services provided by the SWETEST Virtual Organisation, supported by the national resource NGI IBERGRID. + + + vo.mcia.fr + https://grid12.lal.in2p3.fr:8443/voms/vo.mcia.fr + http://www.mcia.univ-bordeaux.fr/ + + + cometa + http://www.consorzio-cometa.it/en/accesso + http://www.consorzio-cometa.it/ + + + edteam + https://voms.lip.pt:8443/voms/edteam/webui/request/user/create + http://www.eu-eela.org/ + + + verce.eu + https://verce-voms.scai.fraunhofer.de:8443/voms/verce.eu/ + http://www.verce.eu + This work benefited from services provided by the verce.eu Virtual Organisation, supported by the VERCE project and the national resource providers of the EGI Federation. + + + lofar + https://voms.grid.sara.nl:8443/voms/lofar/register/start.action + http://www.lofar.org + + + vo.plgrid.pl + https://portal.plgrid.pl + http://www.plgrid.pl/en + + + vo.landslides.mossaic.org + https://voms.gridpp.ac.uk:8443/voms/vo.landslides.mossaic.org/register/start.action + http://mossaic.org/ + + + dzero + https://voms.fnal.gov:8443/voms/dzero/register/start.action + http://www-d0.fnal.gov/ + + + lsgrid + https://voms.grid.sara.nl:8443/voms/lsgrid + http://www.sara.nl/project/life-science-grid + This work was carried out on the Dutch national e-infrastructure with the support of SURF Cooperative. + + + cernatschool.org + https://www.gridpp.ac.uk/wiki/CERN%40school#Enrollment + http://cernatschool.web.cern.ch/content/cernschool-vo + + + ukqcd + https://grid-voms.desy.de:8443/voms/ildg/ + http://ukqcd.ac.uk/ + + + vo.helio-vo.eu + https://voms.gridpp.ac.uk:8443/voms/vo.helio-vo.eu + http://www.helio-vo.eu/ + + + fkppl.kisti.re.kr + + + + + vo.ifisc.csic.es + https://voms.ific.uv.es:8443/voms/vo.ifisc.csic.es + https://voms.ific.uv.es:8443/voms/vo.ifisc.csic.es + + + vo.dch-rp.eu + https://voms.ct.infn.it:8443/voms/vo.dch-rp.eu + http://www.dch-rp.eu/ + This work benefited from services and resources provided by the vo.dch-rp.eu Virtual Organization, supported by the national resource providers of the EGI Federation. + + + dream.hipcat.net + https://voms.hpcc.ttu.edu:8443/voms/dream/user/home.action + http://highenergy.phys.ttu.edu/dream/ + n/a (list of publications: http://highenergy.phys.ttu.edu/dream/results/publications/publications.html) + + + nw_ru + https://gt1.pnpi.nw.ru:8443/voms/nw_ru/ + http://egee.pnpi.nw.ru + + + social.vo.ibergrid.eu + https://voms01.ncg.ingrid.pt:8443/voms/social.vo.ibergrid.eu/register/start.action + http://ibergrid.lip.pt/USP + This work benefited from services provided by the Ibergrid Social Virtual Organisation, supported by the national resource providers of the EGI Federation + + + lsst + https://voms.fnal.gov:8443/voms/lsst + http://www.lsst.org/lsst/ + + + voce + https://voce-register.farm.particle.cz/voce/ + http://egee.cesnet.cz/en/voce/ + + + vo.sixt.cern.ch + http://sixtrack.web.cern.ch/SixTrack/ + http://sixtrack.web.cern.ch/SixTrack/ + + + seismo.see-grid-sci.eu + https://voms.ulakbim.gov.tr:8443/voms/seismo.see-grid-sci.eu/register/start.action + http://wiki.egee-see.org/index.php/SG_Seismology_VO + + + vo.cs.br + + + + + t2k.org + https://voms.gridpp.ac.uk:8443/voms/t2k.org/register/start.action + http://www.t2k.org + n/a (list of publications: http://t2k-experiment.org/publications/) + + + net.egi.eu + https://vomsmania.cnaf.infn.it:8443/voms/net.egi.eu/ + http://net.egi.eu + + + sagrid.ac.za + https://voms.sagrid.ac.za:8443/voms/sagrid.ac.za/register.action + http://www.sagrid.ac.za + This work was produced in part due to the usage of the resources provided by the sagrid.ac.za VO, supported by DST contract under the SANREN project. Support of the Africa-Arabia Regional Operations Centre and the EGI.eu is also acknowledged. + + + chipster.csc.fi + https://voms.fgi.csc.fi:8443/ + http://chipster.csc.fi + This work benefited from services provided by the Chipster Virtual Organisation, supported by the national resource providers of the EGI Federation. + + + geohazards.terradue.com + https://voms.ba.infn.it:8443/voms/geohazards.terradue.com + https://voms.ba.infn.it:8443/voms/geohazards.terradue.com + This work used the EGI infrastructure with the support of 100%IT, CESGA, CYFRONET-CLOUD, GoeGrid, HG-09-Okeanos-Cloud and RECAS-BARI. + + + hydrology.terradue.com + https://voms.ba.infn.it:8443/voms/hydrology.terradue.com + https://voms.ba.infn.it:8443/voms/hydrology.terradue.com + This work used the EGI infrastructure with the support of 100%IT, CESGA, CYFRONET-CLOUD, GoeGrid, RECAS-BARI and BEgrid-BELNET. + + + vo.magrid.ma + https://voms.magrid.ma:8443/voms/vo.magrid.ma + http://www.magrid.ma + The authors acknowledge the support of CNRST/MAGRID (http://www.magrid.ma) for providing computing resources on the Moroccan Grid Infrastructure. - Results obtained in this paper were computed on the magrid virtual organization of the Moroccan Grid Infrastructure (http://www.magrid.ma). We thank the CNRST/MaGrid providing the technical support, computing and storage facilities. - We acknowledge the use of Grid computing resources deployed and operated by CNRST/MaGrid (http://www.magrid.ma) in Morocco. + + + vo.chain-project.eu + https://voms.ct.infn.it:8443/voms/vo.chain-project.eu/ + http://www.chain-project.eu/ + This work benefited from services and resources provided by the vo.chain-project.eu Virtual Organization, supported by the national resource providers of the EGI Federation. + + + vo.nbis.se + https://perun.metacentrum.cz/cert/registrar/?vo=vo.nbis.se + https://bils.se + This work used the EGI infrastructure with the support of INFN (Italy) and IN2P3-IRES (France) + + + vo.dariah.eu + https://voms.ct.infn.it:8443/voms/vo.dariah.eu/register/start.action + https://wiki.egi.eu/wiki/EGI_Virtual_Organisation_for_arts_and_humanities:_vo.dariah.eu + This work used the EGI infrastructure with the dedicated support of the RECAS-BARI provider. + + + vo.africa-grid.org + https://voms.ct.infn.it:8443/voms/vo.africa-grid.org/register/start.action + http://www.africa-grid.org/ + This work benefited from services and resources provided by the vo.africa-grid.org Virtual Organization, supported by the national resource providers of the EGI Federation. + + + extras-fp7.eu + https://voms.ba.infn.it:8443/voms/extras-fp7.eu/register/start.action + http://www.extras-fp7.eu + This work used the EGI infrastructure with the support of CYFRONET- CLOUD and RECAS-BARI. + + + astro.vo.eu-egee.org + https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/register + https://grid12.lal.in2p3.fr:8443/voms/astro.vo.eu-egee.org/ + This work benefited from services provided by the astro.vo.eu-egee.org Virtual Organisation, supported by the national resource providers of the EGI Federation + + + vo.emsodev.eu + https://voms2.hellasgrid.gr:8443/voms/vo.emsodev.eu/register/start.action + + + The EMSODEV project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No. 676555. + In particular, the EMSODEV Data Management Platform uses the EGI Infrastructure with the support of CESGA, INNF-PADOVA-STACK, NCG-INGRID-PT and RECAS-BARI. + + + + d4science.org + https://vomsmania.cnaf.infn.it:8443/voms/d4science.org/register/start.action + https://wiki.d4science.org/index.php?title=D4Science.org_at_EGI.eu + This work used the EGI infrastructure with the dedicated support of CESGA, GoeGrid, UPV-GRyCAP and INFN-CATANIA-STACK. + + + bioisi + https://perun.cesnet.cz/cert/registrar/?vo=bioisi + http://bioisi.campus.ciencias.ulisboa.pt + This work used the EGI infrastructure with the dedicated support of the NCG-INGRID-PT provider + + + + + egi-ace + + + imagine-project + + + intertwin + + + eosc-hub + + + + + VIRGO + aHR0cHM6Ly93d3cuZ3ctb3BlbnNjaWVuY2Uub3JnL3N0YXRpYy9pbWFnZXMvbG9nby12aXJnby10cmFuc3BfYmNrZy5wbmc= + aHR0cDovL3d3dy52aXJnby1ndy5ldS8= + + + + + + + +
\ No newline at end of file diff --git a/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile_fet-fp7.xml b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile_fet-fp7.xml new file mode 100644 index 00000000..b5b5abbc --- /dev/null +++ b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_community_profile_fet-fp7.xml @@ -0,0 +1,1439 @@ + +
+ + + + + +
+ + + + hidden + + 7.A.SP1.03.08 + ICT-2007.8.0 + 7.A.SP1.03 + + 7.A.SP1.03.08.08 + ICT-2009.8.0 + 7.A.SP1.03.08 + + 245410 + FP7-ICT-2009-C + 245410 + MODAP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 249858 + FP7-ICT-2009-C + 249858 + TANGO + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 249867 + FP7-ICT-2009-C + 249867 + OPTONEURO + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 249958 + FP7-ICT-2009-C + 249958 + PICC + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 250026 + FP7-ICT-2009-C + 250026 + SIEMPRE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 250056 + FP7-ICT-2009-C + 250056 + TREASURE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 250072 + FP7-ICT-2009-C + 250072 + ISENSE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255827 + FP7-ICT-2009-C + 255827 + CG LEARNING + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255914 + FP7-ICT-2009-C + 255914 + PHORBITECH + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255931 + FP7-ICT-2009-C + 255931 + UNLOCX + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255951 + FP7-ICT-2009-C + 255951 + LIFT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255961 + FP7-ICT-2009-C + 255961 + QCS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 255987 + FP7-ICT-2009-C + 255987 + FOC-II + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 256230 + FP7-ICT-2009-C + 256230 + LISTA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 265578 + FP7-ICT-2009-C + 265578 + HIATUS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 265432 + FP7-ICT-2009-C + 265432 + EVERYAWARE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 265496 + FP7-ICT-2009-C + 265496 + STAMINA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 265505 + FP7-ICT-2009-C + 265505 + CADMAD + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 265522 + FP7-ICT-2009-C + 265522 + MALICIA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 266722 + FP7-ICT-2009-C + 266722 + SUMO + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 266723 + FP7-ICT-2009-C + 266723 + GSDP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 268478 + FP7-ICT-2009-C + 268478 + REWIND + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 270749 + FP7-ICT-2009-C + 270749 + 2D-NANOLATTICES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 270773 + FP7-ICT-2009-C + 270773 + RAMPLAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 270780 + FP7-ICT-2009-C + 270780 + ILHAIRE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 270833 + FP7-ICT-2009-C + 270833 + DATA SIM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 270843 + FP7-ICT-2009-C + 270843 + IQIT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 271554 + FP7-ICT-2009-C + 271554 + SE2ND + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 271574 + FP7-ICT-2009-C + 271574 + INSITE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 271578 + FP7-ICT-2009-C + 271578 + ETOILECASCADESIDEAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + 286370 + FP7-ICT-2009-C + 286370 + SINTELNET + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.08 + + + + 7.A.SP1.03.30.05 + ICT-2013.9.5 + 7.A.SP1.03.30 + + 613024 + FP7-ICT-2013-X + 613024 + GRASP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 613044 + FP7-ICT-2013-X + 613044 + ABACUS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 613055 + FP7-ICT-2013-X + 613055 + GEMINI + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 612759 + FP7-ICT-2013-X + 612759 + INSPIN + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 612862 + FP7-ICT-2013-X + 612862 + HAIRS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 612933 + FP7-ICT-2013-X + 612933 + RECALL + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 612944 + FP7-ICT-2013-X + 612944 + MAESTRA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + 612985 + FP7-ICT-2013-X + 612985 + UPSCALE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.05 + + + + + ICT-2013.9.9 + 7.A.SP1.03.30 + + 7.A.SP1.03.19.05 + ICT-2011.9.5 + 7.A.SP1.03.19 + + 284558 + FP7-ICT-2011-FET-F + 284558 + GRAPHENE-CA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 284709 + FP7-ICT-2011-FET-F + 284709 + FUTURICT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 284891 + FP7-ICT-2011-FET-F + 284891 + FLEET + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 284941 + FP7-ICT-2011-FET-F + 284941 + HBP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 284951 + FP7-ICT-2011-FET-F + 284951 + CA-ROBOCOM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 285406 + FP7-ICT-2011-FET-F + 285406 + GUARDIAN ANGELS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + 285609 + FP7-ICT-2011-FET-F + 285609 + ITFOM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.05 + + + + 7.A.SP1.03.30.09 + ICT-2013.9.9 + 7.A.SP1.03.30 + + 604102 + FP7-ICT-2013-FET-F + 604102 + HBP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.09 + + + 604391 + FP7-ICT-2013-FET-F + 604391 + GRAPHENE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.09 + + + 619318 + FP7-ICT-2013-11 + 619318 + FLAG-ERA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.09 + + + + + + 7.A.SP1.03.08.09 + ICT-2009.8.1 + 7.A.SP1.03.08 + + 247846 + FP7-ICT-2009-4 + 247846 + EURETILE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.09 + + + 248465 + FP7-ICT-2009-4 + 248465 + S(O)OS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.09 + + + 248789 + FP7-ICT-2009-4 + 248789 + TRAMS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.09 + + + 249013 + FP7-ICT-2009-4 + 249013 + TERAFLUX + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.09 + + + + 7.A.SP1.03.08.10 + ICT-2009.8.2 + 7.A.SP1.03.08 + + 248629 + FP7-ICT-2009-4 + 248629 + SOLID + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.10 + + + 247687 + FP7-ICT-2009-4 + 247687 + AQUTE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.10 + + + 248095 + FP7-ICT-2009-4 + 248095 + Q-ESSENCE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.10 + + + + 7.A.SP1.03.08.11 + ICT-2009.8.3 + 7.A.SP1.03.08 + + 248919 + FP7-ICT-2009-4 + 248919 + BACTOCOM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.11 + + + 248992 + FP7-ICT-2009-4 + 248992 + NEUNEU + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.11 + + + 249032 + FP7-ICT-2009-4 + 249032 + MATCHIT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.11 + + + + 7.A.SP1.03.08.12 + ICT-2009.8.4 + 7.A.SP1.03.08 + + 257695 + FP7-ICT-2009-5 + 257695 + VERE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.12 + + + 258749 + FP7-ICT-2009-5 + 258749 + CEEDS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.12 + + + + 7.A.SP1.03.08.13 + ICT-2009.8.5 + 7.A.SP1.03.08 + + 256873 + FP7-ICT-2009-5 + 256873 + SAPERE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.13 + + + 257414 + FP7-ICT-2009-5 + 257414 + ASCENS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.13 + + + 257756 + FP7-ICT-2009-5 + 257756 + RECOGNITION + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.13 + + + 257906 + FP7-ICT-2009-5 + 257906 + EPICS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.13 + + + + 7.A.SP1.03.08.14 + ICT-2009.8.6 + 7.A.SP1.03.08 + + 256959 + FP7-ICT-2009-5 + 256959 + NANOPOWER + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.14 + + + 257750 + FP7-ICT-2009-5 + 257750 + GREEN SILICON + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.14 + + + 257856 + FP7-ICT-2009-5 + 257856 + SINAPS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.14 + + + + 7.A.SP1.03.08.15 + ICT-2009.8.7 + 7.A.SP1.03.08 + + 270028 + FP7-ICT-2009-6 + 270028 + ATMOL + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.15 + + + 270197 + FP7-ICT-2009-6 + 270197 + DIAMANT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.15 + + + 270369 + FP7-ICT-2009-6 + 270369 + ELFOS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.15 + + + 270483 + FP7-ICT-2009-6 + 270483 + FOCUS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.15 + + + + 7.A.SP1.03.08.16 + ICT-2009.8.8 + 7.A.SP1.03.08 + + 269459 + FP7-ICT-2009-6 + 269459 + CORONET + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.16 + + + 269921 + FP7-ICT-2009-6 + 269921 + BRAINSCALES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.16 + + + 270324 + FP7-ICT-2009-6 + 270324 + SEEBETTER + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.16 + + + 270434 + FP7-ICT-2009-6 + 270434 + REALNET + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.08.16 + + + + 7.A.SP1.03.19.06 + ICT-2011.9.6 + 7.A.SP1.03.19 + + 316366 + FP7-ICT-2011-8 + 316366 + PHYCHIP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 317662 + FP7-ICT-2011-8 + 317662 + NASCENCE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 317707 + FP7-ICT-2011-8 + 317707 + MULTI + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 318202 + FP7-ICT-2011-8 + 318202 + BIOMICS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 318516 + FP7-ICT-2011-8 + 318516 + MOLARNET + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 318597 + FP7-ICT-2011-8 + 318597 + SYMONE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + 318671 + FP7-ICT-2011-8 + 318671 + MICREAGENTS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.06 + + + + 7.A.SP1.03.19.07 + ICT-2011.9.7 + 7.A.SP1.03.19 + + 316705 + FP7-ICT-2011-8 + 316705 + HIERATIC + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 317532 + FP7-ICT-2011-8 + 317532 + MULTIPLEX + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 317534 + FP7-ICT-2011-8 + 317534 + SOPHOCLES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 317614 + FP7-ICT-2011-8 + 317614 + PLEXMATH + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 317672 + FP7-ICT-2011-8 + 317672 + CONGAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 318121 + FP7-ICT-2011-8 + 318121 + TOPDRIM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 318132 + FP7-ICT-2011-8 + 318132 + LASAGNE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 318493 + FP7-ICT-2011-8 + 318493 + TOPOSYS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + 318723 + FP7-ICT-2011-8 + 318723 + MATHEMACS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.07 + + + + 7.A.SP1.03.19.08 + ICT-2011.9.8 + 7.A.SP1.03.19 + + 318013 + FP7-ICT-2011-8 + 318013 + PHIDIAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318287 + FP7-ICT-2011-8 + 318287 + LANDAUER + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318337 + FP7-ICT-2011-8 + 318337 + ENTRA + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318397 + FP7-ICT-2011-8 + 318397 + TOLOP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318490 + FP7-ICT-2011-8 + 318490 + SENSATION + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318693 + FP7-ICT-2011-8 + 318693 + PARADIME + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + 318793 + FP7-ICT-2011-8 + 318793 + EXA2GREEN + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.08 + + + + 7.A.SP1.03.19.09 + ICT-2011.9.9 + 7.A.SP1.03.19 + + 600645 + FP7-ICT-2011-9 + 600645 + SIQS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + 600700 + FP7-ICT-2011-9 + 600700 + QALGO + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + 600838 + FP7-ICT-2011-9 + 600838 + QWAD + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + 600927 + FP7-ICT-2011-9 + 600927 + SCALEQIT + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + 601126 + FP7-ICT-2011-9 + 601126 + HANAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + 601180 + FP7-ICT-2011-9 + 601180 + MATTERWAVE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.09 + + + + 7.A.SP1.03.19.10 + ICT-2011.9.10 + 7.A.SP1.03.19 + + 600654 + FP7-ICT-2011-9 + 600654 + DIVERSIFY + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 600708 + FP7-ICT-2011-9 + 600708 + QUANTICOL + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 600792 + FP7-ICT-2011-9 + 600792 + ALLOW ENSEMBLES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 600854 + FP7-ICT-2011-9 + 600854 + SMARTSOCIETY + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 601062 + FP7-ICT-2011-9 + 601062 + SWARM-ORGAN + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 601074 + FP7-ICT-2011-9 + 601074 + ASSISI_BF + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + 601148 + FP7-ICT-2011-9 + 601148 + CASSTING + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.10 + + + + 7.A.SP1.03.19.11 + ICT-2011.9.11 + 7.A.SP1.03.19 + + 600725 + FP7-ICT-2011-9 + 600725 + GRIDMAP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600730 + FP7-ICT-2011-9 + 600730 + MAGNETRODES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600785 + FP7-ICT-2011-9 + 600785 + SPACECOG + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600806 + FP7-ICT-2011-9 + 600806 + CORTICONIC + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600847 + FP7-ICT-2011-9 + 600847 + RENVISION + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600925 + FP7-ICT-2011-9 + 600925 + NEUROSEEKER + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 600954 + FP7-ICT-2011-9 + 600954 + VISUALISE + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 601167 + FP7-ICT-2011-9 + 601167 + CSNII + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + 601215 + FP7-ICT-2011-9 + 601215 + SI ELEGANS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.19.11 + + + + 7.A.SP1.03.30.06 + ICT-2013.9.6 + 7.A.SP1.03.30 + + 611640 + FP7-ICT-2013-10 + 611640 + EVOBLISS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + 610427 + FP7-ICT-2013-10 + 610427 + EVOEVO + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + 610730 + FP7-ICT-2013-10 + 610730 + EVOPROG + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + 611687 + FP7-ICT-2013-10 + 611687 + NEBIAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + 612058 + FP7-ICT-2013-10 + 612058 + RAMP + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + 612146 + FP7-ICT-2013-10 + 612146 + PLASWIRES + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.06 + + + + 7.A.SP1.03.30.07 + ICT-2013.9.7 + 7.A.SP1.03.30 + + 610446 + FP7-ICT-2013-10 + 610446 + PAMS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.07 + + + 610449 + FP7-ICT-2013-10 + 610449 + MOQUAS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.07 + + + 610637 + FP7-ICT-2013-10 + 610637 + SIAM + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.07 + + + 611143 + FP7-ICT-2013-10 + 611143 + DIADEMS + FP7 + 7.A.SP1 + 7.A.SP1.03 + 7.A.SP1.03.30.07 + + + + + + + + +
\ No newline at end of file diff --git a/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_provision_wf.xml b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_provision_wf.xml new file mode 100644 index 00000000..b4f4a27e --- /dev/null +++ b/apps/dnet-exporter-api/src/test/resources/eu/dnetlib/openaire/community/importer/old_provision_wf.xml @@ -0,0 +1,1251 @@ + +
+ + + + + +
+ + Graph construction and processing + Data Provision + 30 + + + +- unresolvedEntityPath: path of unresolved entities +- nsPrefixBlacklist_PROD: blacklist of funder nsPrefixes from the prod aggregator +- idMappingPath: path of the map defining the relations id mappings +- dedupConfig: dedup orchestrator name +- actionSetIdsRawGraph: ActionSet ids to promote in the RAW graph +- isLookUpUrl: IS lookup service address +- iterations: number of iterations performed by the affiliation through semantic relation propagation algo + + + +{ + 'unresolvedEntityPath' : '/data/unresolved_PROD/content', + 'nsPrefixBlacklist' : 'conicytf____,dfgf________,gsrt________,innoviris___,miur________,rif_________,rsf_________,sgov________,sfrs________', + 'idMappingPath' : '/data/maps/funder_remapping/', + 'dedupConfig' : 'dedup-result-decisiontree-v3', + 'actionSetIdsRawGraph' : 'doiboost,orcidworks-no-doi,ror', + 'actionSetIdsIISGraph' : 'iis-researchinitiative,iis-document-citations,iis-document-citations-relations,iis-document-affiliation,iis-document-classes,iis-document-similarities,iis-referenced-datasets-main,iis-referenced-projects-main,iis-referenced-projects-backup,iis-referenceextraction-pdb,document_software_url,iis-extracted-metadata,iis-communities,iis-referenced-patents,iis-covid-19,opencitations,h2020classification,iis-entities-software,iis-entities-patent', + 'actionSetIdsDedup' : 'bipfinder-scores,usage_counts', + 'isLookUpUrl' : 'http://services.openaire.eu:8280/is/services/isLookUp?wsdl', + 'iterations' : '1', + + 'reuseDBClaims' : 'false', + 'reuseODFClaims' : 'false', + 'reuseOAFClaims' : 'false', + 'reuseODFhdfs' : 'false', + 'reuseOAFhdfs' : 'false', + 'reuseDB' : 'false', + 'reuseDBOpenorgs' : 'false', + 'reuseODF' : 'false', + 'reuseOAF' : 'false', + 'shouldPatchRelations' : 'true', + 'contentPath' : '/tmp/prod_aggregator', + + 'aggregatorGraphPath' : '/tmp/prod_provision/graph/00_graph_aggregator', + 'rawGraphPath' : '/tmp/prod_provision/graph/01_graph_raw', + 'groupedGraphPath' : '/tmp/prod_provision/graph/02_graph_grouped', + 'cleanedFirstGraphPath' : '/tmp/prod_provision/graph/03_graph_cleaned', + 'resolvedGraphPath' : '/tmp/prod_provision/graph/04_graph_resolved', + 'inferredGraphPath' : '/tmp/prod_provision/graph/05_graph_inferred', + 'dedupGraphPath' : '/tmp/prod_provision/graph/06_graph_dedup', + 'consistentGraphPath' : '/tmp/prod_provision/graph/07_graph_consistent', + 'dedupEnrichedGraphPath' : '/tmp/prod_provision/graph/08_graph_dedup_enriched', + 'orcidGraphPath' : '/tmp/prod_provision/graph/09_graph_orcid', + 'bulkTaggingGraphPath' : '/tmp/prod_provision/graph/10_graph_bulktagging', + 'affiliationGraphPath' : '/tmp/prod_provision/graph/11_graph_affiliation', + 'affiliationSemRelGraphPath' : '/tmp/prod_provision/graph/12_graph_affiliation_semantic_relation', + 'communityOrganizationGraphPath' : '/tmp/prod_provision/graph/13_graph_community_organization', + 'fundingGraphPath' : '/tmp/prod_provision/graph/14_graph_funding', + 'communitySemRelGraphPath' : '/tmp/prod_provision/graph/15_graph_community_semantic_relation', + 'countryGraphPath' : '/tmp/prod_provision/graph/16_graph_country', + 'cleanedGraphPath' : '/tmp/prod_provision/graph/17_graph_cleaned', + 'blacklistedGraphPath' : '/tmp/prod_provision/graph/18_graph_blacklisted' +} + + + + + + + + the step from which the hostedByMap step should be resumed. If the choice is DownloadBoth both the unibi gold and doaj files are downloaded anew. If the option id DownloadDoaj or DownloadGold only the selected file is downloaded. If the option id ProduceHBM a new hosted by map is produced. If the option is PrepareInfo the old HBM is used on the results and datasources. + + HBMresumeFrom + PrepareInfo + + + + + + + Set the map of paths for the Bulk Tagging + + bulkTaggingPathMap + {"author" : "$['author'][*]['fullname']", "title" : "$['title'][*]['value']","orcid":"$['author'][*]['pid'][*][?(@['qualifier']['classid']=='orcid')]['value']", "contributor" : "$['contributor'][*]['value']", "description" : "$['description'][*]['value']"} + + + + + + + Set the map of associations organization, community list for the propagation of + community to result through organization + + propagationOrganizationCommunityMap + +{ + "20|openorgs____::817280e710651751433d869c71f6eee2": ["mes"], + "20|openorgs____::809457868cca956bddde9c74e3a32c3c": ["mes"], + "20|openorgs____::cb386de57b0aa53d5bbf016e15720053": ["mes"], + "20|openorgs____::fb2e1f77e2506054fa25fef7eac7b685": ["mes"], + "20|openorgs____::c4ff9a638850ebdc39e28897b58166bc": ["mes"], + "20|openorgs____::00010e003d3ce9c05e038cadfb6d4f03": ["mes"], + "20|openorgs____::c20c22d6210eea23b58869029c2abe24": ["mes"], + "20|openorgs____::ad78005de675860b9f96b84d50fc19f6": ["mes"], + "20|openorgs____::a6bfaa7b9934dd8459ca94deac34c127": ["mes"], + "20|openorgs____::e68796680c3203d0d708e576c1d55de6": ["mes"], + "20|openorgs____::41206374e08ed608c03f56fc21ec3023": ["mes"], + "20|openorgs____::7dc15ac2260f80e90c849908afe20a6e": ["mes"], + "20|openorgs____::eaea0ef989e0b9245a5d50a6c519dc52": ["mes"], + "20|openorgs____::15fb2c0b223ca34ec651f34838d2daf9": ["mes"], + "20|openorgs____::3cb19734da640f9193b20291268c9a0e": ["mes"], + "20|openorgs____::da5a68a98b9ff7231d6c3c93cde988df": ["mes"], + "20|openorgs____::b436de29bae7906f94797b8a0c235585": ["mes"], + "20|openorgs____::6a5fcbfe36fed5e8b2b50128454cc4f0": ["mes"], + "20|openorgs____::3053c65910d1c064799cb9a93e57e5cd": ["mes"], + "20|openorgs____::f95684edab7a22ac87ea2ed7c47897f2": ["mes"], + "20|openorgs____::581dcea989b861fa0106d4874ecf2d66": ["beopen"], + "20|openorgs____::90a0f7c99fb72cd0e014fcdd38c08719": ["beopen"], + "20|openorgs____::11f6b2617abf37fe7193557d77d8cd00": ["beopen"], + "20|openorgs____::600c7afdde615a68e45cfceaf684782d": ["beopen"], + "20|openorgs____::ca4e3e4e6767e05b0828ef5f0cdc7292": ["beopen"], + "20|openorgs____::b79247e30e30a8f8532a30e3b816cda9": ["beopen"], + "20|openorgs____::9cb5ffc315d7bf0f97b2f0fdc37612aa": ["beopen"], + "20|openorgs____::ad863df6deda1619a25e7fad4a534891": ["beopen"], + "20|openorgs____::72162cfc2e7edaf7515c778e04d1952b": ["beopen"], + "20|openorgs____::9e29fb5b85151a6810ce7256b08475e4": [ + "mes", + "beopen" + ], + "20|openorgs____::9dd5545aacd3d8019e00c3f837269746": ["beopen"], + "20|openorgs____::a86e8b969264b4c92cbf79c289a3f61a": ["beopen"], + "20|openorgs____::d6b4b35b44951f55747a7139446d21a8": ["beopen"], + "20|openorgs____::8ec069b683b9e9387492ea0c6b88a806": ["beopen"], + "20|openorgs____::d11f981828c485cd23d93f7f24f24db1": ["eut", "tunet"], + "20|openorgs____::e66fe5dd092752e1dd6fd29fc699933a": ["eut"], + "20|openorgs____::526468206bca24c1c90da6a312295cf4": ["eut"], + "20|openorgs____::08e311e656e65ccb32e07c66b15b6ff7": ["eut"], + "20|openorgs____::55a1f889758964b77682904218fdb298": ["eut"], + "20|openorgs____::530092b6970d60a5329beb9f39e8d7d4": ["eut"], + "20|openorgs____::aadafa39392b3e200102596a3a4aad9d": ["eut"], + "20|openorgs____::c3fe999c74fad308132b8a5971367dce": ["eut"], + "20|openorgs____::1624ff7c01bb641b91f4518539a0c28a": ["aurora", "netherlands"], + "20|openorgs____::cdda7cfe17c89eb50628ec2eb1f8acd2": ["aurora"], + "20|openorgs____::818b75030e0e40612d69e049843ede7e": ["aurora"], + "20|openorgs____::0b0102bae51f4f4ef5ba57fbe1523b92": ["aurora"], + "20|openorgs____::d1f5d132714edad4a952e0414fc3c94b": ["aurora"], + "20|openorgs____::eb0669daa9efeb898a3090d8aac7c953": ["aurora"], + "20|openorgs____::eb391317ed0dc684aa81ac16265de041": ["aurora"], + "20|openorgs____::f7cfcc98245e22c7d6e321cde930e746": ["aurora"], + "20|openorgs____::f33179d3306ba2599f7a898b056b604f": ["aurora"], + "20|openorgs____::0a45de396fc864dc70d42d13f4e786e1": ["aurora"], + "20|openorgs____::039192f47416999e406a6b57da19beeb": ["aurora"], + "20|openorgs____::2023f56908812b5ac7045778fded8a0f": ["eutopia"], + "20|openorgs____::77f6d72a67be69ed181d83bc4a53fa54": ["eutopia"], + "20|openorgs____::b7e8d9a1ee2a31a5e9aaaaebac2d7cc3": ["eutopia"], + "20|openorgs____::be0ace0416ddcc3cc7ad6151d2d5d681": ["eutopia"], + "20|openorgs____::f6d0bdf4b935c2907d157429ad783eb1": ["eutopia"], + "20|openorgs____::6363a88f20cca34629ae690d539f9b67": ["eutopia"], + "20|openorgs____::52203596562cc56fcefb3e737c6e2441": ["eutopia"], + "20|openorgs____::6ba93bd765e2d7e5d2fb0cf3c1ac17b2": ["eutopia"], + "20|openorgs____::a6340e6ecf60f6bba163659df985b0f2": ["eutopia"], + "20|openorgs____::21731b21b089c81e0e1a5ed599316e2f": ["eutopia"], + "20|openorgs____::4efa936474b7478a534766170e2b3a78": ["forthem"], + "20|openorgs____::ff9f05849d91ca29be33aeeb07413536": ["forthem"], + "20|openorgs____::bfe8b338037acd41adfc0f100460e3db": ["forthem"], + "20|openorgs____::091f96b07fb8ad89e0732cd2f0c9bfcb": ["forthem"], + "20|openorgs____::5e4f5acff7b8362d8a431f27b0b123c3": ["forthem"], + "20|openorgs____::01ce6b73a6e390a709130c1bcfabeab9": ["forthem"], + "20|openorgs____::db9192d70ca3a941f6629fab56278fed": ["forthem"], + "20|openorgs____::a7502dd2669be577007c95445ca412fa": ["forthem"], + "20|openorgs____::09ddce938e9b0a54b5a831a1154be481": ["forthem"], + "20|openorgs____::7ac95584b6f0ae0b33027b9ce08cc96a": ["openaire-infrastructure"], + "20|openorgs____::027a83f256564db02650b6e1c24623d5": ["embrc"], + "20|openorgs____::dd8ba98db9a7a650207228be6f57ee29": ["instruct"], + "20|openorgs____::f0c3e27c112272a3781226c5890b228c": ["dariah"], + "20|openorgs____::0998a1d4dbfc5025ad963eeb2306969c": ["egi"], + "20|openorgs____::5ca2b95a1771149560222420df04abc7": ["sobigdata"], + "20|openorgs____::54d41926fa20801d03886c9685df4d38": ["epos"], + "20|openorgs____::ae84e04d1bb09ceec2f041532ad7175c": ["clarin"], + "20|openorgs____::5e91b35f34a6d4ead6432ef2f77d24bf": ["eu-conexus"], + "20|openorgs____::5e3400be408250ebb7d36b8d33bb3660": ["eu-conexus"], + "20|openorgs____::15ee7f73eb676be60ebc7629e42c7bf9": ["eu-conexus"], + "20|openorgs____::8a3fbaedd50cd6baabbba47b9976e4db": ["eu-conexus"], + "20|openorgs____::f1d25b27c8a254d0e0931db00497be26": ["eu-conexus"], + "20|openorgs____::b77c01aa15de3675da34277d48de2ec1": ["eu-conexus"], + "20|openorgs____::54cd984fc7d3b153ec2181f985041f02": ["eu-conexus", "tunet"], + "20|openorgs____::ed4f840895b2614ca59bc45ffb2eb15f": ["eu-conexus"], + "20|openorgs____::08c6812ca06b419e177b8e3949c9ec4c": ["eu-conexus"], + "20|openorgs____::3d57a5aadd2e0925bca78515278f2405": ["netherlands"], + "20|openorgs____::2ce10b2528220091bd0363c1e39394c1": ["netherlands"], + "20|openorgs____::fe49cd5c84da7a89da723e24cadeb99d": ["netherlands"], + "20|openorgs____::df96ffc1951dc9bc14b0695e3297f6e1": ["netherlands"], + "20|openorgs____::10020843b2d7fac7c04e40b55a631b0c": ["netherlands"], + "20|openorgs____::47f4bfbcef93eb928361dffaabd03b54": ["netherlands"], + "20|openorgs____::5e6bf8962665cdd040341171e5c631d8": ["netherlands"], + "20|openorgs____::79a0e60afef2e753b0dc12425ecb3f8c": ["netherlands"], + "20|openorgs____::a8767e80afb51d63802fdf1ddabeacb0": ["netherlands"], + "20|openorgs____::db787c50cf46f2b08e69f830e292e42d": ["netherlands"], + "20|openorgs____::2f735203eb40d8389a881e874bee537a": ["netherlands"], + "20|openorgs____::25b87dfee5c1855dab099c5a2eef225a": ["netherlands"], + "20|openorgs____::cb77737b5a390319030e6abdb12aa6ad": ["netherlands"], + "20|openorgs____::b0a51df36791d8bb939721e0ad1f92b5": ["netherlands"], + "20|openorgs____::e42580548da4a1d39bb67b60b971056e": ["netherlands"], + "20|openorgs____::2eeca4f78f2a04a35057c1fa7918e23b": ["netherlands"], + "20|openorgs____::a7e0018f6064f0dab7a8c9a48a61a1c6": ["netherlands"], + "20|openorgs____::ee938614ce34e199c2901282deb79db4": ["netherlands"], + "20|openorgs____::dd29a935a8c8b552752fd00524f5c2a3": ["netherlands"], + "20|openorgs____::fa2e191ad1d35db623f96abcedb9fb96": ["netherlands"], + "20|openorgs____::863c4184481f057bfe695c9c2786a90a": ["netherlands"], + "20|openorgs____::f2a84eb5c508838ba5dd728a1b8ac5ba": ["netherlands"], + "20|openorgs____::eb2f1247784acef155801d95b5ac937b": ["netherlands"], + "20|openorgs____::19274b9a576d284a2b900e2f112f6a0c": ["netherlands"], + "20|openorgs____::48ffea8c900e79deaa2256aa2c0a0ee2": ["netherlands"], + "20|openorgs____::54f2e88f3eb801dc7e49a4ca90fdd1b6": ["netherlands"], + "20|openorgs____::cb04606c0c4eb1696cf4bc74dba44bdf": ["netherlands"], + "20|openorgs____::a3af79fec4d09764e56cd6d4df1d976a": ["netherlands"], + "20|openorgs____::6c50ead5f8f9cac29c4c3066df9fba45": ["netherlands"], + "20|openorgs____::40a6eddd9af7a097cb83adb7c7b7fe55": ["netherlands"], + "20|openorgs____::0a49c26b60b634e6f8f6334bb8e078ae": ["netherlands"], + "20|openorgs____::374bcee2ff43200e9afe71b6dc606e6c": ["netherlands"], + "20|openorgs____::14e84ae5ab9b8fd2b05b65c19551a416": ["netherlands"], + "20|openorgs____::7d8ba78b303d8a0065029dffb414d4ae": ["netherlands"], + "20|openorgs____::b12b585c23a2b443b35cb33f57309a34": ["netherlands"], + "20|openorgs____::be5a09d4c12d29681a6985dd892f9f44": ["netherlands"], + "20|openorgs____::ba45682d5fd11bfdb695ca2fe5a0d377": ["netherlands"], + "20|openorgs____::58f65ed1ce3c9166e9c5f939bfdbf83a": ["netherlands"], + "20|openorgs____::81371ea94b1a09d3243e73d6ec3527ec": ["netherlands"], + "20|openorgs____::604881198363fedbb5d5478f465305f2": ["netherlands"], + "20|openorgs____::81b64115eb383a27a9c1820a2c760c89": ["netherlands"], + "20|openorgs____::ad8f981707a4a1d6c9e9ee60c02b9a11": ["netherlands"], + "20|openorgs____::994d7f6fc25c5de47b9212bb69524380": ["netherlands"], + "20|openorgs____::57a751ebab17a6996ba6836a89548f35": ["netherlands"], + "20|openorgs____::e79c2bf184a99250523a378626875955": ["netherlands"], + "20|openorgs____::05ba90eee0e9eef094a77240339d0ee5": ["netherlands"], + "20|openorgs____::04a66697fceec5d5e3bbf19b85135356": ["netherlands"], + "20|openorgs____::bb88336ade9d2deeece4dee6262054b4": ["netherlands"], + "20|openorgs____::b232880c47fb92a22ffea8e2e749e0ac": ["netherlands"], + "20|openorgs____::4aebed7bd67813bb8a325eb410a392be": ["netherlands"], + "20|openorgs____::4b2a9d306955ede352ba267af8616375": ["netherlands"], + "20|openorgs____::2d77f3a9829f7a9651ec60f597b479cd": ["netherlands"], + "20|openorgs____::2885352ab1a441a9d387424888e30796": ["netherlands"], + "20|openorgs____::95e5f0e3696306902a6749c406bb2728": ["netherlands"], + "20|openorgs____::048a44d990fd8a4710eef3a9e375360b": ["netherlands"], + "20|openorgs____::c254f2d5f6fdb12ecb37cfee25a3c4b1": ["netherlands"], + "20|openorgs____::775eab3c1281cb91d53a31c4a1ba1090": ["netherlands"], + "20|openorgs____::5f081781d2510771c1c6686c4a37d1a1": ["netherlands"], + "20|openorgs____::3f27054a1ab469826b9d3a1915452f89": ["netherlands"], + "20|openorgs____::0ac7645722cfee8253ce68cd2ab609c6": ["netherlands"], + "20|openorgs____::913ef94a4bc903f936164b00f287defa": ["netherlands"], + "20|openorgs____::7ec8de16e11c7fc9f7e4e32923a42b22": ["netherlands"], + "20|openorgs____::8a1b859747bd305bc855914588006010": ["netherlands"], + "20|openorgs____::d0a66a264d47d18baba1821d678627f3": ["netherlands"], + "20|openorgs____::c143bad570ce1ce6c1c5956f5f2d96ee": ["netherlands"], + "20|openorgs____::a5ac6dbe326433376c900329853d914a": ["netherlands"], + "20|openorgs____::de44646096a724bdba876f7f573e74eb": ["netherlands"], + "20|openorgs____::74691942ddde3989519f008b551ebb35": ["netherlands"], + "20|openorgs____::8cf49add8601037458e4ecdbd63a1c42": ["netherlands"], + "20|openorgs____::e086dd85625f9fe8b89dfc2d81441664": ["netherlands"], + "20|openorgs____::06b2bdd4093a09b5f6c33521a7bf665c": ["netherlands"], + "20|openorgs____::a08a62c3e21dd693af009638e21aba11": ["netherlands"], + "20|openorgs____::0e7e1aa241c64ac17aee64c0be4be069": ["netherlands"], + "20|openorgs____::20e491a3310e7146d52161c825a980ec": ["netherlands"], + "20|openorgs____::43e6dc2e3207f47c82560767ed928bab": ["netherlands"], + "20|openorgs____::919801f3040011bbef2dd28020917c7f": ["netherlands"], + "20|openorgs____::58d238642a71a8cf41bd68c3e4189151": ["netherlands"], + "20|openorgs____::7ef128431ed7a002d362e73a048d3fd5": ["netherlands"], + "20|openorgs____::743576a59064697f297fba7e07d6e0fe": ["netherlands"], + "20|openorgs____::3c2c37b7745ae3202347c3fa594bc66a": ["netherlands"], + "20|openorgs____::51609e11886740e4cf5f77d0f516a43c": ["netherlands"], + "20|openorgs____::e1c228979333191a8f4bd6b5f5d01644": ["netherlands"], + "20|openorgs____::1eaec9171998c0db1b627afe4a969430": ["netherlands"], + "20|openorgs____::4bfe0847ab9fa240154a274f13fa7ce0": ["netherlands"], + "20|openorgs____::917ca88ffc8c464dc902998c0d89c24e": ["netherlands"], + "20|openorgs____::990dcc0a2b128304fdde55df641a47b4": ["netherlands"], + "20|openorgs____::bc3c03a56c8ac610e083f74395896ed4": ["netherlands"], + "20|openorgs____::e2d0ca0969cf3610d277907a57b8ae7e": ["netherlands"], + "20|openorgs____::1820f7ff911f4cf656fd63fd17b2fea8": ["netherlands"], + "20|openorgs____::30f7a1b7ffaca5405d4fc22b45b346f8": ["netherlands"], + "20|openorgs____::64ff9bf918bf9552b30ba878bbf3eba6": ["netherlands"], + "20|openorgs____::6a6ff788c9f916d156e88942155543c8": ["netherlands"], + "20|openorgs____::938a3404eacaedfe1b192d39178606eb": ["netherlands"], + "20|openorgs____::a8369fe646a573e841439d2c24396b49": ["netherlands"], + "20|openorgs____::af7d4ec9149a9d4f43affddd3a5f6ade": ["netherlands"], + "20|openorgs____::b411400e9cb43b74991acf165fdbaf42": ["netherlands"], + "20|openorgs____::e9afeb0f06cd2672f64eba5c50b58508": ["netherlands"], + "20|openorgs____::f58b02a65440082244bedce6c5edddee": ["netherlands"], + "20|openorgs____::1a2cec15d21fef305e2f185f45ec866e": ["netherlands"], + "20|openorgs____::2310574386b83b200559887761a0e6b0": ["netherlands"], + "20|openorgs____::39501045bd561c8e721966822a5e76bb": ["netherlands"], + "20|openorgs____::468e82b8147d8b607a4820d954e8092c": ["netherlands"], + "20|openorgs____::51aec3d04ac8acf29e7d0cc01e85d49d": ["netherlands"], + "20|openorgs____::52f890d61aa7be9be055cb220264bb56": ["netherlands"], + "20|openorgs____::52fa090596519ef4cc00ee6d01dafa5e": ["netherlands"], + "20|openorgs____::546b0193ea282a484f5ffba1cf72c31a": ["netherlands"], + "20|openorgs____::55137182dc586d7fbcbd0651083cfcaa": ["netherlands"], + "20|openorgs____::5543c511cc8eeee82f81d5841adaf0c3": ["netherlands"], + "20|openorgs____::60c2723e09a04c216d34506524c4833c": ["netherlands"], + "20|openorgs____::63df05ca62ff76a23d92aeee3cd08e83": ["netherlands"], + "20|openorgs____::6c7d3222989e73edcd396801036ac142": ["netherlands"], + "20|openorgs____::6e1e359b40468348dc462a5e6d0d2f4c": ["netherlands"], + "20|openorgs____::7f37484efc0f92cb9974774e58d355d9": ["netherlands"], + "20|openorgs____::88038a30254a7cbe80a16c8824b355f3": ["netherlands"], + "20|openorgs____::9a1b949c6af565ac3cc0846a5f7473b9": ["netherlands"], + "20|openorgs____::9c1db524c2294a2ed7df7420291cd434": ["netherlands"], + "20|openorgs____::a0f6de4744e6e49fd80e96e33846f7c9": ["netherlands"], + "20|openorgs____::a246b8c7dc06716086d9012c00dfed93": ["netherlands"], + "20|openorgs____::cd7fa52a4719d56f6393f01a7d0a74ce": ["netherlands"], + "20|openorgs____::ce11a4e92d5cf66ba65cc0e1b5994daf": ["netherlands"], + "20|openorgs____::ef725cb463f17996424c6f27d7183e1d": ["netherlands"], + "20|openorgs____::ff39371bb6f5f4484908ed48ea41ba00": ["netherlands"], + "20|openorgs____::1ed7562253b98ec918a4007a532a750c": ["netherlands"], + "20|openorgs____::221325bfd7557cd363138ee80a62a729": ["netherlands"], + "20|openorgs____::2927d186274099c1a3b26b2517e3c717": ["netherlands"], + "20|openorgs____::2b9422d5f5bac4aae99b24e61586d3d3": ["netherlands"], + "20|openorgs____::3ad482503246d0c6b356b3212947d0b9": ["netherlands"], + "20|openorgs____::42b878fb8ecaf9a40a2446179d4ac4a5": ["netherlands"], + "20|openorgs____::4de50ef535f9dfa948617ff3b12e192b": ["netherlands"], + "20|openorgs____::56ab3c45d37a3e0b6fd8657a202d6f9f": ["netherlands"], + "20|openorgs____::6ad8bf5ed17bbf8809c34472cf0e4b82": ["netherlands"], + "20|openorgs____::6d172d9141a159458a1794dcca4733f8": ["netherlands"], + "20|openorgs____::7150901687aad5b0346843fb4426f7e3": ["netherlands"], + "20|openorgs____::7bcd05e7e96471553d6f395ce8670455": ["netherlands"], + "20|openorgs____::a0811c572ed4100f50c16060b95e9ec8": ["netherlands"], + "20|openorgs____::bcf63d0cf192b2941f29bff28c7a9d6b": ["netherlands"], + "20|openorgs____::d3dd82a7d383eff0f4e0108e4ba2a0db": ["netherlands"], + "20|openorgs____::d6951a5a11a8a33c96bfb4a8ce80a8d6": ["netherlands"], + "20|openorgs____::dc993215d316a13417c8e56e23a25b87": ["netherlands"], + "20|openorgs____::df72cb8cb3ce7b3a2fc8cdb05188ee15": ["netherlands"], + "20|openorgs____::09827cce030ebf5e04e1c955532e57c1": ["netherlands"], + "20|openorgs____::1948def781ac9956fed96f81710351db": ["netherlands"], + "20|openorgs____::271c04c73c94df9a3fa8d45c586a2637": ["netherlands"], + "20|openorgs____::365d0c26f67165ea52d918cebc858817": ["netherlands"], + "20|openorgs____::5149d47489dad962ee077bf2587b62a2": ["netherlands"], + "20|openorgs____::6fcc9d96bbfa51a0d67921ad3cced500": ["netherlands"], + "20|openorgs____::806a351b3659612b064034e7255de413": ["netherlands"], + "20|openorgs____::a8d0b3f004237455d2650006b004f10a": ["netherlands"], + "20|openorgs____::ffddafb3850edee334c70abad176c506":["netherlands"], + "20|openorgs____::5d55fb216b14691cf68218daf5d78cd9":["tunet"], + "20|openorgs____::5352e8197bcc25b2b66bcc0788ae8b92":["tunet"], + "20|openorgs____::81317c69d1aad1574f1a39f145ffd335":["tunet"] +} + + + + + + + Set a regex of funder shortnames to exclude from the project reference processing + + referenceextraction_project_fundingclass_blacklist_regex + ^DFG::.*$|^CONICYT::.*$|^RSF::.*$|^SGOV::.*$|^GSRT::.*$|^MIUR::.*$|^INNOVIRIS::.*$|^RIF::.*$|^SFRS::.*$ + + + + + + + Resume the workflow from a specific node + + communityOrganizationPropagation + + + + + + + + + + + + + + + + + + + + + + + + + create the PROD AGGREGATOR graph + + executeOozieJob + IIS + + { + 'graphOutputPath' : 'aggregatorGraphPath', + 'isLookupUrl' : 'isLookUpUrl', + 'reuseDBClaims' : 'reuseDBClaims', + 'reuseODFClaims' : 'reuseODFClaims', + 'reuseOAFClaims' : 'reuseOAFClaims', + 'reuseDB' : 'reuseDB', + 'reuseDBOpenorgs' : 'reuseDBOpenorgs', + 'reuseODF' : 'reuseODF', + 'reuseODF_hdfs' : 'reuseODFhdfs', + 'reuseOAF' : 'reuseOAF', + 'reuseOAF_hdfs' : 'reuseOAFhdfs', + 'contentPath' : 'contentPath', + 'nsPrefixBlacklist' : 'nsPrefixBlacklist', + 'shouldPatchRelations' : 'shouldPatchRelations', + 'idMappingPath' : 'idMappingPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/raw_all/oozie_app', + 'mongoURL' : 'mongodb://services.openaire.eu', + 'mongoDb' : 'mdstore', + 'mdstoreManagerUrl' : 'https://services.openaire.eu/mdstoremanager', + 'postgresURL' : 'jdbc:postgresql://postgresql.services.openaire.eu:5432/dnet_openaireplus', + 'postgresUser' : 'dnet', + 'postgresPassword' : 'dnetPwd', + 'postgresOpenOrgsURL' : 'jdbc:postgresql://10.19.65.39:5432/oa_organizations', + 'postgresOpenOrgsUser' : 'oa_organizations', + 'postgresOpenOrgsPassword' : 'tei1igiLaPheeghu', + 'shouldHashId' : 'true', + 'workingDir' : '/tmp/prod_provision/working_dir/prod_aggregator' + } + + build-report + + + + + + + Continue after aggregator graph? + + YES + + + + + + + + create the RAW graph + + executeOozieJob + IIS + + { + 'inputActionSetIds' : 'actionSetIdsRawGraph', + 'inputGraphRootPath' : 'aggregatorGraphPath', + 'outputGraphRootPath' : 'rawGraphPath', + 'isLookupUrl' : 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/actionmanager/wf/main/oozie_app', + 'sparkExecutorCores' : '3', + 'sparkExecutorMemory' : '10G', + 'activePromoteDatasetActionPayload' : 'true', + 'activePromoteDatasourceActionPayload' : 'true', + 'activePromoteOrganizationActionPayload' : 'true', + 'activePromoteOtherResearchProductActionPayload' : 'true', + 'activePromoteProjectActionPayload' : 'true', + 'activePromotePublicationActionPayload' : 'true', + 'activePromoteRelationActionPayload' : 'true', + 'activePromoteResultActionPayload' : 'true', + 'activePromoteSoftwareActionPayload' : 'true', + 'mergeAndGetStrategy' : 'MERGE_FROM_AND_GET', + 'shouldGroupById':'false', + 'workingDir' : '/tmp/prod_provision/working_dir/promoteActionsRaw' + } + + build-report + + + + + + + Continue after RAW graph? + + YES + + + + + + + + Graph grouping + + executeOozieJob + IIS + + { + 'graphBasePath':'rawGraphPath', + 'graphOutputPath':'groupedGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/group/oozie_app', + 'workingPath' : '/tmp/prod_provision/working_dir/grouping', + 'sparkExecutorCores' : '4', + 'sparkExecutorMemory' : '7G' + } + + + + + + + + Continue after grouped graph? + + YES + + + + + + + + clean the properties in the graph typed as Qualifier according to the vocabulary indicated in schemeid + + executeOozieJob + IIS + + { + 'graphInputPath' : 'groupedGraphPath', + 'graphOutputPath': 'cleanedFirstGraphPath', + 'isLookupUrl': 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/clean/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/clean', + 'shouldClean' : 'false' + } + + build-report + + + + + + + updates publication's hostedby info according to the ISSNs available from DOAJ and UNIBI + + executeOozieJob + IIS + + { + 'resumeFrom' : 'HBMresumeFrom', + 'sourcePath' : 'cleanedFirstGraphPath' + } + + + { + 'hostedByMapPath' : '/user/dnet.production/data/hostedByMap', + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/hostedbymap/oozie_app', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '12G', + 'workingDir' : '/tmp/prod_provision/working_dir/hostedbymap', + 'outputPath' : '/tmp/prod_provision/working_dir/hostedbymap', + 'unibiFileURL':'https://pub.uni-bielefeld.de/download/2944717/2944718/issn_gold_oa_version_4.csv', + 'doajJsonFileURL':'https://doaj.org/public-data-dump/journal', + 'dumpPath':'/tmp/prod_provision/working_dir/hostedbymap', + 'dumpFileName':'doaj_json.tar.gz' + } + + build-report + + + + + + + Resolve Relation + + executeOozieJob + IIS + + { + 'graphBasePath':'cleanedFirstGraphPath', + 'unresolvedPath' :'unresolvedEntityPath', + 'targetPath':'resolvedGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/resolution/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/relation_resolution', + 'shouldCleanContext' : 'false', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '12G' + } + + + + + + + + Shall we run IIS? + + YES + + + + + + + + prepare IIS action sets + + + [ + { + 'set' : 'iis-eosc-service-link', + 'jobProperty' : 'export_action_set_id_document_eoscServices', + 'enablingProperty' : 'active_referenceextraction_eoscservice', + 'enabled' : 'false' + }, + { + 'set' : 'iis-document-affiliation', + 'jobProperty' : 'export_action_set_id_matched_doc_organizations', + 'enablingProperty' : 'active_document_affiliation', + 'enabled' : 'false' + }, + { + 'set' : 'iis-referenced-projects-main', + 'jobProperty' : 'export_action_set_id_document_referencedProjects', + 'enablingProperty' : 'active_referenceextraction_project', + 'enabled' : 'true' + }, + { + 'set' : 'iis-referenced-datasets-main', + 'jobProperty' : 'export_action_set_id_document_referencedDatasets', + 'enablingProperty' : 'active_referenceextraction_dataset', + 'enabled' : 'false' + }, + { + 'set' : 'iis-researchinitiative', + 'jobProperty' : 'export_action_set_id_document_research_initiative', + 'enablingProperty' : 'active_referenceextraction_researchinitiative', + 'enabled' : 'false' + }, + { + 'set' : 'iis-document-similarities', + 'jobProperty' : 'export_action_set_id_document_similarities_standard', + 'enablingProperty' : 'active_documentssimilarity', + 'enabled' : 'false' + }, + { + 'set' : 'iis-document-classes', + 'jobProperty' : 'export_action_set_id_document_classes', + 'enablingProperty' : 'active_documentsclassification', + 'enabled' : 'false' + }, + { + 'set' : 'iis-document-citations', + 'jobProperty' : 'export_action_set_id_document_referencedDocuments', + 'enablingProperty' : 'active_citationmatching', + 'enabled' : 'false' + }, + { + 'set' : 'iis-document-citations-relations', + 'jobProperty' : 'export_action_set_id_citation_relations', + 'enablingProperty' : 'active_citationmatching_relations', + 'enabled' : 'false' + }, + { + 'set' : 'iis-referenceextraction-pdb', + 'jobProperty' : 'export_action_set_id_document_pdb', + 'enablingProperty' : 'active_referenceextraction_pdb', + 'enabled' : 'false' + }, + { + 'set' : 'document_software_url', + 'jobProperty' : 'export_action_set_id_document_software_url', + 'enablingProperty' : 'active_referenceextraction_software_url', + 'enabled' : 'false' + }, + { + 'set' : 'iis-entities-software', + 'jobProperty' : 'export_action_set_id_entity_software', + 'enablingProperty' : 'active_referenceextraction_software_url', + 'enabled' : 'false' + }, + { + 'set' : 'iis-communities', + 'jobProperty' : 'export_action_set_id_document_community', + 'enablingProperty' : 'active_referenceextraction_community', + 'enabled' : 'false' + }, + { + 'set' : 'iis-referenced-patents', + 'jobProperty' : 'export_action_set_id_document_patent', + 'enablingProperty' : 'active_referenceextraction_patent', + 'enabled' : 'false' + }, + { + 'set' : 'iis-entities-patent', + 'jobProperty' : 'export_action_set_id_entity_patent', + 'enablingProperty' : 'active_referenceextraction_patent', + 'enabled' : 'false' + }, + { + 'set' : 'iis-covid-19', + 'jobProperty' : 'export_action_set_id_document_covid19', + 'enablingProperty' : 'active_referenceextraction_covid19', + 'enabled' : 'false' + } + ] + + + + + + + + prepare IIS parameters + + import_islookup_service_location + import_content_objectstores_csv + import_content_object_store_location + import_mdstore_service_location + import_dataset_mdstore_ids_csv + oozie.wf.application.path + /lib/iis/primary/snapshots/2023-05-24_dhp-schemas_2.13.1-patched + IIS + deprecated - not used + import_infospace_graph_location + + import_project_concepts_context_ids_csv + argo-france,aurora,beopen,citizen-science,clarin,covid-19,dariah,dh-ch,dth,oa-pg,ebrains,egi,egrise,elixir-gr,embrc,enermaps,epos,eu-conexus,eut,eutopia,fet-fp7,fet-h2020,forthem,gotriple,heritage-science,inspired-ris,instruct,iperionhs,knowmad,lifewatch-eric,mes,neanias-atmospheric,neanias-underwater,neanias-space,netherlands,ni,north-american-studies,openaire-infrastructure,rda,risis,rural-digital-europe,science-innovation-policy,sdsn-gr,sobigdata,tunet + import_infospace_eligible_service_collectedfrom_datasourceid + 10|openaire____::2e06c1122c7df43765fdcf91080824fa + + + + + + + IIS main + + iisMainJobV3 + + { + 'cluster' : 'cluster', + 'oozie.wf.application.path' : 'oozie.wf.application.path', + 'referenceextraction_project_fundingclass_blacklist_regex' : 'referenceextraction_project_fundingclass_blacklist_regex', + + 'active_document_affiliation' : 'active_document_affiliation', + 'active_referenceextraction_project' : 'active_referenceextraction_project', + 'active_referenceextraction_dataset' : 'active_referenceextraction_dataset', + 'active_referenceextraction_researchinitiative' : 'active_referenceextraction_researchinitiative', + 'active_documentsclassification' : 'active_documentsclassification', + 'active_documentssimilarity' : 'active_documentssimilarity', + 'active_citationmatching' : 'active_citationmatching', + 'active_citationmatching_relations' : 'active_citationmatching_relations', + 'active_referenceextraction_pdb' : 'active_referenceextraction_pdb', + 'active_referenceextraction_software_url' : 'active_referenceextraction_software_url', + 'active_referenceextraction_community' : 'active_referenceextraction_community', + 'active_referenceextraction_patent' : 'active_referenceextraction_patent', + 'active_referenceextraction_covid19' : 'active_referenceextraction_covid19', + 'active_referenceextraction_eoscservice' : 'active_referenceextraction_eoscservice', + + 'import_content_objectstores_csv' : 'import_content_objectstores_csv', + 'import_content_object_store_location' : 'import_content_object_store_location', + 'import_mdstore_service_location' : 'import_mdstore_service_location', + 'import_islookup_service_location' : 'import_islookup_service_location', + 'import_project_concepts_context_ids_csv' : 'import_project_concepts_context_ids_csv', + 'import_dataset_mdstore_ids_csv' : 'import_dataset_mdstore_ids_csv', + 'import_infospace_graph_location' : 'resolvedGraphPath', + 'import_infospace_eligible_service_collectedfrom_datasourceid' : 'import_infospace_eligible_service_collectedfrom_datasourceid', + + 'export_action_set_id_matched_doc_organizations' : 'export_action_set_id_matched_doc_organizations', + 'export_action_set_id_document_referencedDatasets' : 'export_action_set_id_document_referencedDatasets', + 'export_action_set_id_document_referencedProjects' : 'export_action_set_id_document_referencedProjects', + 'export_action_set_id_document_research_initiative' : 'export_action_set_id_document_research_initiative', + 'export_action_set_id_document_similarities_standard' : 'export_action_set_id_document_similarities_standard', + + 'export_action_set_id_document_referencedDocuments' : 'export_action_set_id_document_referencedDocuments', + 'export_action_set_id_citation_relations' : 'export_action_set_id_citation_relations', + 'export_action_set_id_document_pdb' : 'export_action_set_id_document_pdb', + 'export_action_set_id_document_software_url' : 'export_action_set_id_document_software_url', + 'export_action_set_id_entity_software' : 'export_action_set_id_entity_software', + 'export_action_set_id_document_community' : 'export_action_set_id_document_community', + 'export_action_set_id_document_patent' : 'export_action_set_id_document_patent', + 'export_action_set_id_entity_patent' : 'export_action_set_id_entity_patent', + 'export_action_set_id_document_covid19' : 'export_action_set_id_document_covid19', + 'export_action_set_id_document_classes' : 'export_action_set_id_document_classes', + 'export_action_set_id_document_eoscServices' : 'export_action_set_id_document_eoscServices' + } + + + { + 'import_content_pdfaggregation_table_name' : 'pdfaggregation_i.payload' + } + + false + build-report + + + + + + + update IIS action sets + + + + + + + create the INFERRED graph + + executeOozieJob + IIS + + { + 'inputActionSetIds' : 'actionSetIdsIISGraph', + 'inputGraphRootPath' : 'resolvedGraphPath', + 'outputGraphRootPath' : 'inferredGraphPath', + 'isLookupUrl' : 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/actionmanager/wf/main/oozie_app', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '12G', + 'activePromoteDatasetActionPayload' : 'true', + 'activePromoteDatasourceActionPayload' : 'true', + 'activePromoteOrganizationActionPayload' : 'true', + 'activePromoteOtherResearchProductActionPayload' : 'true', + 'activePromoteProjectActionPayload' : 'true', + 'activePromotePublicationActionPayload' : 'true', + 'activePromoteRelationActionPayload' : 'true', + 'activePromoteResultActionPayload' : 'true', + 'activePromoteSoftwareActionPayload' : 'true', + 'mergeAndGetStrategy' : 'MERGE_FROM_AND_GET', + 'shouldGroupById':'false', + 'workingDir' : '/tmp/prod_provision/working_dir/promoteActionsIIS' + } + + build-report + + + + + + + search for duplicates in the raw graph + + executeOozieJob + IIS + + { + 'actionSetId' : 'dedupConfig', + 'graphBasePath' : 'inferredGraphPath', + 'dedupGraphPath': 'dedupGraphPath', + 'isLookUpUrl' : 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/dedup/scan/oozie_app', + 'actionSetIdOpenorgs' : 'dedup-similarity-organization-simple', + 'workingPath' : '/tmp/prod_provision/working_dir/dedup', + 'whiteListPath' : '/data/dedup/whitelist_prod', + 'sparkExecutorCores' : '3', + 'sparkExecutorMemory' : '10G', + 'sparkDriverMemory' : '6G' + } + + build-report + + + + + + + mark duplicates as deleted and redistribute the relationships + + executeOozieJob + IIS + + { + 'graphBasePath' : 'dedupGraphPath', + 'graphOutputPath': 'consistentGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/dedup/consistency/oozie_app', + 'workingPath' : '/tmp/prod_provision/working_dir/dedup', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + applies the actionsets referring to deduped records + + executeOozieJob + IIS + + { + 'inputActionSetIds' : 'actionSetIdsDedup', + 'inputGraphRootPath' : 'consistentGraphPath', + 'outputGraphRootPath' : 'dedupEnrichedGraphPath', + 'isLookupUrl' : 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/actionmanager/wf/main/oozie_app', + 'sparkExecutorCores' : '3', + 'sparkExecutorMemory' : '10G', + 'activePromoteDatasetActionPayload' : 'true', + 'activePromoteDatasourceActionPayload' : 'true', + 'activePromoteOrganizationActionPayload' : 'true', + 'activePromoteOtherResearchProductActionPayload' : 'true', + 'activePromoteProjectActionPayload' : 'true', + 'activePromotePublicationActionPayload' : 'true', + 'activePromoteRelationActionPayload' : 'true', + 'activePromoteResultActionPayload' : 'true', + 'activePromoteSoftwareActionPayload' : 'true', + 'mergeAndGetStrategy' : 'MERGE_FROM_AND_GET', + 'shouldGroupById':'true', + 'workingDir' : '/tmp/prod_provision/working_dir/promoteActionsDedup' + } + + build-report + + + + + + + Continue after dedup enriched graph? + + YES + + + + + + + + propagates ORCID among results linked by allowedsemrels semantic relationships + + executeOozieJob + IIS + + { + 'sourcePath' : 'dedupEnrichedGraphPath', + 'outputPath': 'orcidGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/orcidtoresultfromsemrel/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/orcid', + 'allowedsemrels' : 'IsSupplementedBy;IsSupplementTo;isSupplementedBy;isSupplementTo', + 'saveGraph' : 'true', + 'sparkExecutorCores' : '3', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + mark results respecting some rules as belonging to communities + + executeOozieJob + IIS + + { + 'sourcePath' : 'orcidGraphPath', + 'outputPath': 'bulkTaggingGraphPath', + 'isLookUpUrl' : 'isLookUpUrl', + 'pathMap' : 'bulkTaggingPathMap' + } + + + { + 'postgresURL' : 'jdbc:postgresql://postgresql.services.openaire.eu:5432/dnet_openaireplus', + 'postgresUser' : 'dnet', + 'postgresPassword' : 'dnetPwd', + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/bulktag/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/bulktag', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + creates relashionships between results and organizations when the organizations are associated to institutional repositories + + executeOozieJob + IIS + + { + 'sourcePath' : 'bulkTaggingGraphPath', + 'outputPath': 'affiliationGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/affiliation/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/affiliation', + 'saveGraph' : 'true', + 'blacklist' : 'empty' + } + + build-report + + + + + + + creates relashionships between results and organizations when the organizations are in parent/child relationships. The childs to the parents + + executeOozieJob + IIS + + { + 'sourcePath' : 'affiliationGraphPath', + 'outputPath': 'affiliationSemRelGraphPath', + 'iterations':'iterations' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/affiliation_semrel/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/affiliationsemrel', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + marks as belonging to communities the result collected from datasources related to the organizations specified in the organizationCommunityMap + + executeOozieJob + IIS + + { + 'sourcePath' : 'affiliationSemRelGraphPath', + 'outputPath': 'communityOrganizationGraphPath', + 'organizationtoresultcommunitymap': 'propagationOrganizationCommunityMap' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/community_organization/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/community_organization', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '12G', + 'saveGraph' : 'true' + } + + build-report + + + + + + + created relation between projects and results linked to other results trough allowedsemrel semantic relations linked to projects + + executeOozieJob + IIS + + { + 'sourcePath' : 'communityOrganizationGraphPath', + 'outputPath': 'fundingGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/funding/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/funding', + 'allowedsemrels' : 'IsSupplementedBy;IsSupplementTo', + 'saveGraph' : 'true', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + tag as belonging to communitites result in in allowedsemrels relation with other result already linked to communities + + executeOozieJob + IIS + + { + 'sourcePath' : 'fundingGraphPath', + 'outputPath': 'communitySemRelGraphPath', + 'isLookUpUrl' : 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/community_semrel/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/community_semrel', + 'allowedsemrels' : 'IsSupplementedBy;IsSupplementTo', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G', + 'saveGraph' : 'true' + } + + build-report + + + + + + + associated to results colleced from allowedtypes and those in the whithelist the country of the organization(s) handling the datasource it is collected from + + executeOozieJob + IIS + + { + 'sourcePath' : 'communitySemRelGraphPath', + 'outputPath': 'countryGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/country/oozie_app', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G', + 'workingDir' : '/tmp/prod_provision/working_dir/country', + 'allowedtypes' : 'pubsrepository::institutional', +'whitelist':'10|opendoar____::16e6a3326dd7d868cbc926602a61e4d0;10|openaire____::fdb035c8b3e0540a8d9a561a6c44f4de;10|eurocrisdris::fe4903425d9040f680d8610d9079ea14;10|openaire____::5b76240cc27a58c6f7ceef7d8c36660e;10|openaire____::172bbccecf8fca44ab6a6653e84cb92a;10|openaire____::149c6590f8a06b46314eed77bfca693f;10|eurocrisdris::a6026877c1a174d60f81fd71f62df1c1;10|openaire____::4692342f0992d91f9e705c26959f09e0;10|openaire____::8d529dbb05ec0284662b391789e8ae2a;10|openaire____::345c9d171ef3c5d706d08041d506428c;10|opendoar____::1c1d4df596d01da60385f0bb17a4a9e0;10|opendoar____::7a614fd06c325499f1680b9896beedeb;10|opendoar____::1ee3dfcd8a0645a25a35977997223d22;10|opendoar____::d296c101daa88a51f6ca8cfc1ac79b50;10|opendoar____::798ed7d4ee7138d49b8828958048130a;10|openaire____::c9d2209ecc4d45ba7b4ca7597acb88a2;10|eurocrisdris::c49e0fe4b9ba7b7fab717d1f0f0a674d;10|eurocrisdris::9ae43d14471c4b33661fedda6f06b539;10|eurocrisdris::432ca599953ff50cd4eeffe22faf3e48', + 'saveGraph' : 'true' + } + + build-report + + + + + + + clean the properties in the graph typed as Qualifier according to the vocabulary indicated in schemeid + + executeOozieJob + IIS + + { + 'graphInputPath' : 'countryGraphPath', + 'graphOutputPath': 'cleanedGraphPath', + 'isLookupUrl': 'isLookUpUrl' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/graph/clean/oozie_app', + 'postgresURL' : 'jdbc:postgresql://postgresql.services.openaire.eu:5432/dnet_openaireplus', + 'postgresUser' : 'dnet', + 'postgresPassword' : 'dnetPwd', + 'verifyCountryParam' : '10.17632;10.5061', + 'collectedfrom' : 'NARCIS', + 'country' : 'NL', + 'sparkExecutorCores' : '3', + 'sparkExecutorMemory' : '10G', + 'workingDir' : '/tmp/prod_provision/working_dir/clean', + 'shouldClean' : 'true' + } + + build-report + + + + + + + removes blacklisted relations + + executeOozieJob + IIS + + { + 'sourcePath' : 'cleanedGraphPath', + 'outputPath': 'blacklistedGraphPath' + } + + + { + 'oozie.wf.application.path' : '/lib/dnet/PROD/oa/enrichment/blacklist/oozie_app', + 'workingDir' : '/tmp/prod_provision/working_dir/blacklist', + 'postgresURL' : 'jdbc:postgresql://postgresql.services.openaire.eu:5432/dnet_openaireplus', + 'postgresUser' : 'dnet', + 'postgresPassword' : 'dnetPwd', + 'sparkExecutorCores' : '2', + 'sparkExecutorMemory' : '10G' + } + + build-report + + + + + + + + wf_20230605_132025_368 + 2023-06-05T13:21:02+00:00 + FAILURE + eu.dnetlib.data.hadoop.rmi.HadoopServiceException: hadoop job: 0011965-221214081318119-oozie-oozi-W failed with status: KILLED, oozie log: 2023-06-05 13:20:37,012 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] No results found 2023-06-05 13:20:37,032 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@:start:] Start action [0011965-221214081318119-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:37,032 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@:start:] [***0011965-221214081318119-oozie-oozi-W@:start:***]Action status=DONE 2023-06-05 13:20:37,032 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@:start:] [***0011965-221214081318119-oozie-oozi-W@:start:***]Action updated in DB! 2023-06-05 13:20:37,078 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@:start:] No results found 2023-06-05 13:20:37,093 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@:start:] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@:start: 2023-06-05 13:20:37,093 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W 2023-06-05 13:20:37,140 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@reset_outputpath] Start action [0011965-221214081318119-oozie-oozi-W@reset_outputpath] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:48,251 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@reset_outputpath] [***0011965-221214081318119-oozie-oozi-W@reset_outputpath***]Action status=DONE 2023-06-05 13:20:48,251 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@reset_outputpath] [***0011965-221214081318119-oozie-oozi-W@reset_outputpath***]Action updated in DB! 2023-06-05 13:20:48,299 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@reset_outputpath] No results found 2023-06-05 13:20:48,322 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] Start action [0011965-221214081318119-oozie-oozi-W@copy_entities] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:48,322 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] [***0011965-221214081318119-oozie-oozi-W@copy_entities***]Action status=DONE 2023-06-05 13:20:48,322 INFO org.apache.oozie.command.wf.ActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] [***0011965-221214081318119-oozie-oozi-W@copy_entities***]Action updated in DB! 2023-06-05 13:20:48,367 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] No results found 2023-06-05 13:20:48,372 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] No results found 2023-06-05 13:20:48,378 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] No results found 2023-06-05 13:20:48,384 INFO org.apache.oozie.service.JPAService: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] No results found 2023-06-05 13:20:48,491 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] Start action [0011965-221214081318119-oozie-oozi-W@copy_organization] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:48,495 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] Start action [0011965-221214081318119-oozie-oozi-W@copy_relation] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:48,505 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] Start action [0011965-221214081318119-oozie-oozi-W@copy_datasources] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:48,513 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] Start action [0011965-221214081318119-oozie-oozi-W@copy_projects] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10] 2023-06-05 13:20:49,676 INFO org.apache.oozie.action.hadoop.DistcpActionExecutor: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] checking action, hadoop job ID [job_1676554762303_45231] status [RUNNING] 2023-06-05 13:20:49,681 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] [***0011965-221214081318119-oozie-oozi-W@copy_relation***]Action status=RUNNING 2023-06-05 13:20:49,681 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] [***0011965-221214081318119-oozie-oozi-W@copy_relation***]Action updated in DB! 2023-06-05 13:20:49,692 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_relation 2023-06-05 13:20:49,717 INFO org.apache.oozie.action.hadoop.DistcpActionExecutor: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] checking action, hadoop job ID [job_1676554762303_45234] status [RUNNING] 2023-06-05 13:20:49,721 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] [***0011965-221214081318119-oozie-oozi-W@copy_projects***]Action status=RUNNING 2023-06-05 13:20:49,721 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] [***0011965-221214081318119-oozie-oozi-W@copy_projects***]Action updated in DB! 2023-06-05 13:20:49,733 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_projects 2023-06-05 13:20:49,764 INFO org.apache.oozie.action.hadoop.DistcpActionExecutor: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] checking action, hadoop job ID [job_1676554762303_45233] status [RUNNING] 2023-06-05 13:20:49,768 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] [***0011965-221214081318119-oozie-oozi-W@copy_organization***]Action status=RUNNING 2023-06-05 13:20:49,768 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] [***0011965-221214081318119-oozie-oozi-W@copy_organization***]Action updated in DB! 2023-06-05 13:20:49,771 INFO org.apache.oozie.action.hadoop.DistcpActionExecutor: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] checking action, hadoop job ID [job_1676554762303_45232] status [RUNNING] 2023-06-05 13:20:49,773 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_organization 2023-06-05 13:20:49,775 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] [***0011965-221214081318119-oozie-oozi-W@copy_datasources***]Action status=RUNNING 2023-06-05 13:20:49,775 INFO org.apache.oozie.command.wf.ForkedActionStartXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] [***0011965-221214081318119-oozie-oozi-W@copy_datasources***]Action updated in DB! 2023-06-05 13:20:49,779 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_datasources 2023-06-05 13:20:49,784 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_entities] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_entities 2023-06-05 13:20:49,784 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@reset_outputpath] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@reset_outputpath 2023-06-05 13:20:53,821 INFO org.apache.oozie.command.wf.KillXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] STARTED WorkflowKillXCommand for jobId=0011965-221214081318119-oozie-oozi-W 2023-06-05 13:20:53,826 WARN org.apache.oozie.workflow.lite.LiteWorkflowInstance: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] workflow killed, killing [5] nodes 2023-06-05 13:20:53,866 INFO org.apache.oozie.command.wf.KillXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] ENDED WorkflowKillXCommand for jobId=0011965-221214081318119-oozie-oozi-W 2023-06-05 13:20:53,866 INFO org.apache.oozie.DagEngine: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] User claudio.atzori killed the WF job 0011965-221214081318119-oozie-oozi-W 2023-06-05 13:20:54,196 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_projects] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_projects 2023-06-05 13:20:54,504 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_relation] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_relation 2023-06-05 13:20:54,813 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_datasources] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_datasources 2023-06-05 13:20:55,126 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[dnet.production] GROUP[-] TOKEN[] APP[community_to_result_propagation] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W 2023-06-05 13:20:55,126 INFO org.apache.oozie.command.wf.WorkflowNotificationXCommand: SERVER[iis-cdh5-test-m3.ocean.icm.edu.pl] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0011965-221214081318119-oozie-oozi-W] ACTION[0011965-221214081318119-oozie-oozi-W@copy_organization] No Notification URL is defined. Therefore nothing to notify for job 0011965-221214081318119-oozie-oozi-W@copy_organization + communityOrganizationPropagation + + +
\ No newline at end of file diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/CommunityException.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/CommunityException.java index d9dd0592..c8f416d6 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/CommunityException.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/CommunityException.java @@ -1,7 +1,5 @@ package eu.dnetlib.openaire.exporter.exceptions; -import java.io.IOException; - public class CommunityException extends Exception { /** @@ -13,7 +11,7 @@ public class CommunityException extends Exception { super(message); } - public CommunityException(final IOException e) { + public CommunityException(final Throwable e) { super(e); } } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextException.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextException.java deleted file mode 100644 index 49794b93..00000000 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextException.java +++ /dev/null @@ -1,19 +0,0 @@ -package eu.dnetlib.openaire.exporter.exceptions; - -import java.io.IOException; - -public class ContextException extends Exception { - - /** - * - */ - private static final long serialVersionUID = -5489369676370127052L; - - public ContextException(final String message) { - super(message); - } - - public ContextException(final IOException e) { - super(e); - } -} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextNotFoundException.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextNotFoundException.java deleted file mode 100644 index 06222c1f..00000000 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/exceptions/ContextNotFoundException.java +++ /dev/null @@ -1,17 +0,0 @@ -package eu.dnetlib.openaire.exporter.exceptions; - -public class ContextNotFoundException extends Exception { - - /** - * - */ - private static final long serialVersionUID = -2026506752817353752L; - - public ContextNotFoundException(final String msg) { - super(msg); - } - - public ContextNotFoundException(final Exception e) { - super(e); - } -} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityClaimType.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityClaimType.java new file mode 100644 index 00000000..0e5a5d57 --- /dev/null +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityClaimType.java @@ -0,0 +1,26 @@ +package eu.dnetlib.openaire.exporter.model.community; + +public enum CommunityClaimType { + + managersOnly("managers-only"), + membersOnly("members-only"), + all("all"); + + private final String description; + + private CommunityClaimType(final String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public static CommunityClaimType fromDescription(final String dbData) { + for (final CommunityClaimType t : CommunityClaimType.values()) { + if (t.description.equalsIgnoreCase(dbData)) { return t; } + } + return null; + } + +} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityContentprovider.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityContentprovider.java index f550d544..c8cba59c 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityContentprovider.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityContentprovider.java @@ -19,10 +19,6 @@ public class CommunityContentprovider { @Schema(description = "the community identifier this content provider belongs to", required = true) private String communityId; - @NotNull - @Schema(description = "identifies this content provider within the context it belongs to", required = true) - private String id; - @Schema(description = "content provider name", required = false) private String name; @@ -30,6 +26,10 @@ public class CommunityContentprovider { @Schema(description = "content provider official name", required = true) private String officialname; + // @NotNull + @Schema(description = "content provider enabled for content inclusion", required = false) + private boolean enabled; + // @NotNull @Schema(description = "content provider selection criteria", required = false) private SelectionCriteria selectioncriteria; @@ -50,14 +50,6 @@ public class CommunityContentprovider { this.communityId = communityId; } - public String getId() { - return id; - } - - public void setId(final String id) { - this.id = id; - } - public String getName() { return name; } @@ -74,8 +66,15 @@ public class CommunityContentprovider { this.officialname = officialname; } - public SelectionCriteria getSelectioncriteria() { + public boolean isEnabled() { + return enabled; + } + public void setEnabled(final boolean enabled) { + this.enabled = enabled; + } + + public SelectionCriteria getSelectioncriteria() { return this.selectioncriteria; } @@ -84,11 +83,6 @@ public class CommunityContentprovider { } - @Override - public String toString() { - return String.format("id %s, name %s, selection criteria %s", this.id, this.name, toJson()); - } - public String toJson() { if (selectioncriteria == null) { return ""; } try { @@ -102,4 +96,22 @@ public class CommunityContentprovider { if (selectioncriteria == null) { return ""; } return ""; } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("CommunityContentprovider [\n\topenaireId = ") + .append(openaireId) + .append(",\n\tcommunityId = ") + .append(communityId) + .append(",\n\tname = ") + .append(name) + .append(",\n\tofficialname = ") + .append(officialname) + .append(",\n\tselectioncriteria = ") + .append(selectioncriteria) + .append("\n]"); + return builder.toString(); + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityDetails.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityDetails.java index de23e80e..919fc03a 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityDetails.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityDetails.java @@ -1,6 +1,6 @@ package eu.dnetlib.openaire.exporter.model.community; -import java.util.Date; +import java.time.LocalDateTime; import java.util.List; import com.fasterxml.jackson.annotation.JsonAutoDetect; @@ -12,10 +12,10 @@ import io.swagger.v3.oas.annotations.media.Schema; public class CommunityDetails extends CommunitySummary { @Schema(description = "date of creation for this community") - private Date creationDate; + private LocalDateTime creationDate; @Schema(description = "date of the last update for this communityu") - private Date lastUpdateDate; + private LocalDateTime lastUpdateDate; @Schema(description = "list of subjects (keywords) that characterise this community") private List subjects; @@ -29,6 +29,15 @@ public class CommunityDetails extends CommunitySummary { @Schema(description = "list of advanced criteria to associate results to this community") private SelectionCriteria advancedConstraints; + @Schema(description = "list of the remove criteria") + private SelectionCriteria removeConstraints; + + @Schema(description = "other zenodo communities") + private List otherZenodoCommunities; + + @Schema(description = "Suggested Acknowledgements") + private List suggestedAcknowledgements; + public CommunityDetails() {} public CommunityDetails(final CommunitySummary summary) { @@ -36,12 +45,12 @@ public class CommunityDetails extends CommunitySummary { } @Override - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } @Override - public void setCreationDate(final Date creationDate) { + public void setCreationDate(final LocalDateTime creationDate) { this.creationDate = creationDate; } @@ -54,12 +63,12 @@ public class CommunityDetails extends CommunitySummary { } @Override - public Date getLastUpdateDate() { + public LocalDateTime getLastUpdateDate() { return lastUpdateDate; } @Override - public void setLastUpdateDate(final Date lastUpdateDate) { + public void setLastUpdateDate(final LocalDateTime lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } @@ -86,4 +95,74 @@ public class CommunityDetails extends CommunitySummary { public void setAdvancedConstraints(final SelectionCriteria advancedConstraints) { this.advancedConstraints = advancedConstraints; } + + public SelectionCriteria getRemoveConstraints() { + return removeConstraints; + } + + public void setRemoveConstraints(final SelectionCriteria removeConstraints) { + this.removeConstraints = removeConstraints; + } + + public List getOtherZenodoCommunities() { + return otherZenodoCommunities; + } + + public void setOtherZenodoCommunities(final List otherZenodoCommunities) { + this.otherZenodoCommunities = otherZenodoCommunities; + } + + public List getSuggestedAcknowledgements() { + return suggestedAcknowledgements; + } + + public void setSuggestedAcknowledgements(final List suggestedAcknowledgements) { + this.suggestedAcknowledgements = suggestedAcknowledgements; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("CommunityDetails [\n\tcreationDate = ") + .append(creationDate) + .append(",\n\tlastUpdateDate = ") + .append(lastUpdateDate) + .append(",\n\tsubjects = ") + .append(subjects) + .append(",\n\tfos = ") + .append(fos) + .append(",\n\tsdg = ") + .append(sdg) + .append(",\n\tadvancedConstraints = ") + .append(advancedConstraints) + .append(",\n\tremoveConstraints = ") + .append(removeConstraints) + .append(",\n\totherZenodoCommunities = ") + .append(otherZenodoCommunities) + .append(",\n\tid = ") + .append(id) + .append(",\n\tqueryId = ") + .append(queryId) + .append(",\n\ttype = ") + .append(type) + .append(",\n\tname = ") + .append(name) + .append(",\n\tshortName = ") + .append(shortName) + .append(",\n\tdescription = ") + .append(description) + .append(",\n\tlogoUrl = ") + .append(logoUrl) + .append(",\n\tstatus = ") + .append(status) + .append(",\n\tzenodoCommunity = ") + .append(zenodoCommunity) + .append(",\n\tsuggestedAcknowledgements = ") + .append(suggestedAcknowledgements) + .append(",\n\tplan = ") + .append(plan) + .append("\n]"); + return builder.toString(); + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityMembershipType.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityMembershipType.java new file mode 100644 index 00000000..aead6cd6 --- /dev/null +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityMembershipType.java @@ -0,0 +1,24 @@ +package eu.dnetlib.openaire.exporter.model.community; + +public enum CommunityMembershipType { + + open("open"), + byInvitation("by-invitation"); + + private final String description; + + private CommunityMembershipType(final String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public static CommunityMembershipType fromDescription(final String dbData) { + for (final CommunityMembershipType t : CommunityMembershipType.values()) { + if (t.description.equalsIgnoreCase(dbData)) { return t; } + } + return null; + } +} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityOrganization.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityOrganization.java index 14652277..f0129b48 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityOrganization.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityOrganization.java @@ -17,10 +17,6 @@ public class CommunityOrganization { @Schema(description = "name of the organization", required = true) private String name; - @NotNull - @Schema(description = "identifies this organization within the context it belongs to", required = true) - private String id; - @NotNull @Schema(description = "url of the logo for this organization", required = true) private String logo_url; @@ -47,15 +43,6 @@ public class CommunityOrganization { return this; } - public String getId() { - return id; - } - - public CommunityOrganization setId(final String id) { - this.id = id; - return this; - } - public String getLogo_url() { return logo_url; } @@ -73,4 +60,19 @@ public class CommunityOrganization { this.website_url = website_url; return this; } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("CommunityOrganization [\n\tcommunityId = ") + .append(communityId) + .append(",\n\tname = ") + .append(name) + .append(",\n\tlogo_url = ") + .append(logo_url) + .append(",\n\twebsite_url = ") + .append(website_url) + .append("\n]"); + return builder.toString(); + } } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityProject.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityProject.java index a1833cd2..1bf31b0f 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityProject.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityProject.java @@ -1,5 +1,7 @@ package eu.dnetlib.openaire.exporter.model.community; +import java.time.LocalDate; + import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.v3.oas.annotations.media.Schema; @@ -13,9 +15,6 @@ public class CommunityProject { @Schema(description = "the community identifier this project belongs to", required = true) private String communityId; - @Schema(description = "identifies this project within the context it belongs to", required = true) - private String id; - @Schema(description = "project name", required = true) private String name; @@ -28,6 +27,9 @@ public class CommunityProject { @Schema(description = "project grant id", required = true) private String grantId; + @Schema(description = "available since", required = false) + private LocalDate availableSince; + public String getOpenaireId() { return openaireId; } @@ -44,14 +46,6 @@ public class CommunityProject { this.communityId = communityId; } - public String getId() { - return id; - } - - public void setId(final String id) { - this.id = id; - } - public String getName() { return name; } @@ -84,4 +78,33 @@ public class CommunityProject { this.grantId = grantId; } + public LocalDate getAvailableSince() { + return availableSince; + } + + public void setAvailableSince(final LocalDate availableSince) { + this.availableSince = availableSince; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("CommunityProject [\n\topenaireId = ") + .append(openaireId) + .append(",\n\tcommunityId = ") + .append(communityId) + .append(",\n\tname = ") + .append(name) + .append(",\n\tacronym = ") + .append(acronym) + .append(",\n\tfunder = ") + .append(funder) + .append(",\n\tgrantId = ") + .append(funder) + .append(",\n\tavailableSince = ") + .append(availableSince) + .append("\n]"); + return builder.toString(); + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityStatus.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityStatus.java index 3c7b376a..2be9aacc 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityStatus.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityStatus.java @@ -7,12 +7,19 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonAutoDetect public enum CommunityStatus { - @Schema(description = "restricted visibility") + @Schema(description = "hidden visibility") hidden, @Schema(description = "visible only to RCD managers") manager, @Schema(description = "visible to RCD managers and to the community users") - all + all, + + @Schema(description = "restricted visibility") + RESTRICTED, + + @Schema(description = "public visibility") + PUBLIC + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunitySummary.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunitySummary.java index 16e072be..2d17ad35 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunitySummary.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunitySummary.java @@ -1,6 +1,6 @@ package eu.dnetlib.openaire.exporter.model.community; -import java.util.Date; +import java.time.LocalDateTime; import com.fasterxml.jackson.annotation.JsonAutoDetect; @@ -16,7 +16,7 @@ public class CommunitySummary { protected String queryId; @Schema(description = "community type") - protected String type; + protected CommunityType type; @Schema(description = "community name") protected String name; @@ -25,10 +25,10 @@ public class CommunitySummary { protected String shortName; @Schema(description = "community creation date") - protected Date creationDate; + protected LocalDateTime creationDate; @Schema(description = "community last update date") - protected Date lastUpdateDate; + protected LocalDateTime lastUpdateDate; @Schema(description = "community description") protected String description; @@ -39,23 +39,33 @@ public class CommunitySummary { @Schema(description = "status of the community, drives its visibility") protected CommunityStatus status; + @Schema(description = "type of claim") + private CommunityClaimType claim; + + @Schema(description = "type of membership") + private CommunityMembershipType membership; + @Schema(description = "Zenodo community associated to this community") protected String zenodoCommunity; + @Schema(description = "community plan") + protected String plan; + public CommunitySummary() {} public CommunitySummary( final String id, final String queryId, - final String type, + final CommunityType type, final String name, final String shortName, - final Date creationDate, - final Date lastUpdateDate, + final LocalDateTime creationDate, + final LocalDateTime lastUpdateDate, final String description, final String logoUrl, final CommunityStatus status, - final String zenodoCommunity) { + final String zenodoCommunity, + final String plan) { this.id = id; this.queryId = queryId; this.type = type; @@ -67,6 +77,7 @@ public class CommunitySummary { this.logoUrl = logoUrl; this.status = status; this.zenodoCommunity = zenodoCommunity; + this.plan = plan; } public CommunitySummary(final CommunitySummary summary) { @@ -80,7 +91,8 @@ public class CommunitySummary { summary.getDescription(), summary.getLogoUrl(), summary.getStatus(), - summary.getZenodoCommunity()); + summary.getZenodoCommunity(), + summary.getPlan()); } public String getId() { @@ -99,11 +111,11 @@ public class CommunitySummary { this.queryId = queryId; } - public String getType() { + public CommunityType getType() { return type; } - public void setType(final String type) { + public void setType(final CommunityType type) { this.type = type; } @@ -123,19 +135,19 @@ public class CommunitySummary { this.shortName = shortName; } - public Date getCreationDate() { + public LocalDateTime getCreationDate() { return creationDate; } - public void setCreationDate(final Date creationDate) { + public void setCreationDate(final LocalDateTime creationDate) { this.creationDate = creationDate; } - public Date getLastUpdateDate() { + public LocalDateTime getLastUpdateDate() { return lastUpdateDate; } - public void setLastUpdateDate(final Date lastUpdateDate) { + public void setLastUpdateDate(final LocalDateTime lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } @@ -163,6 +175,22 @@ public class CommunitySummary { this.status = status; } + public CommunityClaimType getClaim() { + return claim; + } + + public void setClaim(final CommunityClaimType claim) { + this.claim = claim; + } + + public CommunityMembershipType getMembership() { + return membership; + } + + public void setMembership(final CommunityMembershipType membership) { + this.membership = membership; + } + public String getZenodoCommunity() { return zenodoCommunity; } @@ -171,4 +199,12 @@ public class CommunitySummary { this.zenodoCommunity = zenodoCommunity; } + public String getPlan() { + return plan; + } + + public void setPlan(final String plan) { + this.plan = plan; + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityType.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityType.java new file mode 100644 index 00000000..1e2ce254 --- /dev/null +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityType.java @@ -0,0 +1,6 @@ +package eu.dnetlib.openaire.exporter.model.community; + +public enum CommunityType { + community, + ri +} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityWritableProperties.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityWritableProperties.java index c617e710..6db6d0fa 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityWritableProperties.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityWritableProperties.java @@ -34,26 +34,29 @@ public class CommunityWritableProperties { @Schema(description = "Advanced constraint for the association of results to the community") private SelectionCriteria advancedConstraints; + @Schema(description = "Constraint for removing") + private SelectionCriteria removeConstraints; + @Schema(description = "status of the community, drives its visibility") private CommunityStatus status; @Schema(description = "id of the main Zenodo community") private String mainZenodoCommunity; - public static CommunityWritableProperties fromDetails(final CommunityDetails details) { - final CommunityWritableProperties p = new CommunityWritableProperties(); - p.setName(details.getName()); - p.setShortName(details.getShortName()); - p.setDescription(details.getDescription()); - p.setLogoUrl(details.getLogoUrl()); - p.setSubjects(details.getSubjects()); - p.setStatus(details.getStatus()); - p.setMainZenodoCommunity(details.getZenodoCommunity()); - p.setFos(details.getFos()); - p.setSdg(details.getSdg()); - p.setAdvancedConstraints(details.getAdvancedConstraints()); - return p; - } + @Schema(description = "identifiers of the other Zenodo community") + private List otherZenodoCommunities; + + @Schema(description = "membership of the community") + private CommunityMembershipType membership; + + @Schema(description = "type of the community") + private CommunityType type; + + @Schema(description = "type of supported claim") + private CommunityClaimType claim; + + @Schema(description = "community plan") + private String plan; public List getFos() { return fos; @@ -134,4 +137,52 @@ public class CommunityWritableProperties { public void setMainZenodoCommunity(final String mainZenodoCommunity) { this.mainZenodoCommunity = mainZenodoCommunity; } + + public CommunityMembershipType getMembership() { + return membership; + } + + public void setMembership(final CommunityMembershipType membership) { + this.membership = membership; + } + + public CommunityType getType() { + return type; + } + + public void setType(final CommunityType type) { + this.type = type; + } + + public CommunityClaimType getClaim() { + return claim; + } + + public void setClaim(final CommunityClaimType claim) { + this.claim = claim; + } + + public SelectionCriteria getRemoveConstraints() { + return removeConstraints; + } + + public void setRemoveConstraints(final SelectionCriteria removeConstraints) { + this.removeConstraints = removeConstraints; + } + + public List getOtherZenodoCommunities() { + return otherZenodoCommunities; + } + + public void setOtherZenodoCommunities(final List otherZenodoCommunities) { + this.otherZenodoCommunities = otherZenodoCommunities; + } + + public String getPlan() { + return plan; + } + + public void setPlan(final String plan) { + this.plan = plan; + } } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityZenodoCommunity.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityZenodoCommunity.java index 4bae4957..cbe27f17 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityZenodoCommunity.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/CommunityZenodoCommunity.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import io.swagger.v3.oas.annotations.media.Schema; @JsonAutoDetect +@Deprecated public class CommunityZenodoCommunity { @NotNull diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/SubCommunity.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/SubCommunity.java new file mode 100644 index 00000000..2b2a7510 --- /dev/null +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/SubCommunity.java @@ -0,0 +1,125 @@ +package eu.dnetlib.openaire.exporter.model.community; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; + +import eu.dnetlib.openaire.exporter.model.context.Param; +import io.swagger.v3.oas.annotations.media.Schema; + +@JsonAutoDetect +public class SubCommunity { + + @Schema(description = "the id of the subCommunity", required = true) + private String subCommunityId; + + @Schema(description = "the community identifier this sub community belongs to", required = true) + private String communityId; + + @Schema(description = "the parent of the subCommunity, if available (it should the id of another subCommunity)", required = false) + private String parent; + + @Schema(description = "the label of the subCommunity", required = true) + private String label; + + @Schema(description = "the category of the subCommunity", required = true) + private String category; + + @Schema(description = "the parameters of the subCommunity", required = true) + private List params = new ArrayList<>(); + + @Schema(description = "it supports the claims", required = true) + private boolean claim = false; + + @Schema(description = "it is browsable", required = true) + private boolean browsable = false; + + public String getSubCommunityId() { + return subCommunityId; + } + + public void setSubCommunityId(final String subCommunityId) { + this.subCommunityId = subCommunityId; + } + + public String getCommunityId() { + return communityId; + } + + public void setCommunityId(final String communityId) { + this.communityId = communityId; + } + + public String getParent() { + return parent; + } + + public void setParent(final String parent) { + this.parent = parent; + } + + public String getLabel() { + return label; + } + + public void setLabel(final String label) { + this.label = label; + } + + public String getCategory() { + return category; + } + + public void setCategory(final String category) { + this.category = category; + } + + public List getParams() { + return params; + } + + public void setParams(final List map) { + this.params = map; + } + + public boolean isClaim() { + return claim; + } + + public void setClaim(final boolean claim) { + this.claim = claim; + } + + public boolean isBrowsable() { + return browsable; + } + + public void setBrowsable(final boolean browsable) { + this.browsable = browsable; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("SubCommunity [\n\tsubCommunityId = ") + .append(subCommunityId) + .append(",\n\tcommunityId = ") + .append(communityId) + .append(",\n\tparent = ") + .append(parent) + .append(",\n\tlabel = ") + .append(label) + .append(",\n\tcategory = ") + .append(category) + .append(",\n\tparams = ") + .append(params) + .append(",\n\tclaim = ") + .append(claim) + .append(",\n\tbrowsable = ") + .append(browsable) + .append("\n]"); + return builder.toString(); + } + +} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/selectioncriteria/SelectionCriteria.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/selectioncriteria/SelectionCriteria.java index c023df00..84ad5f15 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/selectioncriteria/SelectionCriteria.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/community/selectioncriteria/SelectionCriteria.java @@ -3,14 +3,14 @@ package eu.dnetlib.openaire.exporter.model.community.selectioncriteria; import java.io.Serializable; import java.util.List; -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + @JsonAutoDetect public class SelectionCriteria implements Serializable { @@ -32,9 +32,7 @@ public class SelectionCriteria implements Serializable { } public static SelectionCriteria fromJson(final String json) { - if(StringUtils.isEmpty(json)){ - return null; - } + if (StringUtils.isEmpty(json)) { return null; } try { return new ObjectMapper().readValue(json, SelectionCriteria.class); } catch (final JsonProcessingException e) { @@ -43,4 +41,12 @@ public class SelectionCriteria implements Serializable { } } + public String toJson() { + try { + return new ObjectMapper().writeValueAsString(this); + } catch (final JsonProcessingException e) { + throw new RuntimeException(e); + } + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Category.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Category.java index 9cb3cdb4..c51db96b 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Category.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Category.java @@ -1,7 +1,6 @@ package eu.dnetlib.openaire.exporter.model.context; import java.util.List; -import java.util.Map; public class Category { @@ -11,7 +10,7 @@ public class Category { private boolean claim; - private Map> params; + private List params; private List concepts; @@ -31,7 +30,7 @@ public class Category { return getConcepts() != null && !getConcepts().isEmpty(); } - public Map> getParams() { + public List getParams() { return params; } @@ -54,7 +53,7 @@ public class Category { return this; } - public Category setParams(final Map> params) { + public Category setParams(final List params) { this.params = params; return this; } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/CategorySummary.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/CategorySummary.java index 46d18321..9c6b394d 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/CategorySummary.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/CategorySummary.java @@ -1,5 +1,7 @@ package eu.dnetlib.openaire.exporter.model.context; +import java.util.Objects; + public class CategorySummary { private String id; @@ -35,4 +37,17 @@ public class CategorySummary { return this; } + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { return true; } + if (!(obj instanceof CategorySummary)) { return false; } + final CategorySummary other = (CategorySummary) obj; + return Objects.equals(id, other.id); + } + } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Concept.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Concept.java index dd2e8f0e..db3b0a93 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Concept.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Concept.java @@ -1,7 +1,6 @@ package eu.dnetlib.openaire.exporter.model.context; import java.util.List; -import java.util.Map; public class Concept { @@ -11,7 +10,7 @@ public class Concept { private boolean claim; - private Map> params; + private List params; private List concepts; @@ -31,7 +30,7 @@ public class Concept { return claim; } - public Map> getParams() { + public List getParams() { return params; } @@ -54,7 +53,7 @@ public class Concept { return this; } - public Concept setParams(final Map> params) { + public Concept setParams(final List params) { this.params = params; return this; } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Context.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Context.java index ff9b42b7..e3234e3e 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Context.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Context.java @@ -16,7 +16,7 @@ public class Context { private Date lastUpdateDate; - private Map> params; + private List params; private Map categories; @@ -36,7 +36,7 @@ public class Context { return creationDate; } - public Map> getParams() { + public List getParams() { return params; } @@ -73,7 +73,7 @@ public class Context { return this; } - public Context setParams(final Map> params) { + public Context setParams(final List params) { this.params = params; return this; } diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/IISConfigurationEntry.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/IISConfigurationEntry.java new file mode 100644 index 00000000..64d712a0 --- /dev/null +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/IISConfigurationEntry.java @@ -0,0 +1,51 @@ +package eu.dnetlib.openaire.exporter.model.context; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +public class IISConfigurationEntry implements Serializable { + + private static final long serialVersionUID = -1470248262314248937L; + + private String id; + private String label; + private List params = new ArrayList<>(); + + public String getId() { + return id; + } + + public void setId(final String id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(final String label) { + this.label = label; + } + + public List getParams() { + return params; + } + + public void setParams(final List params) { + this.params = params; + } + + public void addParams(final String name, final String... values) { + if (StringUtils.isNoneBlank(name) && values != null) { + for (final String v : values) { + if (StringUtils.isNotBlank(v)) { + params.add(new Param().setName(name).setValue(v)); + } + } + } + } + +} diff --git a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Param.java b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Param.java index 071fb5cd..07533ceb 100644 --- a/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Param.java +++ b/libs/dnet-exporter-model/src/main/java/eu/dnetlib/openaire/exporter/model/context/Param.java @@ -1,6 +1,10 @@ package eu.dnetlib.openaire.exporter.model.context; -public class Param { +import java.io.Serializable; + +public class Param implements Serializable { + + private static final long serialVersionUID = -1534376651378828800L; private String name;