A Python API of OntoSeer, It is standalone class based version of Ontoseer plugin used in Protegé
Use this repo as package and use all feature from class as module and function.
-
Clone the repo
git clone https://github.com/kracr/ontoseer-api
-
Create conda or venv environment with python>=3.10
-
Install packages
pip install -r requirements.txt
ontoseer_api/
├─ main/
│ ├─ ontoseer_main.py
│ ├─ repository/
│ ├─ axiom_recommendation_list.py
│ ├─ odp_list.py
│ ├─ vocab_recommendation.py
├─ owl_files/
├─ unittest/
├─ .gitignore
├─ README.md
-
Import repo as packing in python file.
from ontoseer_api.main import Ontoseer
-
Initialise object with ontology filename, filename can be relative
obj = Ontoseer("example_ontology.owl")
-
With the obj use function related to ontology file, for example
obj.getClassName() obj.getPropertyName()
class ontoseer take filename to initialize obj and it contain following methods
-
getClassName() -> list[str]
List all class name present in the ontology file. -
getPropertyName() -> list[str]
List all property name present in the ontology file -
getClassNameRecommendation(name: str) -> list[str]
Naming convention for class name in ontology file -
getPropertyNameRecommendation(name: str) -> list[str] Naming convention for property name in ontology file
-
getVocabRecommendation(self, name: str) -> list[str]
Search vocab from vocab repository -
getAxiomRecommendation(self, name: str) -> list[str]
Axiom recommendation from class or property from owl file -
getOntologyDesignPattern(self, class_name: str, answers: list[str]) -> list[str]
Ontology design validation from class or property from owl file- class_name: If it none then classes from ontology file wiil be used.
- answer: answer will be always of 3 length where each element should be of str type, "" will be treated as None and each element represant following with order:
- Description of ontology.
- Domain of ontology.
- Compepentancy questions related to it.
-
getClassHierarchyValidation(self, answers: list[str]) -> list[str] Class hierarchy validation from class or property from owl file
- answer: answer will be always of 4 length where each element should be of str type with choice either 'y' or 'n', each element represent following question with following order:
- Do the properties of superclass cease to exist in the future (temporal dependency)?
- Do the properties of the sub class cease to exist in the future? (temporal dependency)?
- Are the properties of super-class and subclass identical?
- Are the properties of subclass part of the properties whole class?
- answer: answer will be always of 4 length where each element should be of str type with choice either 'y' or 'n', each element represent following question with following order: