Graphical Organization of Decentralized List Items
Graphical Organization of Decentralized List Items
draft, optional
This NIP augments the Decentralized Lists NIP with a mechanism to organize list items using a directed acyclic graph.
Example: Organization of a list of cities
As an example, we will consider a decentralized list of cities which will be organized by geography and by continent.

Figure 1: Green circles represent list items (cities). Grey circles represent sets of list items. Grey arrows indicate that one set is a subset of the other. Green arrows indicate that one list item is an element of another set.
Sets, subsets, and elements
We require two new Lists: a list of sets and a list of relationship types. And we will declare two specific types of relationships: subset and element. Note that the list of relationship types and the subset relationship type are used to build hierarchies for other NIPs, such as the Curated Dual Field Contexts NIP. Once these are declared for one purpose, they can and should be reused: they do not need to be redeclared.
If not already declared by someone else in our community, we declare these lists using kind 9998 events, as per the Decentralized Lists NIP:
{
"kind": 9998,
"tags": [
["names", "set", "sets"],
["description", "lorem ipsum"]
],
"id": <id_for_list_of_relationship_types>
}
{
"kind": 9998,
"tags": [
["names", "relationship type", "relationship types"],
["description", "lorem ipsum"],
["required", "direction"] // directions: forward, reverse, bidirectional, none; specify these details in the description
],
"id": <id_for_list_of_relationship_types>
}
Then we create a relationship type called subset:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_relationship_types>],
["name", "subset"],
["description", "lorem ipsum"],
["direction", "forward"],
["required", "nodeFrom"],
["required", "nodeTo"]
],
"id": <id_for_subset>
}
Then we create a relationship type called element:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_relationship_types>],
["name", "element"],
["description", "lorem ipsum"],
["direction", "forward"],
["required", "nodeFrom"],
["required", "nodeTo"]
],
"id": <id_for_element>
}
Example:
We will use the tools declared above to organize a list of cities into the hierarchy depicted in the image.
Declare the list of cities:
{
"kind": 9998,
"tags": [
["names", "city", "cities"],
["description", "lorem ipsum"],
["required", "name"]
],
"id": <id_for_list_of_cities>
}
Declare Nashville as an item on the list of cities:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_cities>],
["name", "Nashville"]
],
"id": <id_for_Nashville>
}
Declare the list of sets of cities:
{
"kind": 9998,
"tags": [
["names", "set of cities", "sets of cities"],
["description", "lorem ipsum"],
["required", "name"]
],
"id": <id_for_list_of_sets_of_cities>
}
Declare one of the sets of the list of cities:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_sets_of_cities>],
["name", "the set of coastal cities"]
],
"id": <id_for_the_set_of_coastal_cities>
}
Declare a subset relationship between two of the sets:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_relationships>],
["relationship_type", <id_for_subset>],
["nodeFrom", <id_for_set_of_North_American_cities>],
["nodeTo", <id_for_set_of_cities_organized_by_continent>]
]
}
Declare Nashville an element of the set of North American cities:
{
"kind": 9999,
"tags": [
["z", <id_for_list_of_relationships>],
["relationship_type", <id_for_element>],
["nodeFrom", <id_for_Nashville>],
["nodeTo", <id_for_set_of_North_American_cities>]
]
}
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.