fuzzy_dl_owl2.fuzzydl.concept.modified.modified_concept

A specialized conceptual entity that wraps a base concept with a modifier to adjust the degree of truth or satisfaction within a fuzzy description logic framework.

Description

The wrapper alters the semantic interpretation of an existing base concept by applying a specific modifier, effectively changing how individuals satisfy the concept in a fuzzy logic context. Structural queries, such as retrieving atomic concepts, roles, and checking concreteness, are delegated directly to the underlying wrapped entity, ensuring that the modification layer does not obscure the original structure. Logical composition is supported through operator overloading for negation, conjunction, and disjunction, allowing these modified concepts to participate seamlessly in complex logical expressions. A formatted string representation combines the modifier and the base concept, facilitating clear identification and debugging within the broader system.

Classes

ModifiedConcept

This class represents a conceptual construct where a base concept is altered by a modifier, thereby changing the degree or manner in which an individual satisfies that concept. It functions as a wrapper around an existing concept, preserving the underlying structural properties—such as roles and atomicity—while applying the semantic shift defined by the associated modifier. Users can instantiate this entity by providing a target concept and a modifier, and it supports integration into logical expressions through standard operator overloading for negation, conjunction, and disjunction.

Module Contents

UML Class Diagram for ModifiedConcept

UML Class Diagram for ModifiedConcept

class ModifiedConcept(c: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept, mod: fuzzy_dl_owl2.fuzzydl.modifier.modifier.Modifier)[source]

Bases: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept, fuzzy_dl_owl2.fuzzydl.concept.interface.has_concept_interface.HasConceptInterface, abc.ABC

Inheritance diagram of fuzzy_dl_owl2.fuzzydl.concept.modified.modified_concept.ModifiedConcept

This class represents a conceptual construct where a base concept is altered by a modifier, thereby changing the degree or manner in which an individual satisfies that concept. It functions as a wrapper around an existing concept, preserving the underlying structural properties—such as roles and atomicity—while applying the semantic shift defined by the associated modifier. Users can instantiate this entity by providing a target concept and a modifier, and it supports integration into logical expressions through standard operator overloading for negation, conjunction, and disjunction.

Parameters:

_modifier (Modifier) – The modifier instance that adjusts the degree of satisfaction of the underlying concept.

__and__() Self[source]

This method implements the bitwise AND operation (&) for the concept by delegating the logic to the OperatorConcept.and_ method. It passes the current instance to the helper method, which returns a new instance of the same class, effectively creating a new concept based on the AND operation. The method does not modify the original instance in place, and any errors raised during the delegation process will propagate to the caller.

Returns:

The result of the AND operation, returned as an instance of the same class.

Return type:

Self

__neg__() Self[source]

Implements the unary negation operator for the concept, effectively treating the minus sign as a logical NOT operation. When invoked, this method returns a new instance representing the logical negation of the current concept by delegating to OperatorConcept.not_. The original instance remains unmodified, and the returned value is of the same type as the input.

Returns:

Returns a new instance representing the logical negation of the current concept.

Return type:

Self

__or__() Self[source]

Implements the bitwise OR operation for the concept, enabling the use of the pipe (|) operator. The method delegates the execution logic to the OperatorConcept.or_ static method, passing the current instance as the argument. It returns a new instance of the same type, representing the result of the operation.

Returns:

A new instance representing the logical disjunction (OR) of this concept with another.

Return type:

Self

__repr__() str[source]

Returns the official string representation of the object by delegating directly to the __str__ method. This implementation ensures that the output produced by the built-in repr() function is identical to the informal string representation. Consequently, the method provides a consistent string format for debugging and logging purposes without implementing distinct logic for representation.

Returns:

A string representation of the object.

Return type:

str

__str__() str[source]

Returns the informal string representation of the ModifiedConcept instance. This method delegates the generation of the display name to the compute_name method, which calculates the name based on the object’s current state. It is intended to provide a human-readable format and is automatically invoked by the str() built-in function and print operations.

Returns:

The informal string representation of the object, specifically its computed name.

Return type:

str

compute_atomic_concepts() set[Self][source]

Computes the set of atomic concepts representing the fundamental components of the current concept state. This method delegates the actual computation to the curr_concept attribute, invoking its corresponding method to retrieve the results. It returns a set of atomic concepts, effectively exposing the decomposed structure of the underlying concept without modifying the object’s state.

Returns:

A set of atomic concepts representing the fundamental components of the current concept.

Return type:

set[Self]

compute_name() str | None[source]

Generates a formatted string representation of the entity by combining the instance’s modifier and current concept attributes. The resulting string is constructed by placing the modifier and concept side-by-side within parentheses, providing a concise identifier for the modified state. This method performs a read-only operation and does not alter the object’s state, though it will raise an error if the required attributes are missing.

Returns:

A string representing the computed name, formatted as “({modifier} {curr_concept})”.

Return type:

str | None

get_roles() set[str][source]

Retrieves the set of role identifiers associated with the underlying concept instance. This method delegates the call to the curr_concept attribute, returning the collection of roles defined by that object. The operation relies on the internal concept reference being properly initialized; otherwise, an AttributeError may occur.

Returns:

A set of role names associated with the current concept.

Return type:

set[str]

is_concrete() bool[source]

Determines whether the underlying concept is concrete by delegating the check to the curr_concept attribute. It returns a boolean value that reflects the concreteness status of the wrapped concept. This method serves as a pass-through, relying entirely on the implementation of the is_concrete method within the curr_concept object.

Returns:

True if the current concept 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 serves as a no-operation implementation for the replacement logic, returning the current instance unchanged regardless of the input concepts. Although the signature suggests substituting concept1 with concept2, this specific implementation indicates that the ModifiedConcept does not support or require internal modifications of this nature. Consequently, invoking this method has no side effects on the object’s state or the provided arguments.

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

  • concept2 (Concept) – The concept to replace the first argument with.

Returns:

Returns the instance itself after replacing concept1 with concept2.

Return type:

Concept

_modifier: fuzzy_dl_owl2.fuzzydl.modifier.modifier.Modifier
property modifier: fuzzy_dl_owl2.fuzzydl.modifier.modifier.Modifier

Sets the modifier applied to the concept by updating the internal state. This setter accepts a Modifier instance and assigns it to the private _modifier attribute, effectively replacing any previously associated modifier. It enables dynamic modification of the concept’s behavior or properties after the object has been instantiated.

Parameters:

value (Modifier)