This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_string = ''' | |
MATCH (c:Category) | |
RETURN c.category_name, SIZE(()-[:IN_CATEGORY]->(c)) AS inDegree | |
ORDER BY inDegree DESC LIMIT 20 | |
''' | |
top_cat_df = pd.DataFrame([dict(_) for _ in conn.query(query_string)]) | |
top_cat_df.head(20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result = conn.query(query_string) | |
for record in result: | |
print(record['c.category'], record['inDegree']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jupyterlab==3.0.7 | |
neo4j==4.2.1 | |
py2neo==2021.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jupyter/datascience-notebook | |
COPY requirements.txt ./ | |
RUN pip install -U pip | |
RUN pip install --no-cache-dir -r requirements.txt | |
ENV JUPYTER_ENABLE_LAB=yes | |
COPY --chown=${NB_UID}:${NB_GID} . /home/jovyan/work | |
WORKDIR /home/jovyan/work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
neo4j: | |
image: neo4j:4.2.3-enterprise | |
container_name: "neo-gds1.5" | |
volumes: | |
- $HOME/graph_data/my_data:/data | |
- $HOME/graph_data/my_data:/var/lib/neo4j/import | |
ports: |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"type":"node","id":"0","labels":["Node"],"properties":{"node_labels":["Subject"],"name":"oh bah mə","word_vec":[-0.1991655146019209,-0.05351358562798536,0.9228555063544845,-0.6886134662870478,-0.48122510045452427,-0.40170435813501726,-0.8155066138337055,0.8357354634523664,-0.2347006396854041,0.26097340188742835,-0.2814595678676137,-0.9936133169296157,-0.3826829229304849,-0.9808776175986211,-0.20284189377753714,0.5015809495104013,0.16734307094472212,-0.5867540626284398,-0.04434894351605689,-0.6723292743695024,0.9054839794937932,-0.6772277556586848,0.38326882164488585,-0.7193810327293506,0.007985495945301846,-0.6796721226933016,0.359004027656604,0.3961584634066617,0.9789458680359799,0.3723659161768318,0.6861445958760459,0.39929387851793496,-0.3740958123352931,0.07034310049505343,0.5782312986452309,0.27844665689970527,0.04389886470438653,0.38707344473628447,-0.35045714426886465,-0.9373177969255766,-0.12407924520086833,-0.5629778221312765,-0.9617121312902264,-0.587069845901774,0.7978564493099858,0.92225653009432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9.5-slim-buster | |
EXPOSE 8501 | |
WORKDIR /app | |
COPY requirements.txt . | |
RUN pip install -U pip | |
RUN pip install --no-cache-dir -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -v $HOME/graph_data/data:/data -v $HOME/graph_data/gameofthrones:/var/lib/neo4j/import neo4j:latest bin/neo4j-admin import --nodes=import/got-s1-nodes.csv --relationships=import/got-s1-edges.csv | |
&& | |
docker run -p7474:7474 -p7687:7687 -v $HOME/graph_data/data:/data -v $HOME/graph_data/gameofthrones:/var/lib/neo4j/import --env NEO4J_AUTH=neo4j/test neo4j:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create constraints | |
CREATE CONSTRAINT papers IF NOT EXISTS ON (p:Paper) ASSERT p.id IS UNIQUE; |