Add L tag, allow self-labeling, split namespaces out

This commit is contained in:
Jonathan Staab 2023-05-16 06:18:01 -07:00
parent 621340e267
commit 68b9331b62

56
32.md
View File

@ -27,16 +27,21 @@ or topics respectively.
Label Tag 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. - `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied.
- `#t/footstr` - the publisher thinks the given entity should have the `footstr` topic applied. - `["l", "<pubkey>", "#p"]` - the publisher things the given entity should be tagged with with `<pubkey>`
- `#p/<pubkey>` - the publisher things the given entity should be tagged with with `<pubkey>` - `["l", "D005528", "MeSH"]` - ["Foot"](https://meshb.nlm.nih.gov/record/ui?ui=D005528) from NIH's Medical Subject Headings vocabulary
- `MeSH/D005528` - ["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
- `GeoNames/3173435` - [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.
- `ISO-3166-2/IT-MI` - 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 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 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 ```json
{ {
"kind": 1985, "kind": 1985,
"tags": [ "tags": [
["e", <id>], ["L", "report"],
["l", "nudity"] ["l", "nudity", "report"],
["e", <id>]
], ],
"content": "", "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 ```json
{ {
@ -72,9 +81,14 @@ A single event can apply multiple labels to multiple targets to support mass-tag
["e", <id>], ["e", <id>],
["p", <id>], ["p", <id>],
["t", "chickens"], ["t", "chickens"],
["l", "permaculture"], ["L", "#t"]
["l", "permies"], ["L", "ugc"]
["l", "farming"] ["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": "", "content": "",
... ...
@ -87,7 +101,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
{ {
"kind": 1985, "kind": 1985,
"tags": [ "tags": [
["l", "#t/permies"], ["L", "#t"],
["l", "permies", "#t"],
["p", <pubkey1>], ["p", <pubkey1>],
["p", <pubkey2>] ["p", <pubkey2>]
], ],
@ -104,7 +119,8 @@ that's the case.
{ {
"kind": 1985, "kind": 1985,
"tags": [ "tags": [
["l", "#t/bitcoin"], ["L", "#t"],
["l", "bitcoin", "#t"],
["r", <relay_url>], ["r", <relay_url>],
["quality", 0.7], ["quality", 0.7],
["confidence", 0.2] ["confidence", 0.2]
@ -120,7 +136,8 @@ A plain review of a relay.
{ {
"kind": 1985, "kind": 1985,
"tags": [ "tags": [
["l", "review"], ["L", "review"],
["l", "relay", "review"],
["r", <relay_url>], ["r", <relay_url>],
["quality", 0.1] ["quality", 0.1]
], ],
@ -137,7 +154,8 @@ this spec provides for overlaying structured metadata on top of nostr.
{ {
"kind": 1985, "kind": 1985,
"tags": [ "tags": [
["l", "lightning/channel"], ["L", "my-lightning-nomenclature"],
["l", "channel", "my-lightning-nomenclature"],
["p", <pubkey1>], ["p", <pubkey1>],
["p", <pubkey2>] ["p", <pubkey2>]
], ],