I have an rpm and I want to treat it like a tarball. I want to extract the contents into a directory so I can inspect the contents. I am familiar with the querying commands
In NixOS, there is rpmextract. It is a wrapper around rpm2cpio, exactly as @Alan Evangelista wanted.
https://github.com/NixOS/nixpkgs/tree/master/pkgs/tools/archivers/rpmextract