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 # Changelog for gCube Catalogue (gCat) Service
## [v2.5.2-SNAPSHOT]
## [v2.5.1] ## [v2.5.1]
- Migrated code to reorganized E/R format [#24992] - Migrated code to reorganized E/R format [#24992]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,6 +5,7 @@ import java.io.StringReader;
import java.net.URL; import java.net.URL;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.Iterator; import java.util.Iterator;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; 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; package org.gcube.gcat.utils;
import java.net.URL; import java.net.URL;
import java.util.regex.Pattern;
import org.gcube.common.authorization.utils.manager.SecretManagerProvider; import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
import org.gcube.common.authorization.utils.secret.Secret; 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]))?$