def triplify(self, data, parent=None):
if data is None:<EOL><INDENT>return<EOL><DEDENT>if self.is_object:<EOL><INDENT>for res in self._triplify_object(data, parent):<EOL><INDENT>yield res<EOL><DEDENT><DEDENT>elif self.is_array:<EOL><INDENT>for item in data:<EOL><INDENT>for res in self.items.triplify(item, parent):<EOL><INDENT>yield res<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>type_name = typecast.name(data)<EOL>obj = typecast.stringify(type_name, data)<EOL>if obj is not None:<EOL><INDENT>obj = obj.strip()<EOL><DEDENT>yield (parent, self.predicate, obj, type_name)<EOL><DEDENT>
Recursively generate statements from the data supplied.