def _process_metadata(
        self, tika_metadata: Dict[str, Any], file_path: str
    ) -> Dict[str, Any]:
        """
        Process Tika metadata into LlamaIndex format.

        Args:
            tika_metadata: Raw metadata from Tika
            file_path: Path to the document

        Returns:
            Processed metadata dictionary with essential information only

        """
        # Start with basic metadata
        metadata = {
            "file_path": file_path,
            "file_name": Path(file_path).name,
            "file_type": Path(file_path).suffix.lower(),
        }

        # Whitelist of metadata keys to keep
        essential_keys = {
            # Document properties
            "title": "title",
            "dc:title": "title",
            "dc:creator": "author",
            "meta:author": "author",
            "meta:word-count": "words",
            "meta:character-count": "chars",
            "meta:page-count": "pages",
            "xmptpg:npages": "pages",
            # Dates
            "dcterms:created": "created",
            "dcterms:modified": "modified",
        }

        for key, orig_value in tika_metadata.items():
            # Skip if not an essential key
            normalized_key = essential_keys.get(key.lower())
            if not normalized_key:
                continue

            # Skip empty values
            if not orig_value:
                continue

            # Handle lists by joining with semicolon
            processed_value = orig_value
            if isinstance(orig_value, list):
                processed_value = "; ".join(str(v) for v in orig_value)

            # Convert to string and clean up
            processed_value = str(processed_value).strip()
            if processed_value and ":" in processed_value:
                processed_value = processed_value.split(":", 1)[1].strip()

            if processed_value:
                metadata[normalized_key] = processed_value

        return metadata

        Process Tika metadata into LlamaIndex format.

        Args:
            tika_metadata: Raw metadata from Tika
            file_path: Path to the document

        Returns:
            Processed metadata dictionary with essential information only

        
llama-index-integrations/readers/llama-index-readers-legacy-office/llama_index/readers/legacy_office/reader.py