Fixed profile according to latest version of IS Model and gCube Model

This commit is contained in:
Luca Frosini 2021-01-11 13:17:53 +01:00
parent 275880c428
commit 9436e96d90
1 changed files with 16 additions and 9 deletions

View File

@ -30,15 +30,17 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
import org.gcube.resourcemanagement.model.impl.entities.facets.IdentifierFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.SchemaFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.SimpleFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.XSDSchemaFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.resources.ConfigurationImpl;
import org.gcube.resourcemanagement.model.impl.properties.ValueSchemaImpl;
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet.IdentificationType;
import org.gcube.resourcemanagement.model.reference.entities.facets.SchemaFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.XSDSchemaFacet;
import org.gcube.resourcemanagement.model.reference.entities.resources.Configuration;
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.Query;
@ -57,7 +59,7 @@ public class ISProfile {
public static final String PROFILE = "profile";
public static final String PROFILE_SCHEMA = "profileSchema";
public static final String SCHEMA_URL_ADDRESS = "https://wiki.gcube-system.org/images_gcube/e/e8/Gcdcmetadataprofilev3.xsd";
public static final String SCHEMA_URL_ADDRESS = "https://code-repo.d4science.org/gCubeSystem/gcubedatacatalogue-metadata-discovery/raw/branch/master/src/main/resources/org/gcube/datacatalogue/metadatadiscovery/Gdcmetadataprofilev3.xsd";
public static final URL SCHEMA_URL;
static {
@ -110,12 +112,17 @@ public class ISProfile {
profile.setAdditionalProperty(PROFILE, xml);
configuration.addFacet(profile);
XSDSchemaFacet xsdSchemaFacet = new XSDSchemaFacetImpl();
xsdSchemaFacet.setName("gCube Item Profile");
xsdSchemaFacet.setSchemaURL(SCHEMA_URL);
xsdSchemaFacet.setDescription("gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.");
xsdSchemaFacet.setContent(DataCalogueMetadataFormatReader.getProfileSchemaString());
configuration.addFacet(xsdSchemaFacet);
ValueSchema schema = new ValueSchemaImpl();
schema.setValue(DataCalogueMetadataFormatReader.getProfileSchemaString());
schema.setSchema(SCHEMA_URL.toURI());
SchemaFacet schemaFacet = new SchemaFacetImpl();
schemaFacet.setName("gCube Item Profile");
schemaFacet.setDescription("gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.");
schemaFacet.setSchema(schema);
configuration.addFacet(schemaFacet);
return configuration;
}