diff options
Diffstat (limited to '32.md')
| -rw-r--r-- | 32.md | 77 |
1 files changed, 7 insertions, 70 deletions
| @@ -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 | ||
| 9 | A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases: | 9 | A 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 | ||
| 15 | Label Target | 11 | Label Target |
| 16 | ---- | 12 | ---- |
| @@ -26,18 +22,17 @@ Label Tag | |||
| 26 | This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. | 22 | This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. |
| 27 | A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature | 23 | A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature |
| 28 | external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD | 24 | external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD |
| 29 | ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation. Some examples: | 25 | ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation. |
| 30 | 26 | ||
| 31 | Namespaces starting with `#` indicate that the label target should be associated with the label's value. | 27 | Namespaces starting with `#` indicate that the label target should be associated with the label's value. |
| 32 | This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc. | 28 | This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc. |
| 33 | 29 | ||
| 30 | Some 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 |
| 43 | namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace | 38 | namespace 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' | |||
| 65 | Example events | 60 | Example events |
| 66 | -------------- | 61 | -------------- |
| 67 | 62 | ||
| 68 | A single event can apply multiple labels to multiple targets to support mass-tagging. Multiple | ||
| 69 | namespaces 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 | |||
| 92 | A suggestion that multiple pubkeys be associated with the `permies` topic. | 63 | A 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 | ||
| 108 | A review of a relay, as relates to certain topics, including additional dimensions. The author | 79 | A review of a relay. |
| 109 | is indicating here that `relay_url` is related to the bitcoin topic, but they're not very sure | ||
| 110 | that'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 | |||
| 125 | A 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 | ||
| 140 | A more abstract use case: defining an edge in a graph structure, in this case identifying | ||
| 141 | a lightning channel that is open between two pubkeys. This just demonstrates the flexibility | ||
| 142 | this 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 | |||
| 158 | Publishers can self-label by adding `l` tags to their own non-1985 events. | 94 | Publishers 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 | ||
| 175 | When using this NIP to bulk-label many targets at once, events may be deleted and a replacement | 111 | When using this NIP to bulk-label many targets at once, events may be deleted and a replacement |
| 176 | may be published. We have opted not to use parameterizable/replaceable events for this due to the | 112 | may be published. We have opted not to use parameterizable/replaceable events for this due to the |
| 177 | complexity in coming up with a standard `d` tag. | 113 | complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying, |
| 114 | publishers SHOULD limit labeling events to a single namespace. | ||
| 178 | 115 | ||
| 179 | Before creating a vocabulary, explore how your use case may have already been designed and | 116 | Before creating a vocabulary, explore how your use case may have already been designed and |
| 180 | imitate that design if possible. Reverse domain name notation is encouraged to avoid | 117 | imitate that design if possible. Reverse domain name notation is encouraged to avoid |