Here is my first stab at a generic data model for a neo4j relay. It has 5 types of nodes: NostrUser, NostrEvent, NostrEventTag, NostrRelay, and a node that stores personalized trust metrics called NostrUserWotMetricsCard. It also defines relationships to indicate replies (NIP-10), reposts (NIP-18), comments (NIP-22), and reactions (NIP-25). There are more details I could flesh out (like support for NIP-21, nostr:URI scheme) but this is a start. image Thoughts? @ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ @Jay

Replies (4)

(The NostrUserTrustMetricsCard would be useful for a WoT Service Provider like Brainstorm but not necessarily a part of a generic neo4j relay.)
I wonder if we can go lower level than that. Instead of calling "is reply of", just manage relationships with tag names. That means that the interpretation of kind + tag is left to the processor to parse later. Meaning that any event that cites other e tags gets a "citing event" relationship. Then the processor needs to identify if they are kind 1 to make them a "reply".
Are you saying the (single hop) IS_A_REPLY_TO relationship is unnecessary because the two events are already connected by the (two hop) path, that traverses the NostrEventTag node? This is a fair point. It would be a tradeoff: the reply_to relationship makes the db bigger, but a search for a single-hop path will always be more performant than a multi-hop path. It might be a scenario where it’s worth adding the extra path if we think there’s a high likelihood we’re going to want to fetch that thread. I could even envision scenarios where stale relationships like this get pruned if they’re old and unlikely to be needed, the goal being to decrease the footprint of the graph.