Skip to content

Commit

Permalink
Added docstrings for owl classes + refactoring part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci committed Apr 12, 2024
1 parent 787bdef commit d5dcd65
Show file tree
Hide file tree
Showing 8 changed files with 663 additions and 323 deletions.
10 changes: 8 additions & 2 deletions owlapy/class_expression/class_expression.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from abc import abstractmethod, ABCMeta
from ..data_ranges import OWLPropertyRange, OWLDataRange
from ..data_ranges import OWLPropertyRange
from ..meta_classes import HasOperands

from typing import Final, Iterable


class OWLClassExpression(OWLPropertyRange):
"""An OWL 2 Class Expression (https://www.w3.org/TR/owl2-syntax/#Class_Expressions) """
"""OWL Class expressions represent sets of individuals by formally specifying conditions on the individuals' properties;
individuals satisfying these conditions are said to be instances of the respective class expressions.
In the structural specification of OWL 2, class expressions are represented by ClassExpression.
(https://www.w3.org/TR/owl2-syntax/#Class_Expressions)
"""
__slots__ = ()

@abstractmethod
Expand Down
14 changes: 10 additions & 4 deletions owlapy/class_expression/nary_boolean_expression.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .class_expression import OWLClassExpression, OWLBooleanClassExpression
from ..meta_classes import HasOperands
from typing import Final, Sequence, Iterable


class OWLNaryBooleanClassExpression(OWLBooleanClassExpression, HasOperands[OWLClassExpression]):
"""OWLNaryBooleanClassExpression."""
__slots__ = ()
Expand Down Expand Up @@ -30,18 +32,22 @@ def __hash__(self):
return hash(self._operands)




class OWLObjectUnionOf(OWLNaryBooleanClassExpression):
"""Represents an ObjectUnionOf class expression in the OWL 2 Specification."""
"""A union class expression ObjectUnionOf( CE1 ... CEn ) contains all individuals that are instances
of at least one class expression CEi for 1 ≤ i ≤ n.
(https://www.w3.org/TR/owl2-syntax/#Union_of_Class_Expressions)
"""
__slots__ = '_operands'
type_index: Final = 3002

_operands: Sequence[OWLClassExpression]


class OWLObjectIntersectionOf(OWLNaryBooleanClassExpression):
"""Represents an OWLObjectIntersectionOf class expression in the OWL 2 Specification."""
"""An intersection class expression ObjectIntersectionOf( CE1 ... CEn ) contains all individuals that are instances
of all class expressions CEi for 1 ≤ i ≤ n.
(https://www.w3.org/TR/owl2-syntax/#Intersection_of_Class_Expressions)
"""
__slots__ = '_operands'
type_index: Final = 3001

Expand Down
5 changes: 3 additions & 2 deletions owlapy/class_expression/owl_class.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from .class_expression import OWLClassExpression, OWLObjectComplementOf
from ..owlobject import OWLObject, OWLEntity
from ..owlobject import OWLEntity
from typing import Final, Union
from ..iri import IRI


class OWLClass(OWLClassExpression, OWLEntity):
"""An OWL 2 named Class"""
"""An OWL 2 named Class. Classes can be understood as sets of individuals.
(https://www.w3.org/TR/owl2-syntax/#Classes)"""
__slots__ = '_iri', '_is_nothing', '_is_thing'
type_index: Final = 1001

Expand Down
Loading

0 comments on commit d5dcd65

Please sign in to comment.