from abc import abstractmethod, ABCMeta
from owlapy.model import OWLObject
[docs]class OWLObjectRenderer(metaclass=ABCMeta):
"""Abstract class with a render method to render an OWL Object into a string"""
[docs] @abstractmethod
def render(self, o: OWLObject) -> str:
"""Render OWL Object to string
Args:
o: OWL Object
Returns:
String rendition of OWL object
"""
pass
[docs]class OWLObjectParser(metaclass=ABCMeta):
"""Abstract class with a parse method to parse a string to an OWL Object"""
[docs] @abstractmethod
def parse_expression(self, expression_str: str) -> OWLObject:
"""Parse a string to an OWL Object
Args:
expression_str: string
Returns:
The OWL Object which is represented by the string
"""
pass