Fixed query to properly support IS model changes refs #24992

This commit is contained in:
Luca Frosini 2024-01-17 14:53:10 +01:00
parent 41e88f0c6e
commit 703b284b92
14 changed files with 108 additions and 88 deletions

View File

@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for gCube Catalogue (gCat) Service
## [v2.5.2-SNAPSHOT]
## [v2.5.1]
- Migrated code to reorganized E/R format [#24992]

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.data-catalogue</groupId>
<artifactId>gcat</artifactId>
<packaging>war</packaging>
<version>2.5.1</version>
<version>2.5.2-SNAPSHOT</version>
<name>gCube Catalogue (gCat) Service</name>
<description>
This service allows any client to publish on the gCube Catalogue.

View File

@ -1,10 +1,10 @@
{
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,24 +1,24 @@
{
"@class": "Configuration",
"type": "Configuration",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "IdentifierFacet",
"type": "IdentifierFacet",
"value": "catalogue-configuration"
}
}
],
"isRelatedTo": [
{
"@class": "IsCustomizedBy",
"type": "IsCustomizedBy",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,28 +1,28 @@
{
"@class": "SimpleFacet",
"_in": {
"@class": "ConsistsOf",
"type": "SimpleFacet",
"_source": {
"type": "ConsistsOf",
"source": {
"@class": "Configuration",
"type": "Configuration",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "IdentifierFacet",
"type": "IdentifierFacet",
"value": "gcat-configuration"
}
}
],
"isRelatedTo": [
{
"@class": "IsCustomizedBy",
"type": "IsCustomizedBy",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,10 +1,10 @@
{
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -12,14 +12,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,14 +1,14 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"type": "AccessPointFacet",
"_source": {
"type": "ConsistsOf",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -16,14 +16,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,10 +1,10 @@
{
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.postgresql",
"name": "postgresql"
}
@ -12,14 +12,14 @@
],
"isRelatedTo": [
{
"@class": "Uses",
"type": "Uses",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -27,14 +27,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,14 +1,14 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"type": "AccessPointFacet",
"_source": {
"type": "ConsistsOf",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.postgresql",
"name": "postgresql"
}
@ -16,14 +16,14 @@
],
"isRelatedTo": [
{
"@class": "Uses",
"type": "Uses",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -31,14 +31,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,10 +1,10 @@
{
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.apache.solr",
"name": "solr"
}
@ -12,14 +12,14 @@
],
"isRelatedTo": [
{
"@class": "Uses",
"type": "Uses",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -27,14 +27,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -1,14 +1,14 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"type": "AccessPointFacet",
"_source": {
"type": "ConsistsOf",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.apache.solr",
"name": "solr"
}
@ -16,14 +16,14 @@
],
"isRelatedTo": [
{
"@class": "Uses",
"type": "Uses",
"source": {
"@class": "EService",
"type": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
@ -31,14 +31,14 @@
],
"isRelatedTo": [
{
"@class": "CallsFor",
"type": "CallsFor",
"source": {
"@class": "VirtualService",
"type": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"type": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"type": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}

View File

@ -5,6 +5,7 @@ import java.io.StringReader;
import java.net.URL;
import java.nio.file.Files;
import java.util.Iterator;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -163,4 +164,12 @@ public class ProfileTest extends ContextTest {
}
}
@Test
public void testRegex() throws Exception {
File resDirectory = getResourcesDirectory();
File regexFile = new File(resDirectory, "regex.txt");
String regex = fileToString(regexFile);
Pattern.compile(regex);
}
}

View File

@ -1,6 +1,7 @@
package org.gcube.gcat.utils;
import java.net.URL;
import java.util.regex.Pattern;
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
import org.gcube.common.authorization.utils.secret.Secret;
@ -47,5 +48,10 @@ public class ConstantsTest extends ContextTest {
}
@Test
public void testRegex() throws Exception {
String regex = "^([a-zA-ZÀ-ÿ .-]+),\\s*([a-zA-ZÀ-ÿ .-]+)(?:,\\s*([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}))?(?:,\\s*(orcid.org/\\d{4}-\\d{4}-\\d{4}-\\d{3}[0-9X]))?$";
Pattern.compile(regex);
}
}

View File

@ -0,0 +1 @@
^([a-zA-ZÀ-ÿ .-]+),\s*([a-zA-ZÀ-ÿ .-]+)(?:,\s*([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}))?(?:,\s*(orcid.org/\d{4}-\d{4}-\d{4}-\d{3}[0-9X]))?$