From 68b9331b624c8fcaa584c8e4b113793981c9ff80 Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Tue, 16 May 2023 06:18:01 -0700 Subject: [PATCH] Add L tag, allow self-labeling, split namespaces out --- 32.md | 56 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/32.md b/32.md index 253a5045..f5557ca9 100644 --- a/32.md +++ b/32.md @@ -27,16 +27,21 @@ or topics respectively. Label Tag ---- -This NIP introduces a new tag `l` which denotes a label. A label MAY be an unqualified string indicating the type of content based on convention, a qualified string referring to a tag type within nostr, or a qualified string referring to a nomenclature external to nostr. Some examples: +This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature external to nostr defined either formally or by convention. Some examples: -- `review` - the publisher is leaving a review about the given entity. -- `#t/footstr` - the publisher thinks the given entity should have the `footstr` topic applied. -- `#p/` - the publisher things the given entity should be tagged with with `` -- `MeSH/D005528` - ["Foot"](https://meshb.nlm.nih.gov/record/ui?ui=D005528) from NIH's Medical Subject Headings vocabulary -- `GeoNames/3173435` - [Milan, Italy](https://www.geonames.org/3173435/milan.html) using the GeoNames coding system -- `ISO-3166-2/IT-MI` - Milano, Italy using ISO 3166-2. +- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied. +- `["l", "", "#p"]` - the publisher things the given entity should be tagged with with `` +- `["l", "D005528", "MeSH"]` - ["Foot"](https://meshb.nlm.nih.gov/record/ui?ui=D005528) from NIH's Medical Subject Headings vocabulary +- `["l", "3173435", "GeoNames"]` - [Milan, Italy](https://www.geonames.org/3173435/milan.html) using the GeoNames coding system +- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2. +- `["l", "relay", "review"]` - the publisher is leaving a review about a relay. -As much as possible, fully-qualified labels should be used. +`L` tags containing the label namespaces MUST be included in order to support searching by +namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace +MAY be used when the label content is provided by an end user. + +`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events +with a kind other than 1985, labels refer to the event itself. Other Tags ----- @@ -49,21 +54,25 @@ The label event MAY include a `confidence` tag with a value of 0 to 1. This indi Example events -------------- -A report that an event contains nudity. +A report that an event contains nudity. Note that NIP 56 is preferred for reporting content +to clients, while labels are recommended for supporting distributed content moderation use +cases. ```json { "kind": 1985, "tags": [ - ["e", ], - ["l", "nudity"] + ["L", "report"], + ["l", "nudity", "report"], + ["e", ] ], "content": "", ... } ``` -A single event can apply multiple labels to multiple targets to support mass-tagging. +A single event can apply multiple labels to multiple targets to support mass-tagging. Multiple +namespaces may be used at the same time. ```json { @@ -72,9 +81,14 @@ A single event can apply multiple labels to multiple targets to support mass-tag ["e", ], ["p", ], ["t", "chickens"], - ["l", "permaculture"], - ["l", "permies"], - ["l", "farming"] + ["L", "#t"] + ["L", "ugc"] + ["L", "com.example.labels"] + ["l", "chickens", "#t"], + ["l", "user generated content", "ugc"], + ["l", "permaculture", "com.example.labels"], + ["l", "permies", "com.example.labels"], + ["l", "farming", "com.example.labels"], ], "content": "", ... @@ -87,7 +101,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic. { "kind": 1985, "tags": [ - ["l", "#t/permies"], + ["L", "#t"], + ["l", "permies", "#t"], ["p", ], ["p", ] ], @@ -104,7 +119,8 @@ that's the case. { "kind": 1985, "tags": [ - ["l", "#t/bitcoin"], + ["L", "#t"], + ["l", "bitcoin", "#t"], ["r", ], ["quality", 0.7], ["confidence", 0.2] @@ -120,7 +136,8 @@ A plain review of a relay. { "kind": 1985, "tags": [ - ["l", "review"], + ["L", "review"], + ["l", "relay", "review"], ["r", ], ["quality", 0.1] ], @@ -137,7 +154,8 @@ this spec provides for overlaying structured metadata on top of nostr. { "kind": 1985, "tags": [ - ["l", "lightning/channel"], + ["L", "my-lightning-nomenclature"], + ["l", "channel", "my-lightning-nomenclature"], ["p", ], ["p", ] ],