I use the tapestry protocol to format a rating using json, and I have some TIPs on how to store ratings (and other pieces of json-encoded data) in nostr.
The below link shows an example of a rating and shows how I wrap it into the content of a kind 39901 event.

GitHub
pretty-good/appDescriptions/curatedLists/v021Overview/rateCurator.md at main · wds4/pretty-good
a nostr desktop client for mac, windows and linux, motivated by the desire to build a decentralized web of trust - wds4/pretty-good