def getPropertyAsSingleValue( data, name, default ):
    """
    Read a property from an LDAP data structure.
    Multi-valued properties are read as single-valued,
    with only the first value being used.
    """
    try:
        return data[name][0]
    except (IndexError, KeyError):
        return default