fuzzy_dl_owl2.fuzzydl.concept.interface.has_weighted_concepts_interface

An abstract interface extending the basic concept management contract to include support for numerical weights associated with each concept.

Description

Building upon the foundation of managing generic concepts, this abstract class introduces the capability to associate specific numerical values or magnitudes with those concepts. It enforces a structural pattern where objects must handle a mutable list of floating-point weights, allowing for dynamic updates or the complete removal of weighting information. The design utilizes property decorators to encapsulate the internal storage of these weights, ensuring that any provided iterable is converted into a list or explicitly set to null to represent an unweighted state. By integrating this functionality directly into the inheritance hierarchy, the class facilitates the creation of complex fuzzy logic constructs where concepts contribute to a result with varying degrees of importance.

Classes

HasWeightedConceptsInterface

This abstract base class defines a contract for objects that manage a collection of concepts alongside associated numerical weights, extending the functionality of the basic concept interface. It provides properties to retrieve and update the list of weights, ensuring that these values are stored as mutable lists of floats or explicitly set to null to indicate the absence of weighting. By handling the initialization and modification of these weights, the class enables dynamic representation of concepts where each element carries a specific magnitude or significance.

Module Contents

UML Class Diagram for HasWeightedConceptsInterface

UML Class Diagram for HasWeightedConceptsInterface

class HasWeightedConceptsInterface(
weights: Iterable[float] | None,
concepts: Iterable[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept],
)

Bases: fuzzy_dl_owl2.fuzzydl.concept.interface.has_concepts_interface.HasConceptsInterface, abc.ABC

This abstract base class defines a contract for objects that manage a collection of concepts alongside associated numerical weights, extending the functionality of the basic concept interface. It provides properties to retrieve and update the list of weights, ensuring that these values are stored as mutable lists of floats or explicitly set to null to indicate the absence of weighting. By handling the initialization and modification of these weights, the class enables dynamic representation of concepts where each element carries a specific magnitude or significance.

Parameters:

_weights (Optional[list[float]]) – Internal list of weights associated with the current concepts, or None if no weights are assigned.

_weights: list[float] | None
property weights: list[float] | None

Returns the per-concept weights applied in the weighted aggregation, or None when no weights are set. The value is read from the private _weights attribute without modifying the instance.

Returns:

The list of weights, or None if unset.

Return type:

Optional[list[float]]