Giter Site home page Giter Site logo

xyjigsaw / knowledge-graph-and-visualization-demo Goto Github PK

View Code? Open in Web Editor NEW
193.0 3.0 52.0 9.4 MB

There are 2D-Search and 3D-Graph-View for knowledge graph visualization.

License: MIT License

Python 59.97% HTML 40.03%
knowledge-graph python javascript neo4j

knowledge-graph-and-visualization-demo's Introduction

Knowledge-Graph-Visualization-Demo

Archive

Neo4j powered KG visulization

There are 2D-Search and 3D-Graph-View for knowledge graph visualization. KG data (COVID-19 traces data from tencent) csv files are in folder Import2Neo4j.


Folder List


Folder: Import2Neo4j

Neo4j Configuration

  • Database Name:COVID-19
  • Username:neo4j
  • Password:123456

Steps

  1. Put all CSV files into the Import folder shown below

  1. CYPHER4csvImport: Input the eight statements on by one in this file on the Neo4j console

  2. After importing, you will see:

  • Node Label: (EVENT, LOCATION, PATIENT, TOPIC)
  • Relationship Types: (EVENT_LOCATION, EVENT_TOPIC, PATIENT_EVENT, PATIENT_LOCATION)

Folder: Neo4j-3D

It is based on js using 3d-force-graph, which can run directly.

Preview

index.html Setting

  1. Configure the server address (no port number required), Neo4j username, and password in the first red box shown above.
  2. The second box is the CYPHER statement, which limits the return number to 20000. The return value is json, and the search box can be added to HTML later.

Noted problem

issue2


Folder: KG-Search-Flask

  • Provide KG graph and triple lists

  • The front-end code and back-end code have been separated.

Requirements

  • flask
  • py2neo
  • neo4j
  • cpca
  • jieba

Run

cd KG-Search-Flask
unzip static.zip

python app.py

Address: 127.0.0.1:5000

Search

Support 3 disorder keywords (space seperated) at most

Examples

  • 1 keyword
    • 江苏苏州
    • 确诊
    • 王某
  • 2 keywords
    • 隔离 苏州
    • 苏州 男性
    • 苏州 2月2日
    • 2月2日 王某
  • 3 keywords
    • 2月2日 苏州 确诊

JSON API

GET EXAMPLE

  • 127.0.0.1:5000/api/2月2日 苏州 确诊

POST EXAMPLE

  • 127.0.0.1:5000/api

body data: {"string": "2月2日 苏州 确诊"}

Preview


Folder: KG-Search-Django

  • Django Version for KG-Search

  • Provide KG graph and triple lists

  • The front-end code and back-end code are not separated.

  • Flask version is recommended.

Run

cd KG-Search-Django/web
unzip static.zip
cd ..

python manage.py runserver

Address: 127.0.0.1:8000


knowledge-graph-and-visualization-demo's People

Contributors

xyjigsaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

knowledge-graph-and-visualization-demo's Issues

最后导入关系的时候有个小问题

``
:auto USING PERIODIC COMMIT 5000
LOAD CSV WITH HEADERS FROM "file:///patient-location.csv" AS line
MATCH (FROM:PATIENT{p_id:line.p_id}), (TO:LOCATION{l_id:line.l_id})
MERGE (FROM)-[PATIENT_LOCATION: PATIENT_LOCATION{type:"diagnosedIn"}]->(TO)

实际patient-location.csv文件里是l_ld, 所以要修改一下。

Neo4j-3D无法运行

运行时会报错:
Error: Unknown Bolt protocol version: 0
at new n (neo4j-color-min.js:17)
at t (neo4j-color-min.js:17)
at l._ch.onmessage (neo4j-color-min.js:18)
at WebSocket._ws.onmessage (neo4j-color-min.js:18)
这和系统有关吗?您用的是Mac吗?
我也看到您在博客上说翻墙试一下,也进行了尝试,结果也会报错。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.