diff --git a/docs/index.rst b/docs/index.rst index 1d39719..808ba76 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -308,7 +308,7 @@ This is the base type for any Entity +============+==========+========================================================+============================================================================================+ | **Name** | **Type** | **Attributes** | **Description** | +------------+----------+--------------------------------------------------------+--------------------------------------------------------------------------------------------+ - | @metadata | Metadata | ``Mandatory:true`` ``ReadOnly:false`` ``NotNull:true`` | Metadata associated with the instance that is automatically created/updated by the system. | + | metadata | Metadata | ``Mandatory:true`` ``ReadOnly:false`` ``NotNull:true`` | Metadata associated with the instance that is automatically created/updated by the system. | +------------+----------+--------------------------------------------------------+--------------------------------------------------------------------------------------------+ diff --git a/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java b/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java index 0557fbd..30638a6 100644 --- a/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java +++ b/src/main/java/org/gcube/informationsystem/base/reference/IdentifiableElement.java @@ -12,7 +12,7 @@ import org.gcube.informationsystem.model.reference.properties.Metadata; public interface IdentifiableElement extends Element { public static final String UUID_PROPERTY = "uuid"; - public static final String METADATA_PROPERTY = "@metadata"; + public static final String METADATA_PROPERTY = "metadata"; public UUID getUUID(); diff --git a/src/test/java/org/gcube/informationsystem/types/SerializationTest.java b/src/test/java/org/gcube/informationsystem/types/SerializationTest.java index a2fda5c..1c2f78f 100644 --- a/src/test/java/org/gcube/informationsystem/types/SerializationTest.java +++ b/src/test/java/org/gcube/informationsystem/types/SerializationTest.java @@ -206,7 +206,7 @@ public class SerializationTest { logger.debug("Version {}", typeVersion.toString()); logger.info(ElementMapper.marshal(propertyType)); - String json = "{\"@class\":\"PropertyType\",\"@metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"@class\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([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}$\",\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}"; + String json = "{\"@class\":\"PropertyType\",\"metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"@class\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([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}$\",\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}"; logger.info(json); @SuppressWarnings("unchecked") PropertyType metadataType = (PropertyType) TypeMapper.deserializeTypeDefinition(json);