diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/RelationshipTypeBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/RelationshipTypeBusinessLogic.java
index 9a83566..195e43d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/RelationshipTypeBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/RelationshipTypeBusinessLogic.java
@@ -39,9 +39,9 @@
         this.componentsUtils = componentsUtils;
     }
 
-    public Either<Map<String, RelationshipTypeDefinition>, ResponseFormat> getAllRelationshipTypes() {
+    public Either<Map<String, RelationshipTypeDefinition>, ResponseFormat> getAllRelationshipTypes(final String model) {
         Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> allRelationshipTypes = relationshipTypeOperation
-            .getAllRelationshipTypes();
+            .getAllRelationshipTypes(model);
         if (allRelationshipTypes.isRight()) {
             JanusGraphOperationStatus operationStatus = allRelationshipTypes.right().value();
             if (JanusGraphOperationStatus.NOT_FOUND == operationStatus) {
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
index 6fbdbaf..cafcbfd 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/TypesFetchServlet.java
@@ -22,6 +22,7 @@
 import com.jcabi.aspects.Loggable;
 import fj.data.Either;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.media.ArraySchema;
 import io.swagger.v3.oas.annotations.media.Content;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -42,10 +43,12 @@
 import javax.ws.rs.HeaderParam;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import org.apache.commons.collections4.ListUtils;
+import org.glassfish.jersey.media.multipart.FormDataParam;
 import org.openecomp.sdc.be.components.impl.CapabilitiesBusinessLogic;
 import org.openecomp.sdc.be.components.impl.ComponentBusinessLogic;
 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
@@ -223,7 +226,8 @@
         @ApiResponse(responseCode = "404", description = "Relationship types not found")})
     @PermissionAllowed(AafPermission.PermNames.INTERNAL_ALL_VALUE)
     public Response getAllRelationshipTypesServlet(@Context final HttpServletRequest request,
-                                                   @HeaderParam(value = Constants.USER_ID_HEADER) String userId) {
+                                                   @HeaderParam(value = Constants.USER_ID_HEADER) String userId,
+                                                   @Parameter(description = "model", required = false) @QueryParam("model") String modelName) {
         Wrapper<Response> responseWrapper = new Wrapper<>();
         Wrapper<User> userWrapper = new Wrapper<>();
         try {
@@ -233,7 +237,7 @@
                 String url = request.getMethod() + " " + request.getRequestURI();
                 log.debug("Start handle request of {} | modifier id is {}", url, userId);
                 Either<Map<String, RelationshipTypeDefinition>, ResponseFormat> allDataTypes = relationshipTypeBusinessLogic
-                    .getAllRelationshipTypes();
+                    .getAllRelationshipTypes(modelName);
                 if (allDataTypes.isRight()) {
                     log.info("Failed to get all relationship types. Reason - {}", allDataTypes.right().value());
                     Response errorResponse = buildErrorResponse(allDataTypes.right().value());
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/janusgraph/JanusGraphGenericDao.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/janusgraph/JanusGraphGenericDao.java
index c6ad5f2..b2492cd 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/janusgraph/JanusGraphGenericDao.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/janusgraph/JanusGraphGenericDao.java
@@ -805,10 +805,47 @@
 
     public <T extends GraphNode> Either<List<T>, JanusGraphOperationStatus> getByCriteria(NodeTypeEnum type, Map<String, Object> props,
                                                                                           Class<T> clazz) {
-        Either<JanusGraph, JanusGraphOperationStatus> graph = janusGraphClient.getGraph();
+        return getByCriteriaForModel(type, props, null, clazz);
+    }
+    
+    public <T extends GraphNode> Either<List<T>, JanusGraphOperationStatus> getByCriteriaForModel(final NodeTypeEnum type, final Map<String, Object> props,
+            final String model, final Class<T> clazz) {
+        try {
+            final Either<Iterable<JanusGraphVertex>, JanusGraphOperationStatus> vertices = getVerticesByCriteria(type, props);
+            
+            if (vertices.isLeft()) {
+                final Predicate<? super JanusGraphVertex> filterPredicate = StringUtils.isEmpty(model) ? this::vertexNotConnectedToAnyModel : vertex -> vertexValidForModel(vertex, model);
+                final List<JanusGraphVertex> verticesForModel = StreamSupport.stream(vertices.left().value().spliterator(), false).filter(filterPredicate).collect(Collectors.toList());
+            
+                if (CollectionUtils.isEmpty(verticesForModel)) {
+                    log.debug("No vertex in graph for props ={} ", props);
+                    return Either.right(JanusGraphOperationStatus.NOT_FOUND);
+                }
+  
+                final Iterator<JanusGraphVertex> iterator = verticesForModel.iterator();
+                final List<T> result = new ArrayList<>();
+                while (iterator.hasNext()) {
+                    Vertex vertex = iterator.next();
+                    Map<String, Object> newProp = getProperties(vertex);
+                    T element = GraphElementFactory.createElement(type.getName(), GraphElementTypeEnum.Node, newProp, clazz);
+                    result.add(element);
+                }
+                log.debug("Number of fetced nodes in graph for criteria : from type = {} and properties = {} is {}", type, props, result.size());
+                return Either.left(result);
+
+            }
+            return Either.right(vertices.right().value());
+        } catch (Exception e) {
+            log.debug("Failed  get by  criteria for type = {} and properties = {}", type, props, e);
+            return Either.right(JanusGraphClient.handleJanusGraphException(e));
+        }
+    }
+    
+    private Either<Iterable<JanusGraphVertex>, JanusGraphOperationStatus> getVerticesByCriteria(final NodeTypeEnum type, final Map<String, Object> props) {
+        final Either<JanusGraph, JanusGraphOperationStatus> graph = janusGraphClient.getGraph();
         if (graph.isLeft()) {
             try {
-                JanusGraph tGraph = graph.left().value();
+                final JanusGraph tGraph = graph.left().value();
                 JanusGraphQuery<? extends JanusGraphQuery> query = tGraph.query();
                 query = query.has(GraphPropertiesDictionary.LABEL.getProperty(), type.getName());
                 if (props != null && !props.isEmpty()) {
@@ -816,25 +853,11 @@
                         query = query.has(entry.getKey(), entry.getValue());
                     }
                 }
-                Iterable<JanusGraphVertex> vertices = query.vertices();
-                if (vertices == null) {
+                final Iterable<JanusGraphVertex> vertices = query.vertices();
+                if (vertices == null || !vertices.iterator().hasNext()) {
                     return Either.right(JanusGraphOperationStatus.NOT_FOUND);
                 }
-                Iterator<JanusGraphVertex> iterator = vertices.iterator();
-                List<T> result = new ArrayList<>();
-                while (iterator.hasNext()) {
-                    Vertex vertex = iterator.next();
-                    Map<String, Object> newProp = getProperties(vertex);
-                    T element = GraphElementFactory.createElement(type.getName(), GraphElementTypeEnum.Node, newProp, clazz);
-                    result.add(element);
-                }
-                if (log.isDebugEnabled()) {
-                    log.debug("Number of fetced nodes in graph for criteria : from type = {} and properties = {} is {}", type, props, result.size());
-                }
-                if (result.size() == 0) {
-                    return Either.right(JanusGraphOperationStatus.NOT_FOUND);
-                }
-                return Either.left(result);
+                return Either.left(vertices);
             } catch (Exception e) {
                 if (log.isDebugEnabled()) {
                     log.debug("Failed  get by  criteria for type = {} and properties = {}", type, props, e);
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
index f02fc2d..1b3fee9 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperation.java
@@ -20,8 +20,6 @@
 package org.openecomp.sdc.be.model.operations.impl;
 
 import static org.openecomp.sdc.common.log.enums.EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR;
-
-import fj.data.Either;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -47,6 +45,7 @@
 import org.openecomp.sdc.common.log.wrappers.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import fj.data.Either;
 
 @Component("relationship-type-operation")
 public class RelationshipTypeOperation extends AbstractOperation {
@@ -72,7 +71,7 @@
         return getRelationshipTypeDefinition(relationshipTypesRes.left().value());
     }
     
-    public Either<RelationshipTypeDefinition, JanusGraphOperationStatus> getRelationshipTypeDefinition(final RelationshipTypeData relationshipTypeData) {
+    private Either<RelationshipTypeDefinition, JanusGraphOperationStatus> getRelationshipTypeDefinition(final RelationshipTypeData relationshipTypeData) {
         RelationshipTypeDefinition relationshipTypeDefinition = new RelationshipTypeDefinition(
             relationshipTypeData.getRelationshipTypeDataDefinition());
         Either<Map<String, PropertyDefinition>, JanusGraphOperationStatus> propertiesStatus = OperationUtils
@@ -364,11 +363,11 @@
             DaoStatusConverter::convertJanusGraphStatusToStorageStatus);
     }
 
-    public Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> getAllRelationshipTypes() {
+    public Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> getAllRelationshipTypes(final String model) {
         Map<String, RelationshipTypeDefinition> relationshipTypeDefinitionMap = new HashMap<>();
         Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> result = Either.left(relationshipTypeDefinitionMap);
         Either<List<RelationshipTypeData>, JanusGraphOperationStatus> getAllRelationshipTypes = janusGraphGenericDao
-            .getByCriteria(NodeTypeEnum.RelationshipType, null, RelationshipTypeData.class);
+            .getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, model, RelationshipTypeData.class);
         if (getAllRelationshipTypes.isRight()) {
             JanusGraphOperationStatus status = getAllRelationshipTypes.right().value();
             if (status != JanusGraphOperationStatus.NOT_FOUND) {
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperationTest.java
index 1cc1336..6551a13 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperationTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/RelationshipTypeOperationTest.java
@@ -32,6 +32,7 @@
 import java.util.Map.Entry;
 
 import fj.data.Either;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.junit.Before;
@@ -155,9 +156,9 @@
     @Test
     public void testGetAllRelationshipTypesNotFound() {
         Mockito.doReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND)).when(
-            janusGraphGenericDao).getByCriteria(NodeTypeEnum.RelationshipType, null,
+            janusGraphGenericDao).getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, null,
                 RelationshipTypeData.class);
-        Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> either = relationshipTypeOperation.getAllRelationshipTypes();
+        Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> either = relationshipTypeOperation.getAllRelationshipTypes(null);
 
         assertTrue(either.isLeft() && MapUtils.isEmpty(either.left().value()));
     }
@@ -165,9 +166,9 @@
     @Test
     public void testGetAllRelationshipTypesNotConnnected() {
         Mockito.doReturn(Either.right(JanusGraphOperationStatus.NOT_CONNECTED)).when(
-            janusGraphGenericDao).getByCriteria(NodeTypeEnum.RelationshipType, null,
+            janusGraphGenericDao).getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, null,
                 RelationshipTypeData.class);
-        Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> either = relationshipTypeOperation.getAllRelationshipTypes();
+        Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> either = relationshipTypeOperation.getAllRelationshipTypes(null);
 
         assertTrue(either.isRight() && JanusGraphOperationStatus.NOT_CONNECTED == either.right().value());
     }
@@ -185,7 +186,7 @@
         relationshipTypeDataList.add(relationshipTypeData1);
 
         Mockito.doReturn(Either.left(relationshipTypeDataList))
-                .when(janusGraphGenericDao).getByCriteria(NodeTypeEnum.RelationshipType, null,
+                .when(janusGraphGenericDao).getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, null,
                 RelationshipTypeData.class);
 
         Mockito.doReturn(Either.left(relationshipTypeData1)).when(janusGraphGenericDao)
@@ -203,11 +204,18 @@
                 .getDerivedFromChild("tosca.relationships.Root1", NodeTypeEnum.RelationshipType, RelationshipTypeData.class);
 
         Either<Map<String, RelationshipTypeDefinition>, JanusGraphOperationStatus> either =
-                                            relationshipTypeOperation.getAllRelationshipTypes();
+                                            relationshipTypeOperation.getAllRelationshipTypes(null);
 
         assertTrue(either.isLeft());
         RelationshipTypeDefinition relationshipTypeDefinition = either.left().value().get("tosca.relationships.Root1");
         assertEquals("tosca.relationships.Parent", relationshipTypeDefinition.getDerivedFrom());
+        
+        Mockito.doReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND))
+            .when(janusGraphGenericDao).getByCriteriaForModel(NodeTypeEnum.RelationshipType, null, "modelA",
+        RelationshipTypeData.class);        
+        either = relationshipTypeOperation.getAllRelationshipTypes("modelA");
+        assertTrue(either.isLeft());
+        assertTrue(MapUtils.isEmpty(either.left().value()));
     }
 
     public RelationshipTypeDefinition createRelationship(String relationshipTypeName) {
diff --git a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
index 470aac7..f9b98c6 100644
--- a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
+++ b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
@@ -52,7 +52,7 @@
         if (initInputsFor === 'INPUTS_FOR_REQUIREMENTS') {
             if (!this.requirementsListUpdated){
                 this.relationshipTypesList = [];
-                let relationshipTypesResult = await this.toscaTypesServiceNg2.fetchRelationshipTypes();
+                let relationshipTypesResult = await this.toscaTypesServiceNg2.fetchRelationshipTypes(this.workspaceService.metadata.model);
                 Object.keys(relationshipTypesResult).forEach(key => {this.relationshipTypesList.push(relationshipTypesResult[key])});
                 this.requirementsListUpdated = true;
             }
diff --git a/catalog-ui/src/app/ng2/services/tosca-types.service.ts b/catalog-ui/src/app/ng2/services/tosca-types.service.ts
index 83b833b..2fc2e7a 100644
--- a/catalog-ui/src/app/ng2/services/tosca-types.service.ts
+++ b/catalog-ui/src/app/ng2/services/tosca-types.service.ts
@@ -14,18 +14,18 @@
  * permissions and limitations under the License.
  */
 
-import { HttpClient } from '@angular/common/http';
-import { Inject, Injectable } from '@angular/core';
-import { Response } from '@angular/http';
+import {HttpClient} from '@angular/common/http';
+import {Inject, Injectable} from '@angular/core';
+import {Response} from '@angular/http';
 import {
-    CapabilityTypeModel,
-    CapabilityTypesMap,
-    IComponentsArray,
-    NodeTypesMap,
-    RelationshipTypesMap
+  CapabilityTypeModel,
+  CapabilityTypesMap,
+  IComponentsArray,
+  NodeTypesMap,
+  RelationshipTypesMap
 } from 'app/models';
-import { Observable } from 'rxjs/Observable';
-import { ISdcConfig, SdcConfigToken } from '../config/sdc-config.config';
+import {Observable} from 'rxjs/Observable';
+import {ISdcConfig, SdcConfigToken} from '../config/sdc-config.config';
 import 'rxjs/add/operator/toPromise';
 
 declare var angular: angular.IAngularStatic;
@@ -33,22 +33,22 @@
 @Injectable()
 export class ToscaTypesServiceNg2 {
 
-    protected baseUrl;
+  protected baseUrl;
 
-    constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
-        this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root;
-    }
+  constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
+    this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root;
+  }
 
-    async fetchRelationshipTypes(): Promise<RelationshipTypesMap> {
-        return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes').toPromise();
-    }
+  async fetchRelationshipTypes(modelName: string): Promise<RelationshipTypesMap> {
+    return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes', {params: {model: modelName}}).toPromise();
+  }
 
-    async fetchNodeTypes(): Promise<NodeTypesMap> {
-        return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise();
-    }
+  async fetchNodeTypes(): Promise<NodeTypesMap> {
+    return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise();
+  }
 
-    async fetchCapabilityTypes(): Promise<CapabilityTypesMap>{
-        return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise();
-    }
+  async fetchCapabilityTypes(): Promise<CapabilityTypesMap> {
+    return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise();
+  }
 }
 
