2019-03-22 15:18:23 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.informationsystem.model.reference.relations;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
2023-04-27 16:30:10 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonInclude;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
2023-04-27 16:30:10 +02:00
|
|
|
import org.gcube.informationsystem.base.reference.Element;
|
|
|
|
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
2020-02-11 10:10:07 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.SchemaMixedElement;
|
2020-01-30 10:26:43 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.relations.RelationElement;
|
2021-02-05 11:32:37 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.ERElement;
|
2019-03-22 15:18:23 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.entities.Entity;
|
|
|
|
import org.gcube.informationsystem.model.reference.entities.Resource;
|
|
|
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
|
2023-02-03 14:39:25 +01:00
|
|
|
import org.gcube.informationsystem.serialization.AdditionalPropertiesSerializer;
|
2019-10-23 15:40:52 +02:00
|
|
|
import org.gcube.informationsystem.types.annotations.Abstract;
|
2019-03-22 15:18:23 +01:00
|
|
|
import org.gcube.informationsystem.types.annotations.ISProperty;
|
2020-12-15 11:28:34 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.Change;
|
|
|
|
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
2021-10-21 10:11:45 +02:00
|
|
|
import org.gcube.informationsystem.utils.Version;
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2021-01-20 17:03:02 +01:00
|
|
|
*
|
2021-01-20 17:26:13 +01:00
|
|
|
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Relation
|
2019-03-22 15:18:23 +01:00
|
|
|
*/
|
2019-10-23 15:40:52 +02:00
|
|
|
@Abstract
|
2023-05-04 18:08:30 +02:00
|
|
|
@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, Element.SUPERTYPES_PROPERTY, Element.EXPECTED_TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY, ERElement.CONTEXTS_PROPERTY, Relation.PROPAGATION_CONSTRAINT_PROPERTY })
|
2019-03-22 15:18:23 +01:00
|
|
|
// @JsonDeserialize(as=RelationImpl.class) Do not uncomment to manage subclasses
|
2023-01-20 11:22:52 +01:00
|
|
|
@TypeMetadata(name = Relation.NAME, description = "This is the base type for any Relation", version = Version.MINIMAL_VERSION_STRING)
|
2021-10-21 10:11:45 +02:00
|
|
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
2021-02-05 11:32:37 +01:00
|
|
|
public interface Relation<S extends Resource, T extends Entity> extends RelationElement<S,T>, SchemaMixedElement, ERElement {
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
public static final String NAME = "Relation"; //Relation.class.getSimpleName();
|
|
|
|
|
2023-04-20 10:27:01 +02:00
|
|
|
public static final String PROPAGATION_CONSTRAINT_PROPERTY = "propagationConstraint";
|
2019-10-23 16:55:48 +02:00
|
|
|
|
2023-04-27 16:30:10 +02:00
|
|
|
@JsonInclude(Include.NON_NULL)
|
2019-10-23 15:40:52 +02:00
|
|
|
@JsonIgnoreProperties({Resource.CONSISTS_OF_PROPERTY, Resource.IS_RELATED_TO_PROPERTY})
|
|
|
|
@JsonGetter(value = SOURCE_PROPERTY)
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-11-04 18:06:46 +01:00
|
|
|
public S getSource();
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
@JsonIgnore
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-11-04 18:06:46 +01:00
|
|
|
public void setSource(S source);
|
2019-03-22 15:18:23 +01:00
|
|
|
|
2019-10-23 15:40:52 +02:00
|
|
|
@JsonGetter(value = TARGET_PROPERTY)
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-11-04 18:06:46 +01:00
|
|
|
public T getTarget();
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
@JsonIgnore
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-11-04 18:06:46 +01:00
|
|
|
public void setTarget(T target);
|
2019-03-22 15:18:23 +01:00
|
|
|
|
2023-04-19 16:38:40 +02:00
|
|
|
@JsonGetter(value = PROPAGATION_CONSTRAINT_PROPERTY)
|
2021-01-13 21:53:16 +01:00
|
|
|
@ISProperty(name = PROPAGATION_CONSTRAINT_PROPERTY)
|
2019-03-22 15:18:23 +01:00
|
|
|
public PropagationConstraint getPropagationConstraint();
|
|
|
|
|
|
|
|
@JsonAnyGetter
|
|
|
|
@JsonSerialize(using = AdditionalPropertiesSerializer.class)
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-10-23 15:40:52 +02:00
|
|
|
public Map<String,Object> getAdditionalProperties();
|
|
|
|
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-10-23 15:40:52 +02:00
|
|
|
public void setAdditionalProperties(Map<String,Object> additionalProperties);
|
|
|
|
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-03-22 15:18:23 +01:00
|
|
|
public Object getAdditionalProperty(String key);
|
|
|
|
|
|
|
|
@JsonAnySetter
|
2020-02-11 10:10:07 +01:00
|
|
|
@Override
|
2019-03-22 15:18:23 +01:00
|
|
|
public void setAdditionalProperty(String key, Object value);
|
|
|
|
|
|
|
|
}
|