Example #1
0
    def _run(self):
        """
        Runs the build process and produces a compiled OWL ontology file.
        """
        # Get the imports modules IRIs from the imports build target.
        importinfos = self.ibt.getImportsInfo()

        self._retrieveAndCheckFilePaths()

        baseont = Ontology(self.base_ont_path)
        # Add an import declaration for each import module.
        for importinfo in importinfos:
            baseont.addImport(importinfo.iristr, True)

        # Write the base ontology to the output file.
        fileoutpath = self.getOutputFilePath()
        logger.info('Writing updated base ontology to ' + fileoutpath + '...')
        baseont.saveOntology(fileoutpath)