- Type Parameters:
S- The type of the source resource.T- The type of the target entity.
- All Superinterfaces:
Element,ERElement,IdentifiableElement,ModelElement,RelationElement<S,,T> SchemaMixedElement,Serializable
- All Known Subinterfaces:
ConsistsOf<S,,T> IsRelatedTo<S,T>
- All Known Implementing Classes:
ConsistsOfImpl,DummyIsRelatedTo,IsRelatedToImpl,RelationImpl
@TypeMetadata(name="Relation",
description="This is the base type for any Relation",
version="1.0.0")
@Change(version="1.0.0",
description="First Version")
public interface Relation<S extends Resource,T extends Entity>
extends RelationElement<S,T>, SchemaMixedElement, ERElement
The base interface for all relations in the facet-based resource model.
A relation connects a source Resource to a target Entity and
can have its own properties. It supports schema-mixed mode for additional
attributes. For more details, refer to the
gCube Facet Based Resource Model Wiki.
- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the relation type.static final StringThe property name for the propagation constraint.Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, TYPE_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.ERElement
CONTEXTS_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.ModelElement
EXPECTED_TYPE_PROPERTY, SUPERTYPES_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
SOURCE_PROPERTY, TARGET_PROPERTY -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of all additional properties not defined in the schema.Retrieves a single additional property by its key.Returns the propagation constraint for this relation.Returns the source entity of the relation.Returns the target entity of the relation.voidsetAdditionalProperties(Map<String, Object> additionalProperties) Sets the map of additional properties for the element.voidsetAdditionalProperty(String key, Object value) Sets a single additional property.voidsetPropagationConstraint(PropagationConstraint propagationConstraint) Sets the propagation constraint for this relation.voidSets the source entity of the relation.voidSets the target entity of the relation.Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeNameMethods inherited from interface org.gcube.informationsystem.model.reference.ERElement
getContextsMethods inherited from interface org.gcube.informationsystem.model.reference.ModelElement
getExpectedtype, getSupertypesMethods inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
getID, getMetadata, setID, setMetadata
-
Field Details
-
NAME
The name of the relation type.- See Also:
-
PROPAGATION_CONSTRAINT_PROPERTY
The property name for the propagation constraint.- See Also:
-
-
Method Details
-
getSource
S getSource()Returns the source entity of the relation. -
setSource
Sets the source entity of the relation. -
getTarget
T getTarget()Returns the target entity of the relation. -
setTarget
Sets the target entity of the relation. -
getPropagationConstraint
Returns the propagation constraint for this relation.- Returns:
- The
PropagationConstraint.
-
setPropagationConstraint
Sets the propagation constraint for this relation.- Parameters:
propagationConstraint- ThePropagationConstraintto set.
-
getAdditionalProperties
Returns a map of all additional properties not defined in the schema.- Specified by:
getAdditionalPropertiesin interfaceSchemaMixedElement- Returns:
- A
Mapcontaining the additional properties, where the key is the property name and the value is the property value.
-
setAdditionalProperties
Sets the map of additional properties for the element.- Specified by:
setAdditionalPropertiesin interfaceSchemaMixedElement- Parameters:
additionalProperties- AMapof additional properties.
-
getAdditionalProperty
Retrieves a single additional property by its key.- Specified by:
getAdditionalPropertyin interfaceSchemaMixedElement- Parameters:
key- The name of the additional property to retrieve.- Returns:
- The value of the property, or
nullif the key is not found.
-
setAdditionalProperty
Sets a single additional property.- Specified by:
setAdditionalPropertyin interfaceSchemaMixedElement- Parameters:
key- The name of the additional property.value- The value of the additional property.
-