def add_file_dependencies_helper(self, doc_file):
subj_triples = list(self.graph.triples((None, self.spdx_namespace.fileName, Literal(doc_file.name))))<EOL>if len(subj_triples) != <NUM_LIT:1>:<EOL><INDENT>raise InvalidDocumentError('<STR_LIT>'.format(doc_file.name))<EOL><DEDENT>subject_node = subj_triples[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>for dependency in doc_file.dependencies:<EOL><INDENT>dep_triples = list(self.graph.triples((None, self.spdx_namespace.fileName, Literal(dependency))))<EOL>if len(dep_triples) == <NUM_LIT:1>:<EOL><INDENT>dep_node = dep_triples[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>dep_triple = (subject_node, self.spdx_namespace.fileDependency, dep_node)<EOL>self.graph.add(dep_triple)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>'.format(doc_file.name, dependency))<EOL><DEDENT><DEDENT>
Handle dependencies for a single file.
- doc_file - instance of spdx.file.File.