Refactor of OWL entity conversion and extraction