From 239ae10579b5c89ee42199c8ff39db709acbcaa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Wed, 26 Jul 2023 09:24:44 -0300 Subject: [PATCH 1/4] feat(nips): querying events by tags structure --- 100.md | 26 ++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 27 insertions(+) create mode 100644 100.md diff --git a/100.md b/100.md new file mode 100644 index 0000000000..2a8222b7e4 --- /dev/null +++ b/100.md @@ -0,0 +1,26 @@ +NIP-100 +======= + +Querying Events by Tags Structure +--------------------------------- + +`draft` `optional` `author:fernandolguevara` `requires:nip-12` + +This NIP allows clients to query events from relays where a specific tag is present in the event's structure. + +The filter condition matches if there is at least one tag name in common with the filter and event. + +Example Subscription Filter +--------------------------- + +Below is an example filter that matches events with a `g` tag in their structure: + +```json +{ + "tags": ["g"] +} +``` + +Suggested Use Cases +------------------- +One of the suggested use cases for this NIP is for location-specific events. Clients can utilize the provided filter example to locate events with specific location-related tags, regardless of how the location information has been stored in the events. \ No newline at end of file diff --git a/README.md b/README.md index 1360190a9f..e41627bbe5 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-94: File Metadata](94.md) - [NIP-98: HTTP Auth](98.md) - [NIP-99: Classified Listings](99.md) +- [NIP-100: Querying Events by Tags Structure](100.md) ## Event Kinds From 5f77c0e254c8daaea042af89d87b73cb0128e790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Wed, 26 Jul 2023 09:58:44 -0300 Subject: [PATCH 2/4] feat(nip100): ask for empty/non present tags --- 100.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/100.md b/100.md index 2a8222b7e4..306fe6ffc2 100644 --- a/100.md +++ b/100.md @@ -21,6 +21,15 @@ Below is an example filter that matches events with a `g` tag in their structure } ``` +Other filter example that matches events with an empty/non present `e` tag in their structure: + + +```json +{ + "tags": ["!e"] +} +``` + Suggested Use Cases ------------------- One of the suggested use cases for this NIP is for location-specific events. Clients can utilize the provided filter example to locate events with specific location-related tags, regardless of how the location information has been stored in the events. \ No newline at end of file From d1ec51a4a16a248c2816357a6bbf5f36f6ee1af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Wed, 26 Jul 2023 10:14:58 -0300 Subject: [PATCH 3/4] rewording to tags presence --- 100.md | 15 ++++++++++----- README.md | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/100.md b/100.md index 306fe6ffc2..6d2f3efc3c 100644 --- a/100.md +++ b/100.md @@ -1,19 +1,25 @@ NIP-100 ======= -Querying Events by Tags Structure +Querying Events by Tags Presence --------------------------------- `draft` `optional` `author:fernandolguevara` `requires:nip-12` -This NIP allows clients to query events from relays where a specific tag is present in the event's structure. +This NIP allows clients to query events from relays based on the presence or non-presence of specific tags. +### Presense: The filter condition matches if there is at least one tag name in common with the filter and event. +### Non-Presence: +The filter condition matches if there is at least one tag in the filter that are not present in the event. + Example Subscription Filter --------------------------- -Below is an example filter that matches events with a `g` tag in their structure: +Below are some example filters that demonstrate tag presence and non-presence: + +1. Filter to match events with a `g` tag: ```json { @@ -21,8 +27,7 @@ Below is an example filter that matches events with a `g` tag in their structure } ``` -Other filter example that matches events with an empty/non present `e` tag in their structure: - +2. Filter to match events without the presence of the `e` tag: ```json { diff --git a/README.md b/README.md index e41627bbe5..029e503b70 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-94: File Metadata](94.md) - [NIP-98: HTTP Auth](98.md) - [NIP-99: Classified Listings](99.md) -- [NIP-100: Querying Events by Tags Structure](100.md) +- [NIP-100: Querying Events by Tags Presence](100.md) ## Event Kinds From 5a5e36b5170bd07db2ca5214826e4dcfdd934fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Wed, 26 Jul 2023 10:30:07 -0300 Subject: [PATCH 4/4] rewording non-presence to absence --- 100.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/100.md b/100.md index 6d2f3efc3c..c72eda4115 100644 --- a/100.md +++ b/100.md @@ -6,18 +6,18 @@ Querying Events by Tags Presence `draft` `optional` `author:fernandolguevara` `requires:nip-12` -This NIP allows clients to query events from relays based on the presence or non-presence of specific tags. +This NIP allows clients to query events from relays based on the presence or absence of specific tags. ### Presense: The filter condition matches if there is at least one tag name in common with the filter and event. -### Non-Presence: +### Absence: The filter condition matches if there is at least one tag in the filter that are not present in the event. Example Subscription Filter --------------------------- -Below are some example filters that demonstrate tag presence and non-presence: +Below are some example filters that demonstrate tag presence and absence: 1. Filter to match events with a `g` tag: