mcollina / mcollina/levelgraph-recursive

Can this be made to work with more complex graph?

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I have family tree data in a levelgraph structured like:
```
{subject: INDI, predicate: 'child_of', object: FAMI}
{subject: FAMI, predicate: 'has_child', object: INDI}

{subject: INDI, predicate: 'marriage', object: FAMI}
{subject: FAMI, predicate: 'parent', object: INDI}
```
where INDI is a unique id for an individual and FAMI is a unique id for a family group the consists of 0..2 'parent' and 0..n 'has_child'.

So for example:
db.get({subject: 'I0169', predicate: 'child_of'}) returns the family group where 'I0169' is a child, say 'F0917'
db.get({subject: 'F0917', predicate: 'has_child'}) returns all the children of 'F0917'
db.get({subject: 'F0917', predicate: 'parent'}) returns the parents of this family group
db.get({subject: 'I0169', predicate: 'marriage'}) returns the family group id for each marriage of 'I0169'

I'm looking to get 3 things from the graph:

1. list of descendants of an INDI
2. list of ancestors of an INDI
3. the shortest path relationship from INDI_A to INDI_B

for ancestor and descendants list if would be nice to also get the level that each result is at so level is incremented/decremented as you move up/down through the tree.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the repository's existing breadth-first and depth-first traversal entry points and how they query LevelGraph. Define how family and individual nodes should be traversed, then specify results for descendants, ancestors with levels, and shortest paths before implementing and testing the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.