fuzzy_dl_owl2.fuzzydl.concept.concrete.fuzzy_concrete_concept

An abstract base class defines fuzzy concepts operating over numerical intervals with configurable lower and upper bounds.

Description

It serves as a foundational template for evaluating the degree of membership for specific numerical values within a defined range, distinguishing concrete data handling from abstract conceptual relationships. The implementation manages interval parameters through properties that enforce structural integrity, specifically ensuring that the upper bound is never less than the lower bound. By declaring an abstract method for calculating membership degrees, the design delegates the specific mathematical logic—such as triangular or trapezoidal functions—to subclasses while centralizing common state management. It integrates into the broader fuzzy description logic framework by identifying itself as a concrete entity type, thereby enabling the system to process quantitative data rather than purely qualitative or structural definitions.

Classes

FuzzyConcreteConcept

This abstract base class represents a fuzzy concept defined over a specific numerical interval, characterized by a lower bound and an upper bound. It serves as a template for evaluating the degree of membership a specific numerical value has within the concept, requiring subclasses to implement the specific logic for this calculation. The class manages the interval parameters through properties, ensuring structural integrity by raising a ValueError if the upper bound is set lower than the lower bound. As a concrete concept type, it operates directly on numerical data rather than abstract relationships, providing a mechanism to quantify partial truth or satisfaction within a defined range.

Module Contents

UML Class Diagram for FuzzyConcreteConcept

UML Class Diagram for FuzzyConcreteConcept

class FuzzyConcreteConcept(name: str)[source]

Bases: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept, abc.ABC

Inheritance diagram of fuzzy_dl_owl2.fuzzydl.concept.concrete.fuzzy_concrete_concept.FuzzyConcreteConcept

This abstract base class represents a fuzzy concept defined over a specific numerical interval, characterized by a lower bound and an upper bound. It serves as a template for evaluating the degree of membership a specific numerical value has within the concept, requiring subclasses to implement the specific logic for this calculation. The class manages the interval parameters through properties, ensuring structural integrity by raising a ValueError if the upper bound is set lower than the lower bound. As a concrete concept type, it operates directly on numerical data rather than abstract relationships, providing a mechanism to quantify partial truth or satisfaction within a defined range.

Parameters:
  • name (str) – Identifier for the concept used for labeling and debugging.

  • _k1 (float) – The lower bound of the interval for which the concept is defined.

  • _k2 (float) – Upper bound of the interval defining the concept’s domain, used to calculate membership degrees.

Raises:

ValueError – Raised when the lower bound k1 is greater than the upper bound k2, which would define an invalid interval for the concept.

compute_atomic_concepts() set[Self][source]

Returns an empty set representing the atomic concepts associated with this instance. Because this is a concrete concept, it does not decompose into or reference other atomic concepts of the same type. The method performs no computation beyond returning the empty set and has no side effects.

Returns:

A set of atomic concepts represented as instances of the class.

Return type:

set[Self]

compute_name() str[source]

Retrieves the name associated with the FuzzyConcreteConcept instance by returning the value of the name attribute. This method acts as a simple accessor and does not perform any computation or modification of the underlying data. It assumes that the name attribute is already set; otherwise, an AttributeError will be raised.

Returns:

The name associated with the object instance.

Return type:

str

abstractmethod get_membership_degree(value: float) float[source]

Calculates the degree to which a specific numerical value belongs to this fuzzy concept, representing the core evaluation logic of fuzzy set theory. The method accepts a floating-point number and returns a membership coefficient, typically constrained to the range [0.0, 1.0], where 0.0 signifies complete exclusion and 1.0 signifies full inclusion. As an abstract method, it requires implementation by subclasses to define the specific shape and parameters of the membership function, such as triangular, trapezoidal, or Gaussian distributions. This operation is expected to be stateless with respect to the input value, meaning repeated calls with the same argument should yield the same result unless the concept’s internal parameters change.

Parameters:

value (float) – The input value for which to calculate the degree of membership.

Returns:

A float representing the degree of membership of the input value, typically ranging from 0.0 (no membership) to 1.0 (full membership).

Return type:

float

get_roles() set[str][source]

Retrieves the set of roles associated with this fuzzy concrete concept. This implementation returns an empty set, indicating that no roles are defined or applicable to this specific entity. The method has no side effects and returns a new set instance on every call.

Returns:

A set of strings representing the roles associated with the object.

Return type:

set[str]

is_concrete() bool[source]

Determines whether the concept is considered concrete, returning True unconditionally for all instances of this class. This method serves as a definitive marker to distinguish FuzzyConcreteConcept objects from abstract or non-concrete counterparts within the conceptual hierarchy. As the implementation is constant, there are no side effects or edge cases dependent on the object’s state.

Returns:

True if the class is concrete, False otherwise.

Return type:

bool

replace(
concept1: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept,
concept2: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept,
) fuzzy_dl_owl2.fuzzydl.concept.concept.Concept[source]

This method is designed to replace concept1 with concept2 within the context of the current concept, but the provided implementation currently acts as a placeholder that signals a failure. When called, it triggers an error message via Util.error and catches the resulting FuzzyOntologyException to allow execution to continue, ultimately returning None without modifying the object’s state. Consequently, this operation does not perform a functional replacement and indicates that the feature is either unimplemented or unsupported for this specific concept type.

Parameters:
  • concept1 (Concept) – The concept to be replaced.

  • concept2 (Concept) – The new concept that will replace the original concept.

Returns:

None

Return type:

Concept

_k1: float = 0.0
_k2: float = 0.0
property k1: float

Sets the value of the k1 attribute for the instance, converting the input to a float to ensure type consistency. This method updates the private _k1 variable, effectively modifying the internal state of the FuzzyConcreteConcept object. Any subsequent operations relying on this parameter will reflect the new value.

Parameters:

value (float) – The new value for the k1 attribute.

property k2: float

Sets the upper bound parameter k2 for the fuzzy concrete concept. This method enforces a constraint ensuring that the new value is greater than or equal to the existing k1 parameter; if k1 is larger than the provided value, a ValueError is raised. Upon successful validation, the input is converted to a float and stored in the internal state.

Parameters:

value (float) – The value to assign to the k2 parameter, which must be greater than or equal to k1.

Raises:

ValueError – Raised if the provided value is less than k1, as k2 must be greater than or equal to k1.

name: str

Updates the name of the Concept instance to the specified string value. This setter modifies the object’s internal state by assigning the provided value to the private _name attribute, effectively replacing any previously stored name.

Parameters:

value (str) – The new name to assign to the object.