<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def triplify(self, data, parent=None):
 """ Recursively generate statements from the data supplied. """

        if data is None:
            return

        if self.is_object:
            for res in self._triplify_object(data, parent):
                yield res
        elif self.is_array:
            for item in data:
                for res in self.items.triplify(item, parent):
                    yield res
        else:
            # TODO: figure out if I ever want to check for reverse here.
            type_name = typecast.name(data)
            obj = typecast.stringify(type_name, data)
            if obj is not None:
                obj = obj.strip()
            yield (parent, self.predicate, obj, type_name)