def _schema_nodes(self):
name, ext = os.path.splitext(self._ontology_file)<EOL>if ext in ['<STR_LIT>']:<EOL><INDENT>self._ontology_parser_function =lambda s: rdflib.Graph().parse(s, format='<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>self._ontology_parser_function =lambda s: pyRdfa().graph_from_source(s)<EOL><DEDENT>if not self._ontology_parser_function:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" %<EOL>self.errorstring_base)<EOL><DEDENT>if not self._ontology_file:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % self.errorstring_base)<EOL><DEDENT>if not self.lexicon:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % self.errorstring_base)<EOL><DEDENT>latest_file = self._read_schema()<EOL>try:<EOL><INDENT>self.graph = self._ontology_parser_function(latest_file)<EOL><DEDENT>except:<EOL><INDENT>raise IOError("<STR_LIT>" % latest_file)<EOL><DEDENT>for subj, pred, obj in self.graph:<EOL><INDENT>self.ontology[subj].append((pred, obj))<EOL>yield (subj, pred, obj)<EOL><DEDENT>
parse self._ontology_file into a graph