Curated Contextual Ratings
Curated Contextual Ratings
draft, optional
This NIP uses the Decentralized Lists NIP to establish a simple, flexible, and powerful method to create ratings that are organized into rating_types.
We will suggest three rating types: 5 star, 0-100, and pairwise comparision, and will show an example rating for each of these types.
Declaration of the lists of Ratings and Rating Types
Declation of the list of Ratings
We declare the list of ratings using a kind 9998 event, as per the Decentralized Lists NIP:
{
"kind": 9998,
"tags": [
["names", "rating", "ratings"],
["description", "lorem ipsum"],
["required","ratingType"],
["optional","context"],
["optional","confidence"]
],
"id": <id_for_list_of_ratings>
}
Note 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.
Note 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. This tag may be overridden as indicated within individual rating type declarations.
Declaration of the list of Rating Types
We declare the list of rating types using a kind 9998 event, as per the Decentralized Lists NIP:
{
"kind": 9998,
"tags": [
["names", "rating type", "rating types"],
["titles", "Rating Type", "Rating Types"],
["slugs", "ratingType", "ratingTypes"],
["description", "lorem ipsum"],
["required","description"]
],
"id": <id_for_list_of_rating_types>
}
Declaration of Rating Types: 5-star, 0-100, or pairwise comparison
5-star
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_rating_types>],
["name", "5 star"],
["description", "For ratings in the category of 5-stars, the rating must be an integer between 0 and 5."]
],
"id": <id_for_list_of_5star_ratings>
}
0-100
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_rating_types>],
["name", "0-100"],
["description", "For ratings in the category of 0-100, the rating must be an integer between 0 and 100."]
],
"id": <id_for_list_of_0_to_100_ratings>
}
Pairwise Comparison
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_rating_types>],
["name", "pairwise comparison"],
["description", "For ratings in the category of pairwise comparison, there are two subjects; the rating is > or =."]
],
"id": <id_for_list_of_pairwise_comparison_ratings>
}
Examples of individual Ratings
Rate Alice as a better back end programmer than Bob using the pairwise comparison context type.
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_ratings>],
["ratingType", <id_for_list_of_pairwise_comparison_ratings>],
["subject", "Alice", "Bob"],
["context", <id_for_to_program_action>:<id_for_back_end_programmer_category>],
["rating", ">"]
]
}
Now rate Panera as a 4 out of 5 restaurant using the simple context of nutritional food value:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_ratings>],
["ratingType", <id_for_list_of_5star_ratings>],
["subject", "Panera"],
["context", <id_for_nutritional_food_value>],
["rating", "4"]
]
}
Now 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:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_ratings>],
["ratingType", <id_for_list_of_5star_ratings>],
["subject", <pubkey_Alice>],
["context", <id_for_to_rate>:<id_for_dramas>],
["rating", "5"]
]
}
Looking for comments…
Searching Nostr relays. This may take a moment the first time this article is opened.
Looking for comments…
Searching Nostr relays. This may take a moment the first time this article is opened.