fuzzy_dl_owl2.fuzzydl.concept.interface.has_concepts_interface
An abstract base class that defines a standard interface for objects requiring a mutable collection of concepts.
Description
Designed to serve as a foundational component for various structures within the fuzzy description logic system, the class enforces a consistent pattern for handling groups of conceptual entities. By accepting any iterable of concepts during initialization, the implementation automatically converts the input into a concrete list, ensuring that the internal state is decoupled from the original source and stored in a mutable sequence. Access to the underlying collection is managed through a property interface, which allows derived classes to retrieve the current list of concepts or replace it entirely with a new collection. This design standardizes how different components store and manipulate concept data, promoting code reuse and ensuring that all derived classes handle concept collections in a uniform manner.
Classes
This abstract base class serves as a foundational component for objects that manage a collection of concepts, providing a concrete implementation for storage and access. It initializes with an iterable of concepts and exposes a property that allows for both retrieval and dynamic modification of the underlying list. By handling the conversion of input iterables to a list, it ensures a consistent internal state for subclasses that need to track or represent multiple conceptual entities. |
Module Contents
UML Class Diagram for HasConceptsInterface
- class HasConceptsInterface(concepts: Iterable[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept])[source]
Bases:
abc.ABC
This abstract base class serves as a foundational component for objects that manage a collection of concepts, providing a concrete implementation for storage and access. It initializes with an iterable of concepts and exposes a property that allows for both retrieval and dynamic modification of the underlying list. By handling the conversion of input iterables to a list, it ensures a consistent internal state for subclasses that need to track or represent multiple conceptual entities.
- Parameters:
_concepts (list[Concept]) – Internal storage for the concepts currently represented or manipulated by the class.
- _concepts: list[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept]
- property concepts: list[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept]
Replaces the internal collection of concepts with the provided iterable of Concept objects. The method converts the input iterable into a list before assignment, ensuring that the underlying _concepts attribute stores a concrete, mutable sequence. This operation overwrites any previously stored concepts rather than appending to them.
- Parameters:
value (Iterable[Concept]) – An iterable of Concept objects to assign to the internal concepts list.