from typing import Union
from typing import List


def to_cypher_labels(labels: Union[str, List[str], None]) -> str:
    """Converts labels to a openCypher label definition"""
    if labels:
        if isinstance(labels, str):
            return f":{labels}"
        return f":{':'.join(labels)}"
    return ""