Repository: hydroshare/hydroshare

Issue:
Add "similarTo" to the list of relationship types for related resources
**Describe the feature you'd like and what it will do**
A clear and concise description of what you want to happen.

A data manager for one of the CZNet projects has requested that we add a new relationship type to the list of relationship types for adding related resources. Here is the term we need:

Term: similarTo
Human Readable: The content of this resource is similar to

Unfortunately, I don't think this term exists in the Dublin Core namespace, so we would probably have to use the hsterms namespace when encoding it in the resourcemetadata.xml document.

**Why is this feature important?**
A short description of the importance of this feature and what it will help you achieve.

CZNet data managers are wanting to express different types of relationships among the resources that they are sharing in HydroShare. "similarTo" implies that the described resource is similar to another resource that they have shared in HydroShare or elsewhere.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...].

Not related to a problem. This is a needed enhancement.

**Additional context**
Add any other context or screenshots about the feature request here.

The new term will appear in this drop down when adding related resources to a HydroShare resource:

![image](https://user-images.githubusercontent.com/3485902/172703559-305be0a5-585a-45c9-b5a2-337ea7d725d3.png)




Discussion:

Resolving patch:
diff --git a/hs_core/enums.py b/hs_core/enums.py
--- a/hs_core/enums.py
+++ b/hs_core/enums.py
@@ -20,3 +20,4 @@ class RelationTypes(str, enum.Enum):
     references = 'references'
     replaces = 'replaces'
     source = 'source'
+    isSimilarTo = 'isSimilarTo'
diff --git a/hs_core/migrations/0064_auto_20220620_1633.py b/hs_core/migrations/0064_auto_20220620_1633.py
new file mode 100644
--- /dev/null
+++ b/hs_core/migrations/0064_auto_20220620_1633.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.29 on 2022-06-20 16:33
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('hs_core', '0063_auto_20220601_2014'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='relation',
+            name='type',
+            field=models.CharField(choices=[('isPartOf', 'The content of this resource is part of'), ('hasPart', 'This resource includes'), ('isExecutedBy', 'The content of this resource can be executed by'), ('isCreatedBy', 'The content of this resource was created by a related App or software program'), ('isVersionOf', 'This resource updates and replaces a previous version'), ('isReplacedBy', 'This resource has been replaced by a newer version'), ('isDescribedBy', 'This resource is described by'), ('conformsTo', 'This resource conforms to established standard described by'), ('hasFormat', 'This resource has a related resource in another format'), ('isFormatOf', 'This resource is a different format of'), ('isRequiredBy', 'This resource is required by'), ('requires', 'This resource requires'), ('isReferencedBy', 'This resource is referenced by'), ('references', 'The content of this resource references'), ('replaces', 'This resource replaces'), ('source', 'The content of this resource is derived from'), ('isSimilarTo', 'The content of this resource is similar to')], max_length=100),
+        ),
+    ]
diff --git a/hs_core/models.py b/hs_core/models.py
--- a/hs_core/models.py
+++ b/hs_core/models.py
@@ -991,11 +991,13 @@ class Relation(AbstractMetaDataElement):
         (RelationTypes.isReferencedBy.value, 'This resource is referenced by'),
         (RelationTypes.references.value, 'The content of this resource references'),
         (RelationTypes.replaces.value, 'This resource replaces'),
-        (RelationTypes.source.value, 'The content of this resource is derived from')
+        (RelationTypes.source.value, 'The content of this resource is derived from'),
+        (RelationTypes.isSimilarTo.value, 'The content of this resource is similar to')
     )
 
     # these are hydroshare custom terms that are not Dublin Core terms
-    HS_RELATION_TERMS = (RelationTypes.isExecutedBy, RelationTypes.isCreatedBy, RelationTypes.isDescribedBy)
+    HS_RELATION_TERMS = (RelationTypes.isExecutedBy, RelationTypes.isCreatedBy, RelationTypes.isDescribedBy,
+                         RelationTypes.isSimilarTo)
     NOT_USER_EDITABLE = (RelationTypes.isVersionOf, RelationTypes.isReplacedBy,
                          RelationTypes.isPartOf, RelationTypes.hasPart, RelationTypes.replaces)
     term = 'Relation'


Test patch: