docstr: Check if input mentions has the given relation between them
  
  Args:
      mention_x: MentionDataLight
      mention_y: MentionDataLight
      relation: RelationType
  
  Returns:
      RelationType: relation in case mentions has given relation or
          RelationType.NO_RELATION_FOUND otherwise
docstr_tok: ["Check","if","input","mentions","has","the","given","relation","between","them","Args",":","mention_x",":","MentionDataLight","mention_y",":","MentionDataLight","relation",":","RelationType","Returns",":","RelationType",":","relation","in","case","mentions","has","given","relation","or","RelationType.NO_RELATION_FOUND","otherwise"]
code: def extract_sub_relations(
      self,
      mention_x: MentionDataLight,
      mention_y: MentionDataLight,
      relation: RelationType,
  ) -> RelationType:
      """
      Check if input mentions has the given relation between them
  
      Args:
          mention_x: MentionDataLight
          mention_y: MentionDataLight
          relation: RelationType
  
      Returns:
          RelationType: relation in case mentions has given relation or
              RelationType.NO_RELATION_FOUND otherwise
      """
      mention1_str = mention_x.tokens_str.strip()
      mention2_str = mention_y.tokens_str.strip()
  
      if self.filter_pronouns:
          if self.is_both_opposite_personal_pronouns(
              mention1_str, mention2_str
          ):
              return RelationType.NO_RELATION_FOUND
  
      if self.filter_time_data:
          if self.is_both_data_or_time(mention_x, mention_y):
              return RelationType.NO_RELATION_FOUND
  
      pages1 = self.get_phrase_related_pages(mention1_str)
      pages2 = self.get_phrase_related_pages(mention2_str)
  
      # check if search phrase is empty meaning it is probably a stop word
      if pages1.is_empty_norm_phrase or pages2.is_empty_norm_phrase:
          return RelationType.NO_RELATION_FOUND
  
      if relation == RelationType.WIKIPEDIA_REDIRECT_LINK:
          if self.is_redirect_same(pages1, pages2):
              return RelationType.WIKIPEDIA_REDIRECT_LINK
  
          return RelationType.NO_RELATION_FOUND
  
      titles1 = pages1.get_and_set_titles()
      titles1.add(mention1_str + " " + mention2_str)
      titles1.add(mention2_str + " " + mention1_str)
  
      titles2 = pages2.get_and_set_titles()
      titles2.add(mention1_str + " " + mention2_str)
      titles2.add(mention2_str + " " + mention1_str)
  
      if relation == RelationType.WIKIPEDIA_ALIASES:
          return self.extract_aliases(pages1, pages2, titles1, titles2)
      if relation == RelationType.WIKIPEDIA_DISAMBIGUATION:
          return self.extract_disambig(pages1, pages2, titles1, titles2)
      if relation == RelationType.WIKIPEDIA_CATEGORY:
          return self.extract_category(pages1, pages2, titles1, titles2)
      if relation == RelationType.WIKIPEDIA_TITLE_PARENTHESIS:
          return self.extract_parenthesis(
              pages1, pages2, titles1, titles2
          )
      if relation == RelationType.WIKIPEDIA_BE_COMP:
          return self.extract_be_comp(pages1, pages2, titles1, titles2)
  
      return RelationType.NO_RELATION_FOUND
  
imports: from __future__ import division
  import logging
  import os
  from typing import Set, List
  from nlp_architect.common.cdc.mention_data import MentionDataLight
  from nlp_architect.data.cdc_resources.data_types.wiki.wikipedia_pages import WikipediaPages
  from nlp_architect.data.cdc_resources.relations.relation_extraction import RelationExtraction
  from nlp_architect.data.cdc_resources.relations.relation_types_enums import RelationType, WikipediaSearchMethod
  from nlp_architect.data.cdc_resources.wikipedia.wiki_elastic import WikiElastic
  from nlp_architect.data.cdc_resources.wikipedia.wiki_offline import WikiOffline
  from nlp_architect.data.cdc_resources.wikipedia.wiki_online import WikiOnline
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 4 for calling the WikipediaRelationExtraction obj's underlying member method code with example usage: obj.extract_sub_relations(mention_x, mention_y, relation) and returns: RelationType, RelationType, RelationType, self, self, self, self, self, RelationType, RelationType, RelationType