code: def convert_value_to_es(value, ranges, obj, method=None):
      
  
      def sub_convert(val):
          """
          Returns the json value for a simple datatype or the subject uri if the
          value is a rdfclass
  
          args:
              val: the value to convert
          """
          if isinstance(val, BaseRdfDataType):
              return val.to_json
          elif isinstance(value, __MODULE__.rdfclass.RdfClassBase):
              return val.subject.sparql_uri
          return val
  
      if method == "missing_obj":
          rtn_obj = {
              "rdf_type": [rng.sparql_uri for rng in ranges], # pylint: disable=no-member
              "label": [getattr(obj, label)[0] \
                       for label in LABEL_FIELDS \
                       if hasattr(obj, label)][0]}
          try:
              rtn_obj['uri'] = value.sparql_uri
              rtn_obj["rdfs_label"] = NSM.nouri(value.sparql_uri)
          except AttributeError:
              rtn_obj['uri'] = "None Specified"
              rtn_obj['rdfs_label'] = sub_convert(value)
          rtn_obj['value'] = rtn_obj['rdfs_label']
          return rtn_obj
      return sub_convert(value)
docs: Takes an value and converts it to an elasticsearch representation
  
      args:
          value: the value to convert
          ranges: the list of ranges
          method: convertion method to use
                  'None': default -> converts the value to its json value
                  'missing_obj': adds attributes as if the value should have
                                 been a rdfclass object