<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_tag_query(self, sampler, wmi_obj, tag_query):
 """ Format `tag_query` or raise on incorrect parameters. """

        try:
            link_source_property = int(wmi_obj[tag_query[0]])
            target_class = tag_query[1]
            link_target_class_property = tag_query[2]
            target_property = tag_query[3]
        except IndexError:
            self.log.error(
                u"Wrong `tag_queries` parameter format. " "Please refer to the configuration file for more information."
            )
            raise
        except TypeError:
            self.log.error(
                u"Incorrect 'link source property' in `tag_queries` parameter:"
                " `{wmi_property}` is not a property of `{wmi_class}`".format(
                    wmi_property=tag_query[0], wmi_class=sampler.class_name
                )
            )
            raise

        return (target_class, target_property, [{link_target_class_property: link_source_property}])