def document_metas_from_data(document_data, claimant):
    """
    Return a list of document meta dicts for the given document data.

    Returns one document meta dict for each document metadata claim in
    document_data.

    Each dict can be used to init a DocumentMeta object directly::

        document_meta = DocumentMeta(**document_meta_dict)

    :param document_data: the "document" sub-object that the client POSTed to
        the API as part of a new or updated annotation
    :type document_data: dict

    :param claimant: the URI that the browser was at when this annotation was
        created (the top-level "uri" field of the annotation)
    :type claimant: unicode

    :returns: a list of zero or more document meta dicts
    :rtype: list of dicts

    """

    def transform_meta_(document_meta_dicts, items, path_prefix=None):
        """Fill document_meta_dicts with document meta dicts for the items."""
        if path_prefix is None:
            path_prefix = []

        for key, value in items.items():
            keypath = path_prefix[:]
            keypath.append(key)

            if isinstance(value, dict):
                transform_meta_(document_meta_dicts, value, path_prefix=keypath)
            else:
                if not isinstance(value, list):
                    value = [value]

                type_ = ".".join(keypath)

                if type_ == "title":
                    # We don't allow None, empty strings, whitespace-only
                    # strings, leading or trailing whitespaces, or empty arrays
                    # in document title values.
                    value = [v.strip() for v in value if v and v.strip()]
                    if not value:
                        continue

                document_meta_dicts.append(
                    {"type": type_, "value": value, "claimant": claimant}
                )

    items = {k: v for k, v in document_data.items() if k != "link"}
    document_meta_dicts = []
    transform_meta_(document_meta_dicts, items)
    return document_meta_dicts