Resource Registry Service - Type Management

From Gcube Wiki
Jump to: navigation, search

These sections provide information regarding how to interact with Resource Registry Service for Type Management. REST and JAVA API are presented for each functionality.

Please note that the provided examples can intentionally hide some details in the response to avoid unneeded complexity.

Type Management

Type Management is responsible for managing the instantiation of the IS Model by allowing the definition of entities, relations and embedded types and their schema.

Type Management exposes the following APIs:

  • Create: allows to create a new Type;
  • Exists: allows to check if a Type exists;
  • Read: allows reading a Type. This API allows also the listing of type and its subtypes by indicating the query parameter polymorphic=true.

By indicating the polimorphic parameter and as {TYPE_NAME} on of the base type of the IS Model (i.e. Resource, Facet, IsRelatedTo, ConsistsOf), it is possibile to list all the types of such base type.

Types Management Administrative capabilites

The service is also capable of updating and deleting a certain type but such APIs are not exposed as REST APIs.

  • delete: is only allowed if the type has no subtypes and no instances;
  • update: requires the new version is higher than the current one and a valid changelog is provided for the new version, such as the whole previous history.

If you need one of these operations, please open a support request to Luca Frosini

Type Collection

The following table shows the exposed APIs as REST Collection

Operation HTTP Method URL
Create PUT /types/{TYPE_NAME}
Exists HEAD /types/{TYPE_NAME}
Read GET /types/{TYPE_NAME}[?polymorphic=false]

Security configuration based on Authorization Framework make this port type accessible only from Resource Manager. In other words, no others client is allowed to manage types rather than Resource Manager.

Type Definition

Any Type is described by the following attributes:

  • name (String): Type Name
  • description (String): The description of the Type. default=null.
  • abstractType (Boolean): Indicate if the type is abstract so that it cannot be instantiated. In other words, only subtypes of this type can be instantiated. default=false.
  • superclasses (List<String>): The list of all supertypes of this type. Multiple Inheritance is supported.
  • properties: any types, except Resource and its specialisation, includes a properties array [List]. Any #Property is described by a set of attributes.
  • version: the actual version of the type;
  • changelog: the history of changes in the type representation. It is an object containing properties with version as key and the change description as values.

Any Relation has two additional mandatory attributes:

  • source: indicate the required source type to instantiate such relation;
  • target: indicate the required target type to instantiate such relation.

Any Resource instead of properties expose two arrays:

  • facets: this array defines which Facet types describe the resource and which ConsistsOf relation type must be used to connect the facet instance;
  • resources: this array defines which other Resource types could be related to the defined type and which IsRelatedTo relation type could be used to connect the instances of them. The array contains only the outbound relations.

Each element of the ’facets’ and ’resources’ arrays contained in the Resource definition is composed of six attributes (* indicates a mandatory attribute):

  • source*: it is always the name of the defined type [String];
  • relation*: the relation type name to be used to connect the source type to the target type [String];
  • target*: the target type name of the relation [String];
  • description: the description of the reason why the source and the target should be related [String, default=null];
  • max: the upper bound number of relations between the source and target types (null means unbounded) [Integer, default=null];
  • min: the lower bound number of relations between the source and target types (null is the same as zero which means that the relation is optional). Optional relations are specified as to provide suggestion to whom is interested in instantiating the resource type [Integer, default=null].


Property

Any Property is described by the following attributes:

    • name*: the property name [String];
    • type*: The Type of the Property (e.g. String, Integer, ...). See Property Types;
    • description: the description of the property [String, default=null];
    • mandatory: indicate if the property is mandatory or not [String, default=false];
    • readOnly: the property cannot change its value [Boolean, default=false];
    • notNull: whether the property must assume a value diverse from ’null’ or not [Boolean, default=false];
    • max: whether the property can be limited to a maximum value [Integer, default=null];
    • min: whether the property can be limited to a minimum value [Integer, default=null];
    • regex: a regular expression to validate the property value [String, default=null]. A good online tool for regex is available at https://regex101.com/

Property Types

Basic Types
Type Java type Description
Boolean java.lang.Boolean or boolean Handles only the values True or False.
Integer java.lang.Integer or int or java.math.BigInteger 32-bit signed Integers.
Short java.lang.Short or short Small 16-bit signed integers.
Long java.lang.Long or long Big 64-bit signed integers.
Float java.lang.Float or float Decimal numbers.
Double java.lang.Double or double Decimal numbers with high precision.
Date java.util.Date Any date with the precision up to milliseconds.
String java.lang.String Any string as alphanumeric sequence of chars.
Property ? extends org.gcube.informationsystem.model.reference.properties.Property This is an Object contained inside the owner Entity and has no Header. It is reachable only by navigating the owner Entity.
List<Property> List<? extends org.gcube.informationsystem.model.reference.properties.Property> List of Objects contained inside the owner Entity and have no Header. They are reachable only by navigating the owner Entity.
Set<Property> Set<? org.gcube.informationsystem.model.reference.properties.Property> Set (no duplicates) of Objects contained inside the owner Entity and have no Header. They are reachable only by navigating the owner Entity.
Map<String,Property> Map<String, ? extends org.gcube.informationsystem.model.reference.properties.Property> Map of Objects contained inside the owner Entity and have no Header. They are reachable only by navigating the owner Entity.
Byte java.lang.Byte or byte Single byte. useful to store small 8-bit signed integers.
Binary java.lang.Byte[] or byte[] Can contain any value as byte array.
Derived Types

The following are obtained using a String as real type and adding a validation regex.

Type Java type Description
Enum java.lang.Enum or enum by default it is represented using the String representation of the Enum. So that the primitive type used will be String. The enumeration is checked by setting Regexpr property. The Regular Expression is auto-generated and it will be something like ^(FIRST-ENUM-STRING_REPRESENTATION|SECOND-ENUM-STRING_REPRESENTATION|...|LAST_ENUM_STRING_REPRESENTATION)$.

Otherwise (if indicated using an annotation), it can be represented using the Integer value of the Enum. So that the primitive type used will be Integer. The enumeration is checked using Max and Min properties.

UUID java.util.UUID String representation of the UUID. The check is obtained using the regular expression ^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$
URL java.net.URL String representation of the URL. No check actually.
URI java.net.URI String representation of the URI. No check actually.
TypeVersion org.gcube.informationsystem.utils.TypeVersion A type representing and validating a version in the following format X.X.X Major(Integer).Minor(Integer).Revision(Integer) (e.g 1.0.0, 2.3.0, 2.0.1). The check is obtained using the regular expression ^[1-9][0-9]{0,}\.(0|([1-9][0-9]{0,}))\.(0|([1-9][0-9]{0,}))$.
Complex Types

Any property defined by composing basic types derives from Property type.

Type Definition Example (Facet)

An example of representation of Facet type

{
  "@class": "FacetType",
  "header": {
    "@class": "Header",
    "uuid": "0d5167fa-dade-40e9-a961-4ca0c20aec85",
    "createdBy": "luca.frosini",
    "creationTime": "2021-06-30 09:37:53.328 +0000",
    "lastUpdateBy": "luca.frosini",
    "lastUpdateTime": "2021-06-30 09:37:53.328 +0000"
  },
  "name": "Facet",
  "description": "This is the base class for Facets",
  "abstract": true,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  }
}

Resource Registry Schema Client

Resource Registry Schema Client is a java library providing RPC facilities to interact with Type Collection. The library hides all the complexity of marshalling and unmarshalling of requests and results. By using this library any client is able to manage java classes instead of JSON objects.

To use the Java library to interact with Type Collection declare the following dependency in your pom.xml file.

<dependency>
	<groupId>org.gcube.information-system</groupId>
	<artifactId>resource-registry-schema-client</artifactId>
	<version>[4.0.0,5.0.0-SNAPSHOT)</version>
<dependency>


To use the client you just need to instantiate the client via the provided factory.

import org.gcube.informationsystem.resourceregistry.schema.ResourceRegistrySchemaClient;
import org.gcube.informationsystem.resourceregistry.schema.ResourceRegistrySchemaClientFactory;
 
...
 
ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();

The provided client exposes the available methods and options as explained below.

The source code of the resource-registry-schema-client is available at https://code-repo.d4science.org/gCubeSystem/resource-registry-schema-client

APIs

Create Type

Allow creating new Entity or Relation or Property Type.

Create via Java client

You can provide the defined class and the client take care of creating the type definition as JSON

ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
Type type = resourceRegistrySchemaClient.create(EService.class);

Alternatively, you can directly provide the type definition as a string.

ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
String typeDefinition = TypeMapper.serializeType(EService.class);
Type type = resourceRegistrySchemaClient.create(typeDefinition);


Create via REST API

PUT /resource-registry/types/{TYPE_NAME}
Code Type Description
200 String The JSON representation of the newly created type

In the following examples, the responses are omitted because are identical to the responses of read examples.

Create Resource Type Example

Request URL

PUT /resource-registry/types/EService

Request Body

{
  "@class": "ResourceType",
  "header": null,
  "name": "EService",
  "description": "EService is any running service that is registered in the infrastructure and made available by an access point.",
  "superClasses": [
    "Service"
  ],
  "facets": [
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "IsIdentifiedBy",
      "target": "SoftwareFacet",
      "description": "The main software enabling the EService capabilities.",
      "min": 1,
      "max": 1
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "ConsistsOf",
      "target": "SoftwareFacet",
      "description": "Software available in the EService environment that characterizes the specific EService instance.",
      "min": 0,
      "max": null
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "ConsistsOf",
      "target": "AccessPointFacet",
      "description": "Identify the endpoints of the EService.",
      "min": 1,
      "max": null
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "ConsistsOf",
      "target": "EventFacet",
      "description": "Events characterising the current status and lifecycle of the service, e.g. ActivationTime, DeploymentTime.",
      "min": 1,
      "max": null
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "ConsistsOf",
      "target": "StateFacet",
      "description": "The current status of the EService, e.g. STARTED, ready, down, failed.",
      "min": 1,
      "max": 1
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "ConsistsOf",
      "target": "LicenseFacet",
      "description": "The specific terms of use governing the exploitation of the EService.",
      "min": 0,
      "max": null
    }
  ],
  "resources": [
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "Discovers",
      "target": "EService",
      "description": "A reference to any other EService, the EService instance is discovering through query on IS.",
      "min": 0,
      "max": null
    },
    {
      "@class": "LinkedEntity",
      "source": "EService",
      "relation": "Uses",
      "target": "EService",
      "description": "A reference to any other EService, the EService instance is invoking.",
      "min": 0,
      "max": null
    }
  ],
  "abstract": false,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  }
}

The EService definition example shows how a Resource type can define mandatory and suggested Facets as well as any expected relations with other resources.

Create Facet Type Example

Request URL

PUT /resource-registry/types/ContactFacet

Request Body

{
  "@class": "FacetType",
  "header": null,
  "name": "ContactFacet",
  "description": "ContactFacet captures information on a point of contact for the resource, i.e., a person or a department serving as the coordinator or focal point  of information concerning the resource.",
  "superClasses": [
    "Facet"
  ],
  "properties": [
    {
      "@class": "PropertyDefinition",
      "name": "eMail",
      "description": "Email address",
      "mandatory": true,
      "readonly": false,
      "notnull": true,
      "max": null,
      "min": null,
      "regexp": "^[a-z0-9._%+-]{1,128}@[a-z0-9.-]{1,128}$",
      "type": "String"
    },
    {
      "@class": "PropertyDefinition",
      "name": "middleName",
      "description": "Middle Name",
      "mandatory": false,
      "readonly": false,
      "notnull": false,
      "max": null,
      "min": null,
      "regexp": null,
      "type": "String"
    },
    {
      "@class": "PropertyDefinition",
      "name": "surname",
      "description": "Surname",
      "mandatory": true,
      "readonly": false,
      "notnull": true,
      "max": null,
      "min": null,
      "regexp": null,
      "type": "String"
    },
    {
      "@class": "PropertyDefinition",
      "name": "name",
      "description": "First Name",
      "mandatory": true,
      "readonly": false,
      "notnull": true,
      "max": null,
      "min": null,
      "regexp": null,
      "type": "String"
    },
    {
      "@class": "PropertyDefinition",
      "name": "title",
      "description": "A name describing the profession or marital status of the point of contact. e.g., Dr, Mrs, Mr.",
      "mandatory": false,
      "readonly": false,
      "notnull": false,
      "max": null,
      "min": null,
      "regexp": null,
      "type": "String"
    }
  ],
  "abstract": false,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  }
}
Create IsRelatedTo Type Example

Request URL

PUT /resource-registry/types/Hosts

Request Body

{
  "@class": "IsRelatedToType",
  "header": null,
  "name": "Hosts",
  "description": "Hosts relation is used from a {@link Site} to a {@link Service} instance. The target of the Hosts relation depends on the service offered by the Site. When the resources provided by a site are virtual machines, Hosts relation is created from a {@link Site} to a {@link VirtualMachine}. When, instead a Site provides web services, Hosts relation is created with {@link EService}. If a site provides container facilities Hosts relation is created with {@link HostingNode}. By defining Hosts relation with target {@link Service}, the model is capable of representing the diverse type of federated systems and service.",
  "superClasses": [
    "IsRelatedTo"
  ],
  "abstract": false,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  },
  "source": {
    "@class": "ResourceType",
    "name": "Site"
  },
  "target": {
    "@class": "ResourceType",
    "name": "Service"
  }
}
Create ConsistsOf Type Example

Request URL

PUT /resource-registry/types/HasContact

Request Body

{
  "@class": "ConsistsOfType",
  "header": null,
  "name": "HasContact",
  "description": "HasContact is a base relation type to capture the diverse points of contact associated with a resource. This relation is abstract because if not specialised it does not add any semantic of relating the resource with the target {@link ContactFacet}.\nInstead, every specialisation refines the reason of using the {@link ContactFacet} allowing to discriminate between two or more {@link ContactFacet} attached to the same resource.The identified specialisations are: {@link HasContributor}, {@link HasCreator}, {@link HasCurator}, {@link HasDeveloper}, {@link HasMaintainer}, {@link HasManager} and {@link HasOwner}.",
  "superClasses": [
    "ConsistsOf"
  ],
  "abstract": true,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  },
  "source": {
    "@class": "ResourceType",
    "name": "Resource"
  },
  "target": {
    "@class": "FacetType",
    "name": "ContactFacet"
  }
}
Create Property Type Example

Request URL

PUT /resource-registry/types/PropagationConstraint

Request Body

{
  "@class": "PropertyType",
  "header": null,
  "name": "PropagationConstraint",
  "description": "This class provides propation constraint for Relation",
  "superClasses": [
    "Property"
  ],
  "properties": [
    {
      "@class": "PropertyDefinition",
      "name": "remove",
      "description": "It indicates the behaviour to implement for the target Entity when a 'remove' action is performed on the source Resource. Remove actions are: (i) the operation of removing an instance from a context; (ii) the operation of deleting an instance (it has an impact on all contexts).",
      "mandatory": true,
      "readonly": false,
      "notnull": true,
      "max": null,
      "min": null,
      "regexp": "^(cascadeWhenOrphan|cascade|keep)$",
      "type": "String"
    },
    {
      "@class": "PropertyDefinition",
      "name": "add",
      "description": "It indicates the behaviour to implement for the target Entity when an 'add' action is performed on the source Resource. Add action is the operation of adding an instance to a context.",
      "mandatory": true,
      "readonly": false,
      "notnull": true,
      "max": null,
      "min": null,
      "regexp": "^(propagate|unpropagate)$",
      "type": "String"
    }
  ],
  "abstract": false,
  "version": "1.0.0",
  "changelog": {
    "1.0.0": "First Version"
  }
}

Read Type

GET /resource-registry/schema/{TYPE_NAME}[?polymorphic=false]

Allow reading Type Definition

Read via Java Client

You can provide the defined class.

ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
List<Type> types = resourceRegistrySchemaClient.read(ContactFacet.class, false);

Alternatively, you can read the type using directly provide the type name as a string.

ResourceRegistrySchemaClient resourceRegistrySchemaClient = ResourceRegistrySchemaClientFactory.create();
List<Type> types = resourceRegistrySchemaClient.read("ContactFacet", false);

Read via REST API

GET /resource-registry/schema/{TYPE_NAME}[?polymorphic=false]
Code Type Description
200 String The JSON representation of the requested type(s)

The returned JSON is always an array also when the polymorphic is false.

Read Resource Type Example

Request URL

GET /resource-registry/schema/EService

Response Body

[
    {
        "@class": "ResourceType",
        "header": {
            "@class": "Header",
            "uuid": "21ba1b3e-cab9-4b61-b3a8-3ff44ff1ee0a",
            "createdBy": "luca.frosini",
            "creationTime": "2021-06-30 09:37:58.431 +0000",
            "lastUpdateBy": "luca.frosini",
            "lastUpdateTime": "2021-06-30 09:37:58.431 +0000"
        },
        "name": "EService",
        "description": "EService is any running service that is registered in the infrastructure and made available by an access point.",
        "superClasses": [
            "Service"
        ],
        "facets": [
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "IsIdentifiedBy",
                "target": "SoftwareFacet",
                "description": "The main software enabling the EService capabilities.",
                "min": 1,
                "max": 1
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "ConsistsOf",
                "target": "SoftwareFacet",
                "description": "Software available in the EService environment that characterizes the specific EService instance.",
                "min": 0,
                "max": null
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "ConsistsOf",
                "target": "AccessPointFacet",
                "description": "Identify the endpoints of the EService.",
                "min": 1,
                "max": null
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "ConsistsOf",
                "target": "EventFacet",
                "description": "Events characterising the current status and lifecycle of the service, e.g. ActivationTime, DeploymentTime.",
                "min": 1,
                "max": null
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "ConsistsOf",
                "target": "StateFacet",
                "description": "The current status of the EService, e.g. STARTED, ready, down, failed.",
                "min": 1,
                "max": 1
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "ConsistsOf",
                "target": "LicenseFacet",
                "description": "The specific terms of use governing the exploitation of the EService.",
                "min": 0,
                "max": null
            }
        ],
        "resources": [
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "Discovers",
                "target": "EService",
                "description": "A reference to any other EService, the EService instance is discovering through query on IS.",
                "min": 0,
                "max": null
            },
            {
                "@class": "LinkedEntity",
                "source": "EService",
                "relation": "Uses",
                "target": "EService",
                "description": "A reference to any other EService, the EService instance is invoking.",
                "min": 0,
                "max": null
            }
        ],
        "abstract": false,
        "version": "1.0.0",
        "changelog": {
            "1.0.0": "First Version"
        }
    }
]
Read Facet Type Example

Request URL

GET /resource-registry/schema/ContactFacet

Response Body

[
    {
        "@class": "FacetType",
        "header": {
            "@class": "Header",
            "uuid": "f772a8b9-7529-46cf-80bf-a8bd85f9402f",
            "createdBy": "luca.frosini",
            "creationTime": "2021-06-30 09:37:55.538 +0000",
            "lastUpdateBy": "luca.frosini",
            "lastUpdateTime": "2021-06-30 09:37:55.538 +0000"
        },
        "name": "ContactFacet",
        "description": "ContactFacet captures information on a point of contact for the resource, i.e., a person or a department serving as the coordinator or focal point  of information concerning the resource.",
        "superClasses": [
            "Facet"
        ],
        "properties": [
            {
                "@class": "PropertyDefinition",
                "name": "eMail",
                "description": "Email address",
                "mandatory": true,
                "readonly": false,
                "notnull": true,
                "max": null,
                "min": null,
                "regexp": "^[a-z0-9._%+-]{1,128}@[a-z0-9.-]{1,128}$",
                "type": "String"
            },
            {
                "@class": "PropertyDefinition",
                "name": "middleName",
                "description": "Middle Name",
                "mandatory": false,
                "readonly": false,
                "notnull": false,
                "max": null,
                "min": null,
                "regexp": null,
                "type": "String"
            },
            {
                "@class": "PropertyDefinition",
                "name": "surname",
                "description": "Surname",
                "mandatory": true,
                "readonly": false,
                "notnull": true,
                "max": null,
                "min": null,
                "regexp": null,
                "type": "String"
            },
            {
                "@class": "PropertyDefinition",
                "name": "name",
                "description": "First Name",
                "mandatory": true,
                "readonly": false,
                "notnull": true,
                "max": null,
                "min": null,
                "regexp": null,
                "type": "String"
            },
            {
                "@class": "PropertyDefinition",
                "name": "title",
                "description": "A name describing the profession or marital status of the point of contact. e.g., Dr, Mrs, Mr.",
                "mandatory": false,
                "readonly": false,
                "notnull": false,
                "max": null,
                "min": null,
                "regexp": null,
                "type": "String"
            }
        ],
        "abstract": false,
        "version": "1.0.0",
        "changelog": {
            "1.0.0": "First Version"
        }
    }
]
Read IsRelatedTo Type Example

Request URL

GET /resource-registry/schema/Hosts

Response Body

[
    {
        "@class": "IsRelatedToType",
        "header": {
            "@class": "Header",
            "uuid": "80b1b276-2edf-4122-b183-8b0511cbbf77",
            "createdBy": "luca.frosini",
            "creationTime": "2021-06-30 09:38:01.966 +0000",
            "lastUpdateBy": "luca.frosini",
            "lastUpdateTime": "2021-06-30 09:38:01.966 +0000"
        },
        "name": "Hosts",
        "description": "Hosts relation is used from a {@link Site} a {@link Service} instance.\nThe target of the Hosts relation depends on the service offered by the Site.\nWhen the resources provided by a site are virtual machines, Hosts relation is created from a {@link Site} to a {@link VirtualMachine}.\nWhen, instead a Site provides web-services, Hosts relation is created with {@link EService}.\nIf a site provides container facilities Hosts relation is created with {@link HostingNode}.\nBy defining Hosts relation with target {@link Service}, the model is capable of representing the diverse type of federated systems and service.",
        "superClasses": [
            "IsRelatedTo"
        ],
        "abstract": false,
        "version": "1.0.0",
        "changelog": {
            "1.0.0": "First Version"
        },
        "source": {
            "@class": "ResourceType",
            "header": {
                "@class": "Header",
                "uuid": "a75df731-ff5c-4a21-8dc0-5b3b69a14ec1",
                "createdBy": "luca.frosini",
                "creationTime": "2021-06-30 09:37:58.801 +0000",
                "lastUpdateBy": "luca.frosini",
                "lastUpdateTime": "2021-06-30 09:37:58.801 +0000"
            },
            "name": "Site",
            "description": "Site is a resource representing the location (physical or virtual) hosting the resources associated.\nSite allows to identify all the services that will be affected by downtime due to a scheduled maintenance, as well as the impact on the infrastructure that an accidentalloss of connectivity could cause.\nThis resource allows to study and define the replication scenarios or to provide an adequate redundancy level to a VRE.",
            "superClasses": [
                "GCubeResource"
            ],
            "facets": [
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "IsIdentifiedBy",
                    "target": "IdentifierFacet",
                    "description": "The Site Identifier.",
                    "min": 1,
                    "max": 1
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "HasContact",
                    "target": "ContactFacet",
                    "description": "The main contact for the Site.",
                    "min": 1,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "HasMaintainer",
                    "target": "ContactFacet",
                    "description": "Contact information of the maintainer of the Site.",
                    "min": 1,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "HasManager",
                    "target": "ContactFacet",
                    "description": "Contact information of the Site Manager.",
                    "min": 1,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "ConsistsOf",
                    "target": "LocationFacet",
                    "description": "",
                    "min": 1,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "ConsistsOf",
                    "target": "NetworkingFacet",
                    "description": "",
                    "min": 1,
                    "max": null
                }
            ],
            "resources": [
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "IsOwnedBy",
                    "target": "Actor",
                    "description": "",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Site",
                    "relation": "Hosts",
                    "target": "Service",
                    "description": "",
                    "min": 0,
                    "max": null
                }
            ],
            "abstract": false,
            "version": "1.0.0",
            "changelog": {
                "1.0.0": "First Version"
            }
        },
        "target": {
            "@class": "ResourceType",
            "header": {
                "@class": "Header",
                "uuid": "f97a9bd0-9e39-4c22-87fb-088e615ebc21",
                "createdBy": "luca.frosini",
                "creationTime": "2021-06-30 09:37:57.864 +0000",
                "lastUpdateBy": "luca.frosini",
                "lastUpdateTime": "2021-06-30 09:37:57.864 +0000"
            },
            "name": "Service",
            "description": "Service (Abstract) represents any typology of service worth registering in the infrastructure.\nService has relations with quite all other resources.\nIf on one side, an Hybrid Data Infrastructure (HDI) is created to manage datasets, on the other side the HDI born to manage such datasets digitally.\nWe could affirm that datasets and services are the two pillar resources around which revolves the entire infrastructure.\nIt is important to highlight that Service has a general meaning and must not be intended as a network-callable service which is represented instead by one of its specialisations called {@link EService}. Giving that Service is abstract no {@link IsIdentifiedBy} association with a facet is provided which in turns is the responsibility of the specialisation.",
            "superClasses": [
                "GCubeResource"
            ],
            "facets": [
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "ConsistsOf",
                    "target": "DescriptiveMetadataFacet",
                    "description": "Any descriptive information associated with the service, e.g. for discovery purposes.",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "ConsistsOf",
                    "target": "SubjectFacet",
                    "description": "Any subject/tag associated with the service for descriptive, cataloguing and discovery purposes.",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "ConsistsOf",
                    "target": "CapabilityFacet",
                    "description": "Any facility supported/offered by the Service.",
                    "min": 0,
                    "max": null
                }
            ],
            "resources": [
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "CallsFor",
                    "target": "Service",
                    "description": "A reference to the Services needed by the target instance to work.",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "Activates",
                    "target": "Service",
                    "description": "The source Service enables the target Service to be running. Examples are a Hosting Node which enables an EService; A VirtualMachine enabling an EService or an HostingNode; An EService enabling a RunningPlugin; A VirtualMachine enabling an HostingNode etc",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "IsCustomizedBy",
                    "target": "ConfigurationTemplate",
                    "description": "A reference to any configuration characterising the Service behaviour.",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "Manages",
                    "target": "Dataset",
                    "description": "A reference to any Dataset resource managed by the Service instance.",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "Enables",
                    "target": "Software",
                    "description": "A reference to any Software the Service is enabling (i.e. the Software is running throught the EService).",
                    "min": 0,
                    "max": null
                },
                {
                    "@class": "LinkedEntity",
                    "source": "Service",
                    "relation": "Requires",
                    "target": "Service",
                    "description": "A reference to any Service needed by a Software to properly operate, e.g. this can be used to capture a sort of run-time requirements between a software component and the Service it needs.",
                    "min": 0,
                    "max": null
                }
            ],
            "abstract": true,
            "version": "1.0.0",
            "changelog": {
                "1.0.0": "First Version"
            }
        }
    }
]
Read ConsistsOf Type Example

Request URL

GET /resource-registry/schema/HasContact

Request Body

[
    {
        "@class": "ConsistsOfType",
        "header": {
            "@class": "Header",
            "uuid": "4513ee14-d50b-4394-a6f2-247b65a16e27",
            "createdBy": "luca.frosini",
            "creationTime": "2021-06-30 09:38:04.112 +0000",
            "lastUpdateBy": "luca.frosini",
            "lastUpdateTime": "2021-06-30 09:38:04.112 +0000"
        },
        "name": "HasContact",
        "description": "HasContact is a base relation type to capture the diverse points of contact associated with a resource. This relation is abstract because if not specialised it does not add any semantic of relating the resource with the target {@link ContactFacet}.\nInstead, every specialisation refines the reason of using the {@link ContactFacet} allowing to discriminate between two or more {@link ContactFacet} attached to the same resource.The identified specialisations are: {@link HasContributor}, {@link HasCreator}, {@link HasCurator}, {@link HasDeveloper}, {@link HasMaintainer}, {@link HasManager} and {@link HasOwner}.",
        "superClasses": [
            "ConsistsOf"
        ],
        "abstract": true,
        "version": "1.0.0",
        "changelog": {
            "1.0.0": "First Version"
        },
        "source": {
            "@class": "ResourceType",
            "header": {
                "@class": "Header",
                "uuid": "ebc84b1c-3637-433b-8697-5a26daa17c24",
                "createdBy": "luca.frosini",
                "creationTime": "2021-06-30 09:37:53.270 +0000",
                "lastUpdateBy": "luca.frosini",
                "lastUpdateTime": "2021-06-30 09:37:53.270 +0000"
            },
            "name": "Resource",
            "description": "This is the base class for Resources",
            "superClasses": [
                "Entity"
            ],
            "facets": [
                {
                    "@class": "LinkedEntity",
                    "source": "Resource",
                    "relation": "ConsistsOf",
                    "target": "Facet",
                    "description": "Any Resource consists of one or more Facets which describes the different aspects of the resource.",
                    "min": 1,
                    "max": null
                }
            ],
            "resources": [
                {
                    "@class": "LinkedEntity",
                    "source": "Resource",
                    "relation": "IsRelatedTo",
                    "target": "Resource",
                    "description": "Any Resource can be related to any other resource.",
                    "min": 0,
                    "max": null
                }
            ],
            "abstract": true,
            "version": "1.0.0",
            "changelog": {
                "1.0.0": "First Version"
            }
        },
        "target": {
            "@class": "FacetType",
            "header": {
                "@class": "Header",
                "uuid": "f772a8b9-7529-46cf-80bf-a8bd85f9402f",
                "createdBy": "luca.frosini",
                "creationTime": "2021-06-30 09:37:55.538 +0000",
                "lastUpdateBy": "luca.frosini",
                "lastUpdateTime": "2021-06-30 09:37:55.538 +0000"
            },
            "name": "ContactFacet",
            "description": "ContactFacet captures information on a point of contact for the resource, i.e., a person or a department serving as the coordinator or focal point  of information concerning the resource.",
            "superClasses": [
                "Facet"
            ],
            "properties": [
                {
                    "@class": "PropertyDefinition",
                    "name": "middleName",
                    "description": "Middle Name",
                    "mandatory": false,
                    "readonly": false,
                    "notnull": false,
                    "max": null,
                    "min": null,
                    "regexp": null,
                    "type": "String"
                },
                {
                    "@class": "PropertyDefinition",
                    "name": "eMail",
                    "description": "Email address",
                    "mandatory": true,
                    "readonly": false,
                    "notnull": true,
                    "max": null,
                    "min": null,
                    "regexp": "^[a-z0-9._%+-]{1,128}@[a-z0-9.-]{1,128}$",
                    "type": "String"
                },
                {
                    "@class": "PropertyDefinition",
                    "name": "surname",
                    "description": "Surname",
                    "mandatory": true,
                    "readonly": false,
                    "notnull": true,
                    "max": null,
                    "min": null,
                    "regexp": null,
                    "type": "String"
                },
                {
                    "@class": "PropertyDefinition",
                    "name": "name",
                    "description": "First Name",
                    "mandatory": true,
                    "readonly": false,
                    "notnull": true,
                    "max": null,
                    "min": null,
                    "regexp": null,
                    "type": "String"
                },
                {
                    "@class": "PropertyDefinition",
                    "name": "title",
                    "description": "A name describing the profession or marital status of the point of contact. e.g., Dr, Mrs, Mr.",
                    "mandatory": false,
                    "readonly": false,
                    "notnull": false,
                    "max": null,
                    "min": null,
                    "regexp": null,
                    "type": "String"
                }
            ],
            "abstract": false,
            "version": "1.0.0",
            "changelog": {
                "1.0.0": "First Version"
            }
        }
    }
]
Read Property Type Example

Request URL

GET /resource-registry/schema/PropagationConstraint

Response Body

[
    {
        "@class": "PropertyType",
        "header": {
            "@class": "Header",
            "uuid": "200bb2b2-f4ce-47d1-ab53-9ab1140026a1",
            "createdBy": "luca.frosini",
            "creationTime": "2021-06-30 09:37:52.468 +0000",
            "lastUpdateBy": "luca.frosini",
            "lastUpdateTime": "2021-06-30 09:37:52.468 +0000"
        },
        "name": "PropagationConstraint",
        "description": "This class provides propation constraint for Relation",
        "superClasses": [
            "Property"
        ],
        "properties": [
            {
                "@class": "PropertyDefinition",
                "name": "remove",
                "description": "It indicates the behaviour to implement for the target Entity when a 'remove' action is performed on the source Resource. Remove actions are: (i) the operation of removing an instance from a context; (ii) the operation of deleting an instance (it has an impact on all contexts).",
                "mandatory": true,
                "readonly": false,
                "notnull": true,
                "max": null,
                "min": null,
                "regexp": "^(cascadeWhenOrphan|cascade|keep)$",
                "type": "String"
            },
            {
                "@class": "PropertyDefinition",
                "name": "add",
                "description": "It indicates the behaviour to implement for the target Entity when an 'add' action is performed on the source Resource. Add action is the operation of adding an instance to a context.",
                "mandatory": true,
                "readonly": false,
                "notnull": true,
                "max": null,
                "min": null,
                "regexp": "^(propagate|unpropagate)$",
                "type": "String"
            }
        ],
        "abstract": false,
        "version": "1.0.0",
        "changelog": {
            "1.0.0": "First Version"
        }
    }
]