{"id":"0b99fc0172ce5a11912fba205e22b9a0eecd9ad3c822b647db8e033414974fd9","pubkey":"e5272de914bd301755c439b88e6959a43c9d2664831f093c51e9c799a16a102f","created_at":1765653027,"kind":30817,"tags":[["d","curated-contextual-ratings"],["title","Curated Contextual Ratings"],["client","nostrhub.io"]],"content":"Curated Contextual Ratings\n=====\n\n`draft`, `optional`\n\nThis NIP uses the [Decentralized Lists NIP](https://nostrhub.io/naddr1qvzqqqrcvypzpef89h53f0fsza2ugwdc3e54nfpun5nxfqclpy79r6w8nxsk5yp0qyt8wumn8ghj7un9d3shjtnswf5k6ctv9ehx2aqqzdjx2cm9de68yctvd9ax2epdd35hxarnwrn9hx) to establish a simple, flexible, and powerful method to create _ratings_ that are organized into _rating_types_.\n\nWe will suggest three rating types: 5 star, 0-100, and pairwise comparision, and will show an example rating for each of these types.\n\n# Declaration of the lists of Ratings and Rating Types\n\n### Declation of the list of Ratings\n\nWe declare the list of ratings using a kind 9998 event, as per the Decentralized Lists NIP:\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"rating\", \"ratings\"],\n    [\"description\", \"lorem ipsum\"],\n    [\"required\",\"ratingType\"],\n    [\"optional\",\"context\"],\n    [\"optional\",\"confidence\"]\n  ],\n  \"id\": <id_for_list_of_ratings>\n}\n```\n\nNote the only universally required tag is the ratingType. As demonstrated below, declaration of a ratingType will typically specify additional tags (required, optional, etc). These details _should_ be made clear in the description.\n\nNote also that the context tag is optional. It may use the action:category (dual field) method or the plain (single field) context method, as discussed in the [Curated Dual-Field Contexts NIP](https://nostrhub.io/naddr1qvzqqqrcvypzpef89h53f0fsza2ugwdc3e54nfpun5nxfqclpy79r6w8nxsk5yp0qy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsqxmrw4exzar9vskkgatpdskkv6t9d3jz6cm0de6x27r5wv63qndn). This tag may be overridden as indicated within individual _rating type_ declarations.\n\n### Declaration of the list of Rating Types\n\nWe declare the list of rating types using a kind 9998 event, as per the Decentralized Lists NIP:\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"rating type\", \"rating types\"],\n    [\"titles\", \"Rating Type\", \"Rating Types\"],\n    [\"slugs\", \"ratingType\", \"ratingTypes\"],\n    [\"description\", \"lorem ipsum\"],\n    [\"required\",\"description\"]\n  ],\n  \"id\": <id_for_list_of_rating_types>\n}\n```\n\n# Declaration of Rating Types: 5-star, 0-100, or pairwise comparison\n\n### 5-star\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_rating_types>],\n    [\"name\", \"5 star\"],\n    [\"description\", \"For ratings in the category of 5-stars, the rating must be an integer between 0 and 5.\"]\n  ],\n  \"id\": <id_for_list_of_5star_ratings>\n}\n```\n\n### 0-100\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_rating_types>],\n    [\"name\", \"0-100\"],\n    [\"description\", \"For ratings in the category of 0-100, the rating must be an integer between 0 and 100.\"]\n  ],\n  \"id\": <id_for_list_of_0_to_100_ratings>\n}\n```\n\n### Pairwise Comparison\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_rating_types>],\n    [\"name\", \"pairwise comparison\"],\n    [\"description\", \"For ratings in the category of pairwise comparison, there are two subjects; the rating is > or =.\"]\n  ],\n  \"id\": <id_for_list_of_pairwise_comparison_ratings>\n}\n```\n\n# Examples of individual Ratings\n\nRate Alice as a better back end programmer than Bob using the _pairwise comparison_ context type.\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_ratings>],\n    [\"ratingType\", <id_for_list_of_pairwise_comparison_ratings>],\n    [\"subject\", \"Alice\", \"Bob\"],\n    [\"context\", <id_for_to_program_action>:<id_for_back_end_programmer_category>],\n    [\"rating\", \">\"]\n  ]\n}\n```\n\nNow rate Panera as a 4 out of 5 restaurant using the simple context of nutritional food value:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_ratings>],\n    [\"ratingType\", <id_for_list_of_5star_ratings>],\n    [\"subject\", \"Panera\"],\n    [\"context\", <id_for_nutritional_food_value>],\n    [\"rating\", \"4\"]\n  ]\n}\n```\n\nNow rate Alice as 5 out of 5 stars in her ability to rate dramas. Once again we are using the _pairwise comparison_ context type, using _to rate_ as the action and _dramas_ as the category:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_ratings>],\n    [\"ratingType\", <id_for_list_of_5star_ratings>],\n    [\"subject\", <pubkey_Alice>],\n    [\"context\", <id_for_to_rate>:<id_for_dramas>],\n    [\"rating\", \"5\"]\n  ]\n}\n```","sig":"5925bc823bb7c8ad95d1c7457f17c47f699fe4ec76cc8f9cc246e3b19441785283842d95214a16f9720ce1d9706619df7f5639f7172cb256782f81b100d96228"}