def p_file_type(self, f_term, predicate):
try:<EOL><INDENT>for _, _, ftype in self.graph.triples((f_term, predicate, None)):<EOL><INDENT>try:<EOL><INDENT>if ftype.endswith('<STR_LIT>'):<EOL><INDENT>ftype = '<STR_LIT>'<EOL><DEDENT>elif ftype.endswith('<STR_LIT:source>'):<EOL><INDENT>ftype = '<STR_LIT>'<EOL><DEDENT>elif ftype.endswith('<STR_LIT>'):<EOL><INDENT>ftype = '<STR_LIT>'<EOL><DEDENT>elif ftype.endswith('<STR_LIT>'):<EOL><INDENT>ftype = '<STR_LIT>'<EOL><DEDENT>self.builder.set_file_type(self.doc, ftype)<EOL><DEDENT>except SPDXValueError:<EOL><INDENT>self.value_error('<STR_LIT>', ftype)<EOL><DEDENT><DEDENT><DEDENT>except CardinalityError:<EOL><INDENT>self.more_than_one_error('<STR_LIT>')<EOL><DEDENT>
Sets file type.