Skip to content

Commit

Permalink
Merge branch 'develop' into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alkidbaci authored Apr 8, 2024
2 parents fdd3fea + d48c918 commit c94532b
Show file tree
Hide file tree
Showing 15 changed files with 608 additions and 632 deletions.
63 changes: 63 additions & 0 deletions owlapy/has.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from typing import Protocol, ClassVar, TypeVar, Generic, Iterable
from abc import ABCMeta, abstractmethod
_T = TypeVar('_T') #:

class HasIndex(Protocol):
"""Interface for types with an index; this is used to group objects by type when sorting."""
type_index: ClassVar[int] #: index for this type. This is a sorting index for the types.

def __eq__(self, other): ...


class HasIRI(metaclass=ABCMeta):
"""Simple class to access the IRI."""
__slots__ = ()

@abstractmethod
def get_iri(self) -> 'IRI':
"""Gets the IRI of this object.
Returns:
The IRI of this object.
"""
pass


class HasOperands(Generic[_T], metaclass=ABCMeta):
"""An interface to objects that have a collection of operands.
Args:
_T: Operand type.
"""
__slots__ = ()

@abstractmethod
def operands(self) -> Iterable[_T]:
"""Gets the operands - e.g., the individuals in a sameAs axiom, or the classes in an equivalent
classes axiom.
Returns:
The operands.
"""
pass



class HasFiller(Generic[_T], metaclass=ABCMeta):
"""An interface to objects that have a filler.
Args:
_T: Filler type.
"""
__slots__ = ()

@abstractmethod
def get_filler(self) -> _T:
"""Gets the filler for this restriction. In the case of an object restriction this will be an individual, in
the case of a data restriction this will be a constant (data value). For quantified restriction this will be
a class expression or a data range.
Returns:
the value
"""
pass
43 changes: 0 additions & 43 deletions owlapy/io.py

This file was deleted.

16 changes: 1 addition & 15 deletions owlapy/model/_iri.py → owlapy/iri.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,10 @@
from weakref import WeakKeyDictionary

from owlapy import namespaces
from owlapy.model._base import OWLAnnotationSubject, OWLAnnotationValue
from .owl_annotation import OWLAnnotationSubject, OWLAnnotationValue
from owlapy.namespaces import Namespaces


class HasIRI(metaclass=ABCMeta):
"""Simple class to access the IRI."""
__slots__ = ()

@abstractmethod
def get_iri(self) -> 'IRI':
"""Gets the IRI of this object.
Returns:
The IRI of this object.
"""
pass


class _WeakCached(type):
__slots__ = ()

Expand Down
Loading

0 comments on commit c94532b

Please sign in to comment.