Need help with bidirectional relationships with differing commentary on each side

58 views
Skip to first unread message

Sapphira Armageddos

unread,
Sep 2, 2018, 2:04:03 AM9/2/18
to leo-editor
Hi everyone!

Been cruising along since I started getting the hang of Leo and scripting for it. I'm having a bit of trouble figuring out what I should do to handle the problem below.

Say I have a piece of data that has the following relationships:

Character<-(is in)->Setting
Character<-(is in)->Story (separate file)
Species-(is a)->Character
Character-(parent of)->Character
Character<-(friend of)->Character

Right now I'm handling where a character is from and what species they are as clones under those category bins. But I'm not sure how I should represent family relationships or if they're in a certain story.

Stories I keep in separate files from my world building data Leo file.

My current solutions seem to be:

- UNLs: Straightforward, but can lead to needing to manually copy the individual UNLs to track bidirectional relationships across files. Also allows for commentary on those relationships.

- Backlinks: Tried the plugin, liked it, but, storing additional data for the relationship (name, commentary) requires an intermediate node. Sometimes that commentary differs per character despite it being the same relationship type. Also doesn't handle cross file bidirectional relationships.

Has anyone else encountered similar use cases? If so, what did you do to solve such? If not, what would you recommend to look into?

Thanks,
Sapphira

Sapphira Armageddos

unread,
Sep 2, 2018, 1:09:05 PM9/2/18
to leo-e...@googlegroups.com
Took the time to do a writeup for additional clarity. The below describes the kinds of relationships a character node in the Leo file I'm working on would have, but I'm not sure if this is the right approach. Currently relationships use UNLs to denote which characters they affect in their body text.

---

Relationship Nodes

A relationship node should only contain other relationships. This is to show that this relationship spawned other relationships.

Do not clone any nodes that aren't relationships into them.

There are a few kinds of relationships that are important for tracking a character.

Hierarchical Ties

Hierarchical ties show when one character came before the other, or when one character strictly has command over another.

Some examples of hierarchical ties include chains of command and families.

Technically this should be okay as a tree, but, characters contain a lot of child nodes that are not their offspring or subordinates.

Why?

Character nodes have data that only concern themselves.

It's also impossible to avoid cluttering all the involved people nodes if done that way.

Equal Ties

These are cyclical, but don't have differing data for each viewpoint.

Common examples of these include coworkers, friends, and classmates.

Asymmetric Ties

These are cyclical, but different data for each viewpoint.

Common examples of these include predator and prey; teacher and student; so on so forth.

Terry Brown

unread,
Sep 2, 2018, 2:52:28 PM9/2/18
to leo-e...@googlegroups.com
On Sat, 1 Sep 2018 23:04:03 -0700 (PDT)
Sapphira Armageddos <shadowkyo...@gmail.com> wrote:

> - UNLs: Straightforward, but can lead to needing to manually copy the
> individual UNLs to track bidirectional relationships across files.
> Also allows for commentary on those relationships.
>
> - Backlinks: Tried the plugin, liked it, but, storing additional data
> for the relationship (name, commentary) requires an intermediate
> node. Sometimes that commentary differs per character despite it
> being the same relationship type. Also doesn't handle cross file
> bidirectional relationships.

I think you've explored most of the obvious options. There's also a
tagging plugin, but not sure that would be relevant. The issue of
needing an intermediate node is a common one in graph relationships -
you could have edges that carry as much data as nodes, but just when
you think the problem's solved, the information on an edge becomes
complicated enough to make you want a hierarchical representation for
it, and now you want sub-nodes on an edge's info... :) Well, I've seen
it go that way anyway, I guess I'd say use an intermediate node - I
think the backlinks plugin shows the name of a couple of levels of
nodes in links, although I can't remember the details top of head.

Cheers -Terry

Edward K. Ream

unread,
Sep 4, 2018, 8:15:03 AM9/4/18
to leo-editor
On Sun, Sep 2, 2018 at 1:04 AM Sapphira Armageddos <shadowkyo...@gmail.com> wrote:

Say I have a piece of data that has the following relationships:

Character<-(is in)->Setting
Character<-(is in)->Story (separate file)
Species-(is a)->Character
Character-(parent of)->Character
Character<-(friend of)->Character

Mathematically, a relation is simply a set.  I'm not sure this actually helps you, but in Leo I think of a relation as a (non-cloned) organizer node containing all the (cloned) nodes in a set.  If you can recast your thinking along these lines using clones to represent (any) relation is straightforward.

Ccross-file clones do not exist, so instead of adding a clone of a node in a separate file, your relation/organizer nodes could contain @url nodes that can reference nodes in another file.

HTH.

Edward
Reply all
Reply to author
Forward
0 new messages