Categorygithub.com/cloudprivacylabs/lsa-neo4j
modulepackage
1.0.0
Repository: https://github.com/cloudprivacylabs/lsa-neo4j.git
Documentation: pkg.go.dev

# README

GoDoc Go Report Card

Neo4J Storage Driver for Layered Schemas

This Go package contains the Neo4J graph database driver to store graphs generated by layered schemas. It also has a command line tool that can be paired with layers command line tool to ingest data and store in a Neo4J database.

Graph Mapping

The data ingested using layered schemas is represented as a labeled property graph. There are some minor differences between the Neo4J graph representation and a more generic labeled property graph used by labeled schemas, so a mapping is necessary. This section describes how that mapping is done.

  • Every node of a data graph is stored as a Neo4J node.

    • The data graph node id is stored as the string property neo4j_id
    • All node properties of the data graph are stored as Neo4j node properties, with string or []string values
    • The types associated with a data graph node are stored as Neo4j node labels.
  • Every edge of a data graph is stored as a Neo4J edge.

    • The graph node edge label is stored as the Neo4J edge label
    • All edge properties of the graph node are stored as string or []string property values

As an example:

Data Graph:
+----------------------------+                                  +---------------------------+
|  @id = node_1              |                                  |  @id = node_2             |
+----------------------------+                                  +---------------------------+
|  @type = [ type1, type2 ]  |-------- edgeLabel      --------->|  @type = [ type3, type4 ] |
|  property = value          |         edgeProperty = value     |  property2 = value2       +
+----------------------------+                                  +---------------------------+


Neo4J:
+---------------------+                                      +---------------------------+
|  :type1 :type2      |                                      |     :type3 :type4         |
+-------------------- +                                      +---------------------------+
|  neo4j_id = node_1  |----------- :edgeLabel -------------->|   neo4j_id = node_2       |
|                     |             edgeProperty = value     |   property2 = value2      |
|  property = value   |                                      +---------------------------+
+---------------------+

Command Line Tool

To build the command line tool, use the Go build system:

cd lsaneo
go mod tidy
go build

That should build the lsaneo binary for your platform

You can pair lsaneo with the layers tool to ingest data and store graphs:

layers ingest csv --schema myschema.json inputdata.csv | lsaneo create --user userName --pwd password --uri dburi

You can also store saved graph files (in JSON-LD flattened format):

lsaneo create --user userName --pwd password --uri dbUri <fileName>

# Packages

No description provided by the author

# Functions

ID is entity id of entity root.
BuildNodePropertiesAfterLoad is during the loading of nodes from database.
No description provided by the author
Compact a graph for storing in the database.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InitTrie will create a new Trie.
Insert creates or adds to a graph on a database; does not check existing nodes.
No description provided by the author
LinkMergedEntities will find the new entities from the delta and link them.
No description provided by the author
No description provided by the author
No description provided by the author
neo4jValueToNativeValue converts a neo4j value to a native go value.
No description provided by the author
No description provided by the author
oldNodeset is nodeset pulled from DB.
No description provided by the author
No description provided by the author
Called before SetNodeValue, input contains neo4j native values.
Determine if value is writeable.

# Constants

No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Trie represents a trie and has a pointer to the root node.
Node represents each node in the trie.
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author