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:
Diffstat (limited to '32.md')
-rw-r--r--32.md77
1 files changed, 7 insertions, 70 deletions
diff --git a/32.md b/32.md
index b147385..ddd364a 100644
--- a/32.md
+++ b/32.md
@@ -6,11 +6,7 @@ Labeling
6 6
7`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay` 7`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay`
8 8
9A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases: 9A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, from distributed moderation and content recommendations to reviews and ratings.
10
11- Distributed moderation and content recommendations
12- Reviews and ratings
13- Definition of edges in a graph structure
14 10
15Label Target 11Label Target
16---- 12----
@@ -26,18 +22,17 @@ Label Tag
26This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. 22This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace.
27A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature 23A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature
28external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD 24external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD
29ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation. Some examples: 25ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation.
30 26
31Namespaces starting with `#` indicate that the label target should be associated with the label's value. 27Namespaces starting with `#` indicate that the label target should be associated with the label's value.
32This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc. 28This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc.
33 29
30Some examples:
31
34- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied. 32- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied.
35- `["l", "<pubkey>", "#p"]` - the publisher thinks the given entity is related to `<pubkey>` 33- `["l", "<pubkey>", "#p"]` - the publisher thinks the given entity is related to `<pubkey>`
36- `["l", "D005528", "MeSH"]` - ["Foot"](https://meshb.nlm.nih.gov/record/ui?ui=D005528) from NIH's Medical Subject Headings vocabulary
37- `["l", "3173435", "GeoNames"]` - [Milan, Italy](https://www.geonames.org/3173435/milan.html) using the GeoNames coding system
38- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2. 34- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2.
39- `["l", "VI-hum", "com.example.ontology"]` - Violence toward a human being as defined by ontology.example.com. 35- `["l", "VI-hum", "com.example.ontology"]` - Violence toward a human being as defined by ontology.example.com.
40- `["l", "relay/review", "com.example.ontology"]` - the publisher is leaving a review about a relay, as defined by ontology.example.com.
41 36
42`L` tags containing the label namespaces MUST be included in order to support searching by 37`L` tags containing the label namespaces MUST be included in order to support searching by
43namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace 38namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace
@@ -65,30 +60,6 @@ explanation of why something was labeled the way it was, should go in the event'
65Example events 60Example events
66-------------- 61--------------
67 62
68A single event can apply multiple labels to multiple targets to support mass-tagging. Multiple
69namespaces may be used at the same time.
70
71```json
72{
73 "kind": 1985,
74 "tags": [
75 ["e", <id>, <relay_url>],
76 ["p", <id>, <relay_url>],
77 ["t", "chickens"],
78 ["L", "#t"]
79 ["L", "ugc"]
80 ["L", "com.example.labels"]
81 ["l", "chickens", "#t"],
82 ["l", "user generated content", "ugc"],
83 ["l", "permaculture", "com.example.labels"],
84 ["l", "permies", "com.example.labels"],
85 ["l", "farming", "com.example.labels"],
86 ],
87 "content": "",
88 ...
89}
90```
91
92A suggestion that multiple pubkeys be associated with the `permies` topic. 63A suggestion that multiple pubkeys be associated with the `permies` topic.
93 64
94```json 65```json
@@ -105,24 +76,7 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
105} 76}
106``` 77```
107 78
108A review of a relay, as relates to certain topics, including additional dimensions. The author 79A review of a relay.
109is indicating here that `relay_url` is related to the bitcoin topic, but they're not very sure
110that's the case.
111
112```json
113{
114 "kind": 1985,
115 "tags": [
116 ["L", "#t"],
117 ["l", "bitcoin", "#t", "{\"quality\": 0.7, \"confidence\": 0.2}"],
118 ["r", <relay_url>]
119 ],
120 "content": "I think this relay is mostly just bitcoiners.",
121 ...
122}
123```
124
125A plain review of a relay.
126 80
127```json 81```json
128{ 82{
@@ -137,24 +91,6 @@ A plain review of a relay.
137} 91}
138``` 92```
139 93
140A more abstract use case: defining an edge in a graph structure, in this case identifying
141a lightning channel that is open between two pubkeys. This just demonstrates the flexibility
142this spec provides for overlaying structured metadata on top of nostr.
143
144```json
145{
146 "kind": 1985,
147 "tags": [
148 ["L", "my-lightning-nomenclature"],
149 ["l", "channel", "my-lightning-nomenclature"],
150 ["p", <pubkey1>, <relay_url>],
151 ["p", <pubkey2>, <relay_url>]
152 ],
153 "content": "<channel_id>",
154 ...
155}
156```
157
158Publishers can self-label by adding `l` tags to their own non-1985 events. 94Publishers can self-label by adding `l` tags to their own non-1985 events.
159 95
160```json 96```json
@@ -174,7 +110,8 @@ Other Notes
174 110
175When using this NIP to bulk-label many targets at once, events may be deleted and a replacement 111When using this NIP to bulk-label many targets at once, events may be deleted and a replacement
176may be published. We have opted not to use parameterizable/replaceable events for this due to the 112may be published. We have opted not to use parameterizable/replaceable events for this due to the
177complexity in coming up with a standard `d` tag. 113complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying,
114publishers SHOULD limit labeling events to a single namespace.
178 115
179Before creating a vocabulary, explore how your use case may have already been designed and 116Before creating a vocabulary, explore how your use case may have already been designed and
180imitate that design if possible. Reverse domain name notation is encouraged to avoid 117imitate that design if possible. Reverse domain name notation is encouraged to avoid