📋
Philanthrolab
  • Philanthrolab Technical Docs
  • SSN Component Library
  • Datalabs
    • Introduction
    • Architecture
    • Schema Dictionary
    • Project Status/Timeline
  • Social Safety Network
    • Introduction
    • Architecture
    • Schema Dictionary
    • Project Status/Timeline
      • V1
      • V2
  • SSN for Organisations
    • Introduction
    • Features and user stories
    • Architecture
    • Schema Dictionary
    • Project Status/Timeline
  • Developer Resources
    • Frontend Project Guide
    • Coding Guide
    • Creating a Neo4j instance on GCP vm
    • Set up local deploy for staging and production envs
    • Install ElasticSearch on GCP
    • ElasticSearch Query
    • ETL Strategy for Neo4j Database: Scraping, Transformation, and Enrichment
    • ETL Checklist
  • SSN Authentication
    • Introduction
    • Architecture
    • Schema
  • SSN Admin Dashboard
    • Introduction
    • Architecture
  • SSN Job Board
    • Introduction
    • Architecture
    • User Stories
    • Schema Dictionary
  • SSN Eligibility criteria AI feature
    • Introduction
    • Working Principles
    • Architecture
    • Schema Dictionary
  • DataBase Repopulation
    • Introduction
    • Proposed Solution
    • DB Details
    • Batch 1
  • LLM INTEGRATION
    • LLM Strategy and Implementation
Powered by GitBook
On this page
  • Set up Docker in VM
  • Create Neo4J image
  • Install APOC on Neo4j Docker
  • Install apoc jar file:
  • Install/start neo4j with plugins directory enabled:
  • Full text search on Neo4j
  • Resources and Links

Was this helpful?

  1. Developer Resources

Creating a Neo4j instance on GCP vm

To create a single instance of Neo4j in a GC virtual machine, follow the steps below:

Set up Docker in VM

  • SSH into your vm

  • Update apt-get

    sudo apt-get update
  • Download the following

    sudo apt-get install     apt-transport-https     ca-certificates     curl     gnupg-agent     software-properties-common
  • Add docker key

    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
  • Add fingerprint:

    sudo apt-key fingerprint 0EBFCD88
  • Add the following:

    sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
  • Update app-get again

    sudo apt-get update
  • Now install docker

    sudo apt-get install docker-ce docker-ce-cli containerd.io

Create Neo4J image

  • Run commands to create an instance:

    sudo docker run --name ssn-neo4j-production -p7474:7474 -p7687:7687 -d -v $HOME/neo4j/data:/data -v $HOME/neo4j/logs:/logs -v $HOME/neo4j/import:/var/lib/neo4j/import -v $HOME/neo4j/plugins:/plugins --env NEO4J_AUTH=neo4j/test neo4j:latest

    Or Start an existing instance:

       sudo docker start testneo4j
  • View Neo4j in browser by navigating to http://<vm external ip>:7474/browser

  • You can change the password from the browser console by running the following command:

    :SERVER change-password

Install APOC on Neo4j Docker

Install apoc jar file:

mkdir plugins
pushd plugins
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/4.1.0.6/apoc-4.1.0.6-all.jar
popd

Install/start neo4j with plugins directory enabled:

sudo docker run --name ssn-cbo-staging --rm -d -e NEO4J_AUTH=neo4j/test -p 7474:7474 -v $PWD/plugins:/plugins -p 7687:7687 neo4j:4.1

Full text search on Neo4j

  • Create a FTS index on neo4j browser or via lib

    CALL db.index.fulltext.createNodeIndex('services', ['Service'], ['name', 'alternate_name', 'description', 'taxonomy', 'program_title', 'eligibility', 'service_area', 'languages', 'address', 'region', 'city', 'country', 'zip_code','state'])
  • Search based on constraints. For instance to search for food stamps in and only in zip_code 76104 do the following:

    CALL db.index.fulltext.queryNodes('services', 'zip_code:76104 AND food stamps')
  • Add LIMIT, SKIP and ORDER BY params:

    CALL db.index.fulltext.queryNodes('services', 'zip_code:76104 OR food stamps') YIELD node, score
    RETURN node as services, score
    ORDER BY node.name
    SKIP 1
    LIMIT 2

Resources and Links

PreviousCoding GuideNextSet up local deploy for staging and production envs

Last updated 4 years ago

Was this helpful?

Ref:

Uses HERE

Middleware:

Remove duplicate nodes in Neo4j:

https://graphaware.com/neo4j/2019/01/11/neo4j-full-text-search-deep-dive.html
https://developer.here.com/projects/PROD-9ad03b9a-5f17-41a1-89f6-8e337f469983/usage
https://expressjs.com/en/guide/using-middleware.html#middleware.router
https://gist.github.com/jruts/fe782ff2531d509784a24b655ad8ae76
BUILDING WITH GRANDSTACK: GraphQL, React, Apollo, and Neo4j