Skip to content

neo4j-graph-examples/legis-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

legisgraph icon blue

Legis Graph Graph Example

Description: US Congress modeled as a Graph - bills, votes, members, and more

model
Figure 1. Model
example
Figure 2. Example
Example Query:
MATCH (s:State {code: $state})<-[:REPRESENTS]-(l:Legislator)
RETURN l.firstName+' '+l.lastName as name

Setup

This is for Neo4j version: 3.5,4.0

Rendered guide available via: :play https://guides.neo4j.com/sandbox/legis-graph/index.html

Load graph data via the following:

Data files: import/*.csv

Import flat files (csv, json, etc) using Cypher’s LOAD CSV, APOC library, or other methods.

Dump file: data/legis-graph-40.dump

  • Drop the file into the Files section of a project in Neo4j Desktop. Then choose the option to Create new DBMS from dump option from the file options.

  • Use the neo4j-admin tool to load data from the command line with the command below.

bin/neo4j-admin load --from data/legis-graph-40.dump [--database "database"]

Data load script: scripts/legis-graph.cypher

bin/cypher-shell -u neo4j -p "password" -f scripts/legis-graph.cypher [-d "database"]

Or import in Neo4j Browser by dragging or pasting the content of scripts/legis-graph.cypher.

Code Examples

Feedback

Feel free to submit issues or pull requests for improvement on this repository.