cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Peter's Hello from Seattle

Hello community!

I'm new to neo4j and am endeavoring to integrate neo4j into an existing web project, somehow.

Existing app resembles a tree structure, illustrated below

Tree app illustration:

AAAAA
	CCC(BBB)
	DDD(BBBBB)
	AAA
BBBBB
	BBB
  • In the tree app Records may have one maximum parent.

  • In the tree app Records are identified by a unique set of characters such as AAAA, or CCC(BBB), or DDD(BBBBB) , etc

  • In the tree app Records may optionally "point" to another Record to indicate some dependency. This is illustrated by the contents in parenthesis "()"

  • In the tree app CCC is a child of AAAAA through a par/chil relationship. With Neo4j this would mean that the edge between CCC-AAAAA translates to "IS_A_CHILD_OF"

  • In the tree app CCC "points" to BBB through a second custom relationship. With Neo4j this would mean that the edge between CCC-BBB translates to "HAS_SOME_DEPENDENCY_WITH"

  • Note that BBB is its own Record, and IS_A_CHILD_OF BBBBB

How may a javascript developer embed neo4j as javascript such that it represents these tree app Records (which are also provided below as JSON) ? Hopefully neo4j can be embedded as JS, or used in JS, and can produce an interactive graph (view, search, filter) of this data that display the edges that I expect below such as IS_A_CHILD_OF and HAS_SOME_DEPENDENCY_WITH.

Tree App records as JSON:

{
  "status": 0,
  "result": {
    "nodes": [
      {
        "id": "AAAAA",
        "parent": ""
      },
      {
        "id": "CCC",
        "parent": "AAAAA"
      },
      {
        "id": "DDD",
        "parent": "AAAAA"
      },
      {
        "id": "AAA",
        "parent": "AAAAA"
      },
      {
        "id": "BBBBB",
        "parent": ""
      },
      {
        "id": "BBB",
        "parent": "BBBBB"
      },
      {
        "id": "CCC(BBB)",
        "parent": "AAAAA"
      },
      {
        "id": "DDD(BBBBB)",
        "parent": "AAAAA"
      },
      
    ],
    

  }
}

If neo4j were integrated into my web app (tree app), I would expect the new graphical app's edges to be similar to the following::

"edges": [
      {
        "from": "CCC(BBB)", //this represents IS_A_CHILD_OF
        "to": "AAAAA"
      },
      {
        "from": "DDD(BBBBB)", //this represents IS_A_CHILD_OF
        "to": "AAAAA"
      },
      {
        "from": "AAA", //this represents IS_A_CHILD_OF
        "to": "AAAAA"
      },
      {
        "from": "BBB", //this represents IS_A_CHILD_OF
        "to": "BBBBB"
      },
      {
        "from": "CCC", //this represents HAS_SOME_DEPENDENCY_WITH !!!!!!!!
        "to": "BBB"
      },
      {
        "from": "DDD", //this represents HAS_SOME_DEPENDENCY_WITH !!!!!!!!
        "to": "BBBBB"
      },
    ]

Any guidance is very appreciated!

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online