{"id":"d23ca3855df26a94bf977a6288e97f44eac149017faf18c9981ebad84cfefa98","pubkey":"e5272de914bd301755c439b88e6959a43c9d2664831f093c51e9c799a16a102f","created_at":1765503303,"kind":30817,"tags":[["d","curated-dual-field-contexts"],["title","Curated Dual Field Contexts"],["client","nostrhub.io"]],"content":"Curated Dual Field Contexts\n=====\n\nThis NIP proposes a simple, powerful and versatile method to categorize contexts using two fields: the _action_ field and the _category_ field. \n\nEach individual Dual Field Context is composed of one _action_ and one _category_. \n\nExamples of _actions_ are: to review, to write, to direct. Examples of _categories_ are: movies, dramas, comedies. Using different combinations of actions and categories, we are able to convey, for example, that we trust Alice to direct comedies, Bob to write science fiction, and Charlie to review movies.\n\n# Curation of Actions and Categories\n\nWe will use Curated Lists to maintain a list of Actions and a list of Categories.\n\n## Declaration of Action and Category lists:\n\nWe declare the lists of actions and categories using kind 9998 events, as per the Curated Lists NIP:\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"action\", \"actions\"],\n    [\"description\", \"This list of actions is intended to be used as one of two components in Trust Contexts, as per NIP-xx, the other component being categories.\"]\n  ],\n  \"id\": <id_for_list_of_actions>\n}\n```\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"category\", \"categories\"],\n    [\"description\", \"This list of categories is intended to be used as one of two components in Trust Contexts, as per NIP-xx, the other component being actions.\"]\n  ],\n  \"id\": <id_for_list_of_categories>\n}\n```\n\n## Declaring specific Actions and Categories\n\nDeclare _to direct_ as an item on the list of actions:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_actions>],\n    [\"name\", \"to direct\"],\n    [\"description\", \"lorem ipsum\"]\n  ],\n  \"id\": <id_for_action_to_direct>\n}\n```\nDo likewise for other actions: _to write_, _to review_, etc.\n\nDeclare _movies_ as an item on the list of categories:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_categories>],\n    [\"name\", \"movies\"],\n    [\"description\", \"lorem ipsum\"]\n  ],\n  \"id\": <id_for_category_movies>\n}\n```\n\nDo likewise for other categories: _comedies_, _dramas_, etc.\n\n# Organization of Actions and Categories into hierarchies\n\nIt will be important to maintain hierarchical relationships for Actions and Categories. For example, we will want to make use of the fact that dramas is a subset of movies. Therefore, if our web of trust tells us that Charlie is highly skilled at revieweing movies, we will be able to assume that this skill applies to all subsets of movies, including dramas and comedies.\n\nWe first create a list of relationship types:\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"relationship type\", \"relationship types\"],\n    [\"description\", \"lorem ipsum\"],\n    [\"required\", \"direction\"] // directions: forward, reverse, bidirectional, none; specify these details in the description\n  ],\n  \"id\": <id_for_list_of_relationship_types>\n}\n```\n\nThen we create a relationship type called _subset_:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_relationship_types>],\n    [\"name\", \"subset\"],\n    [\"description\", \"lorem ipsum\"],\n    [\"direction\", \"forward\"],\n    [\"required\", \"nodeFrom\"],\n    [\"required\", \"nodeTo\"]\n  ],\n  \"id\": <id_for_subset>\n}\n```\n\nCreate the list of relationships:\n\n```\n{\n  \"kind\": 9998,\n  \"tags\": [\n    [\"names\", \"relationship\", \"relationships\"],\n    [\"description\", \"lorem ipsum\"],\n    [\"required\", \"nodeFrom\"],\n    [\"required\", \"relationship_type\"],\n    [\"required\", \"nodeTo\"]\n  ],\n  \"id\": <id_for_list_of_relationships>\n}\n```\n\nFinally, here's how we add that dramas is a subset of movies:\n\n```\n{\n  \"kind\": 9999,\n  \"tags\": [\n    [\"z\", <id_for_list_of_relationships>],\n    [\"relationship_type\", <id_for_subset>],\n    [\"description\", \"lorem ipsum\"],\n    [\"nodeFrom\", <id_for_dramas>],\n    [\"nodeTo\", <id_for_movies>]\n  ]\n}\n```\n\n# Declarations of the list of Contexts and list of Context Types\n\nFollowing the example of the [Curated Widgets NIP](https://nostrhub.io/naddr1qvzqqqrcvypzpef89h53f0fsza2ugwdc3e54nfpun5nxfqclpy79r6w8nxsk5yp0qy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsqrmrw4exzar9vskhw6tyvajhguclexxk3), we can declare the list of Contexts, the list of Context Types, and two Context Types: _simple context type_ and _dual-field context type_. We will reserve a separate NIP, the Curated Contexts NIP, to go through this exercise.\n\n# Utilization\n\n## Contexts\n\nContexts have wide utility but are well illustrated by their role in the [Curated Contextual Ratings NIP](https://nostrhub.io/naddr1qvzqqqrcvypzpef89h53f0fsza2ugwdc3e54nfpun5nxfqclpy79r6w8nxsk5yp0qy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsqxnrw4exzar9vskkxmmww3jhsar4v9kz6unpw35kuemne37t6y). A simple Context is referenced in the usual manner:\n\n`[\"context\", <id_for_some_specific_simple_context>],`\n\nWhereas a dual-field context is referenced with a colon between the action and the category:\n\n`[\"context\", <id_for_to_program_action>:<id_for_back_end_programmer_category>],`\n\n## Categories \n\nCategories can be used independently of dual field contexts to classify things: products, services, businesses, people, ideas, etc.","sig":"e99d8ac6378320db6c7e587c656ec77272e66e681ed43e18c6450fafd7aeb76e0682673673f2b5943d8e81e87d1970bdeec17dc61eaac917c5350ce715763d44"}