def METHOD_NAME(
    cls, path: Path, public_id: Optional[str] = None, format: Optional[str] = None
) -> GraphSource:
    if format is None:
        format = cls.guess_format(path)
    if format is None:
        raise ValueError(f"could not guess format for source {path}")
    return cls(path, format, public_id)