Which database to you query? They're on the blockchain, but you have to know which format you're accepting, how to verify, etc. Do you accept OpenSea as the source of truth for NFT ownership? How about Foundation? What about MyFirstMarketplace, the one that I've decided to create?
This requires some social contract to know who the authority is, and that's probably based on how much they have spent on marketing to become The Authority.
It always comes back to social contracts.