Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cloudprivacylabs/lsa-neo4j
Neo4j storage for layered schemas
https://github.com/cloudprivacylabs/lsa-neo4j
graph graph-database neo4j
Last synced: about 2 months ago
JSON representation
Neo4j storage for layered schemas
- Host: GitHub
- URL: https://github.com/cloudprivacylabs/lsa-neo4j
- Owner: cloudprivacylabs
- License: apache-2.0
- Created: 2021-10-26T23:07:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-04T19:23:49.000Z (over 1 year ago)
- Last Synced: 2024-11-14T14:26:38.593Z (about 2 months ago)
- Topics: graph, graph-database, neo4j
- Language: Go
- Homepage:
- Size: 646 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GoDoc](https://godoc.org/github.com/cloudprivacylabs/lsa-neo4j?status.svg)](https://godoc.org/github.com/cloudprivacylabs/lsa-neo4j)
[![Go Report Card](https://goreportcard.com/badge/github.com/cloudprivacylabs/lsa-neo4j)](https://goreportcard.com/report/github.com/cloudprivacylabs/lsa-neo4j)# 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 valuesAs 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
```