Skip to content

ontocast.tool.onto

Base tool class for OntoCast tools.

This module provides the base Tool class that serves as a foundation for all tools in the OntoCast system. It provides common functionality and interface for tool implementations.

EntityMetadata

Bases: BaseModel

Metadata for an entity in the graph.

Source code in ontocast/tool/onto.py
class EntityMetadata(BaseModel):
    """Metadata for an entity in the graph."""

    model_config = {"arbitrary_types_allowed": True}

    local_name: str = Field(description="The local name of the entity")
    label: str | None = Field(
        default=None, description="Optional human-readable label for the entity"
    )
    comment: str | None = Field(
        default=None, description="Optional comment describing the entity"
    )
    types: set[URIRef] = Field(
        default_factory=set, description="Set of RDF types for this entity"
    )

PredicateMetadata

Bases: BaseModel

Metadata for a predicate in the graph.

Source code in ontocast/tool/onto.py
class PredicateMetadata(BaseModel):
    """Metadata for a predicate in the graph."""

    model_config = {"arbitrary_types_allowed": True}

    local_name: str = Field(description="The local name of the predicate")
    label: str | None = Field(
        default=None, description="Optional human-readable label for the predicate"
    )
    comment: str | None = Field(
        default=None, description="Optional comment describing the predicate"
    )
    domain: None | URIRef = Field(
        default=None, description="Optional domain of the predicate"
    )
    range: None | URIRef = Field(
        default=None, description="Optional range of the predicate"
    )
    is_explicit_property: bool = Field(
        default=False, description="Whether this is an explicit property"
    )

Tool

Bases: BasePydanticModel

Base class for all OntoCast tools.

This class serves as the foundation for all tools in the OntoCast system. It provides common functionality and interface that all tools must implement. Tools should inherit from this class and implement their specific functionality.

Source code in ontocast/tool/onto.py
class Tool(BasePydanticModel):
    """Base class for all OntoCast tools.

    This class serves as the foundation for all tools in the OntoCast system.
    It provides common functionality and interface that all tools must implement.
    Tools should inherit from this class and implement their specific functionality.

    Attributes:
        Inherits all attributes from BasePydanticModel.
    """

    def __init__(self, **kwargs):
        """Initialize the tool.

        Args:
            **kwargs: Keyword arguments passed to the parent class.
        """
        super().__init__(**kwargs)

__init__(**kwargs)

Initialize the tool.

Parameters:

Name Type Description Default
**kwargs

Keyword arguments passed to the parent class.

{}
Source code in ontocast/tool/onto.py
def __init__(self, **kwargs):
    """Initialize the tool.

    Args:
        **kwargs: Keyword arguments passed to the parent class.
    """
    super().__init__(**kwargs)