upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/32.md
diff options
context:
space:
mode:
authorKieran <kieran@harkin.me>2024-10-15 11:15:54 +0100
committerGitHub <noreply@github.com>2024-10-15 11:15:54 +0100
commit1e2f19863ca56754daa2466881eb22087a71b17d (patch)
tree4f7be759dce290fea1d3ae10c403260b466ee16c /32.md
parent53afaaece61f02e92b5ef9c3e9c32945c7ebf522 (diff)
parente381b577c997b849fa544eea7dc9f08b360b4a33 (diff)
Merge branch 'master' into nip71-imeta
Diffstat (limited to '32.md')
-rw-r--r--32.md57
1 files changed, 36 insertions, 21 deletions
diff --git a/32.md b/32.md
index 92497a6..a99e52a 100644
--- a/32.md
+++ b/32.md
@@ -2,14 +2,13 @@ NIP-32
2====== 2======
3 3
4Labeling 4Labeling
5--------- 5--------
6 6
7`draft` `optional` 7`draft` `optional`
8 8
9A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, 9This NIP defines two new indexable tags to label events and a new event kind (`kind:1985`) to attach those labels to existing events. This supports several use cases, including distributed moderation, collection management, license assignment, and content classification.
10including distributed moderation, collection management, license assignment, and content classification.
11 10
12This NIP introduces two new tags: 11New Tags:
13 12
14- `L` denotes a label namespace 13- `L` denotes a label namespace
15- `l` denotes a label 14- `l` denotes a label
@@ -20,7 +19,7 @@ Label Namespace Tag
20An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace 19An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace
21(such as an ISO standard) or reverse domain name notation. 20(such as an ISO standard) or reverse domain name notation.
22 21
23`L` tags are REQUIRED in order to support searching by namespace rather than by a specific tag. The special `ugc` 22`L` tags are RECOMMENDED in order to support searching by namespace rather than by a specific tag. The special `ugc`
24("user generated content") namespace MAY be used when the label content is provided by an end user. 23("user generated content") namespace MAY be used when the label content is provided by an end user.
25 24
26`L` tags starting with `#` indicate that the label target should be associated with the label's value. 25`L` tags starting with `#` indicate that the label target should be associated with the label's value.
@@ -29,7 +28,9 @@ This is a way of attaching standard nostr tags to events, pubkeys, relays, urls,
29Label Tag 28Label Tag
30---- 29----
31 30
32An `l` tag's value can be any string. `l` tags MUST include a `mark` matching an `L` tag value in the same event. 31An `l` tag's value can be any string. If using an `L` tag, `l` tags MUST include a mark matching an `L`
32tag value in the same event. If no `L` tag is included, a mark SHOULD still be included. If none is
33included, `ugc` is implied.
33 34
34Label Target 35Label Target
35---- 36----
@@ -42,7 +43,7 @@ or topics respectively. As with NIP-01, a relay hint SHOULD be included when usi
42Content 43Content
43------- 44-------
44 45
45Labels should be short, meaningful strings. Longer discussions, such as for a review, or an 46Labels should be short, meaningful strings. Longer discussions, such as for an
46explanation of why something was labeled the way it was, should go in the event's `content` field. 47explanation of why something was labeled the way it was, should go in the event's `content` field.
47 48
48Self-Reporting 49Self-Reporting
@@ -56,7 +57,7 @@ Example events
56 57
57A suggestion that multiple pubkeys be associated with the `permies` topic. 58A suggestion that multiple pubkeys be associated with the `permies` topic.
58 59
59```json 60```jsonc
60{ 61{
61 "kind": 1985, 62 "kind": 1985,
62 "tags": [ 63 "tags": [
@@ -65,13 +66,13 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
65 ["p", <pubkey1>, <relay_url>], 66 ["p", <pubkey1>, <relay_url>],
66 ["p", <pubkey2>, <relay_url>] 67 ["p", <pubkey2>, <relay_url>]
67 ], 68 ],
68 ... 69 // other fields...
69} 70}
70``` 71```
71 72
72A report flagging violence toward a human being as defined by ontology.example.com. 73A report flagging violence toward a human being as defined by ontology.example.com.
73 74
74```json 75```jsonc
75{ 76{
76 "kind": 1985, 77 "kind": 1985,
77 "tags": [ 78 "tags": [
@@ -80,13 +81,13 @@ A report flagging violence toward a human being as defined by ontology.example.c
80 ["p", <pubkey1>, <relay_url>], 81 ["p", <pubkey1>, <relay_url>],
81 ["p", <pubkey2>, <relay_url>] 82 ["p", <pubkey2>, <relay_url>]
82 ], 83 ],
83 ... 84 // other fields...
84} 85}
85``` 86```
86 87
87A moderation suggestion for a chat event. 88A moderation suggestion for a chat event.
88 89
89```json 90```jsonc
90{ 91{
91 "kind": 1985, 92 "kind": 1985,
92 "tags": [ 93 "tags": [
@@ -94,13 +95,13 @@ A moderation suggestion for a chat event.
94 ["l", "approve", "nip28.moderation"], 95 ["l", "approve", "nip28.moderation"],
95 ["e", <kind40_event_id>, <relay_url>] 96 ["e", <kind40_event_id>, <relay_url>]
96 ], 97 ],
97 ... 98 // other fields...
98} 99}
99``` 100```
100 101
101Assignment of a license to an event. 102Assignment of a license to an event.
102 103
103```json 104```jsonc
104{ 105{
105 "kind": 1985, 106 "kind": 1985,
106 "tags": [ 107 "tags": [
@@ -108,14 +109,14 @@ Assignment of a license to an event.
108 ["l", "MIT", "license"], 109 ["l", "MIT", "license"],
109 ["e", <event_id>, <relay_url>] 110 ["e", <event_id>, <relay_url>]
110 ], 111 ],
111 ... 112 // other fields...
112} 113}
113``` 114```
114 115
115Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author 116Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author
116is labeling their note as being related to Milan, Italy using ISO 3166-2. 117is labeling their note as being related to Milan, Italy using ISO 3166-2.
117 118
118```json 119```jsonc
119{ 120{
120 "kind": 1, 121 "kind": 1,
121 "tags": [ 122 "tags": [
@@ -123,15 +124,29 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
123 ["l", "IT-MI", "ISO-3166-2"] 124 ["l", "IT-MI", "ISO-3166-2"]
124 ], 125 ],
125 "content": "It's beautiful here in Milan!", 126 "content": "It's beautiful here in Milan!",
126 ... 127 // other fields...
128}
129```
130
131Author is labeling their note language as English using ISO-639-1.
132
133```jsonc
134{
135 "kind": 1,
136 "tags": [
137 ["L", "ISO-639-1"],
138 ["l", "en", "ISO-639-1"]
139 ],
140 "content": "English text",
141 // other fields...
127} 142}
128``` 143```
129 144
130Other Notes 145Other Notes
131----------- 146-----------
132 147
133When using this NIP to bulk-label many targets at once, events may be deleted and a replacement 148When using this NIP to bulk-label many targets at once, events may be requested for deletion using [NIP-09](09.md) and a replacement
134may be published. We have opted not to use parameterizable/replaceable events for this due to the 149may be published. We have opted not to use addressable/replaceable events for this due to the
135complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying, 150complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying,
136publishers SHOULD limit labeling events to a single namespace. 151publishers SHOULD limit labeling events to a single namespace.
137 152
@@ -154,8 +169,8 @@ be handled in some other way.
154 169
155 170
156Appendix: Known Ontologies 171Appendix: Known Ontologies
157------------------------- 172--------------------------
158 173
159Below is a non-exhaustive list of ontologies currently in widespread use. 174Below is a non-exhaustive list of ontologies currently in widespread use.
160 175
161- (social.ontolo.categories)[https://ontolo.social/] 176- [social.ontolo.categories](https://ontolo.social/)