def METHOD_NAME(
    logger: Logger,
    graph: Graph,
    subject: Optional[Node] = None,
    predicate: Optional[Node] = None,
    _object: Optional[Node] = None,
) -> Tuple[Union[BNode, URIRef], Node, Union[BNode, Literal, URIRef]]:
    # this is a helper method to cast some rdf types from graph.triples() to be compatible with the
    # code that follows
    for s, p, o in graph.triples((subject, predicate, _object)):
        if not isinstance(s, (BNode, URIRef)):
            logger.append(
                f"Warning: Subject {s} should be of type BNode or URIRef, but is {type(s).__name__}. "
                f"This might lead to a failure."
            )
        if not isinstance(o, (BNode, Literal, URIRef)):
            logger.append(
                f"Warning: Object {o} should be of type BNode, Literal or URIRef, but is {type(o).__name__}. "
                f"This might lead to a failure."
            )
        yield s, p, o