Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xzk-seu committed Sep 25, 2019
0 parents commit 9bf8609
Show file tree
Hide file tree
Showing 357 changed files with 140,687 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .idea/360KG.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
61 changes: 61 additions & 0 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions bolt_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from neo4j.v1 import GraphDatabase


def run():
uri = "bolt://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "1234"))
with driver.session() as session:
with session.begin_transaction() as tx:
result = tx.run("MATCH (n) RETURN n LIMIT 2")
# for record in tx.run("MATCH (a:Person)-[:KNOWS]->(f) "
# "WHERE a.name = {name} "
# "RETURN f.name", name=name):
# print(record["f.name"])
print(result.records())
for r in result.records():
print(r.data())
print(type(r.data()))
data = r.data()['n']
print(type(data))
print(data.items())


# for resu in result:
# print(resu)


if __name__ == '__main__':
run()
35 changes: 35 additions & 0 deletions creat_onto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
"czf": ["fzgmsfhm", "czrgmsfhm"]
"""


"""
MERGE (p_1: concept {concept_name: czf})
"""
"""
对每个表明创建一个概念节点
"""
import os
import json


def run():
in_path = os.path.join(os.getcwd(), 'data', 'schema.json')
with open(in_path, 'r') as fr:
input_dict = json.load(fr)

r_list = list()
for k in input_dict.keys():
r_list.append("MERGE (: concept {concept_name: '%s'})\n" % k)

out_path = os.path.join(os.getcwd(), 'cypher', 'create_onto.cypher')
with open(out_path, 'w') as fw:
fw.writelines(r_list)


if __name__ == '__main__':
# create_onto.cypher
# type cypher\create_onto.cypher | cypher-shell.bat -u neo4j -p 1234
run()

139 changes: 139 additions & 0 deletions cypher/create_onto.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
MERGE (: concept {concept_name: 'czf'})
MERGE (: concept {concept_name: 'dbry'})
MERGE (: concept {concept_name: 'ggfzcs'})
MERGE (: concept {concept_name: 'hjrk'})
MERGE (: concept {concept_name: 'hydj'})
MERGE (: concept {concept_name: 'jdcdj'})
MERGE (: concept {concept_name: 'jdcwz'})
MERGE (: concept {concept_name: 'js'})
MERGE (: concept {concept_name: 'jwry'})
MERGE (: concept {concept_name: 'jyywry'})
MERGE (: concept {concept_name: 'ldrk'})
MERGE (: concept {concept_name: 'mbjypxjg'})
MERGE (: concept {concept_name: 'mbjypxjgcyrr'})
MERGE (: concept {concept_name: 'sjjjl'})
MERGE (: concept {concept_name: 'syfw'})
MERGE (: concept {concept_name: 'tzhy'})
MERGE (: concept {concept_name: 'wxpcyry'})
MERGE (: concept {concept_name: 'xdry'})
MERGE (: concept {concept_name: 'xq'})
MERGE (: concept {concept_name: 'xs'})
MERGE (: concept {concept_name: 'xx'})
MERGE (: concept {concept_name: 'xyjzry'})
MERGE (: concept {concept_name: 'ylfwjg'})
MERGE (: concept {concept_name: 'zazd'})
MERGE (: concept {concept_name: 'zdqsn'})
MERGE (: concept {concept_name: 'zdsfry'})
MERGE (: concept {concept_name: 'zggmcrj'})
MERGE (: concept {concept_name: 'zxksxj'})
MERGE (: concept {concept_name: 'djsyry'})
MERGE (: concept {concept_name: 'dwldbz'})
MERGE (: concept {concept_name: 'flyzaj'})
MERGE (: concept {concept_name: 'hhry'})
MERGE (: concept {concept_name: 'jyfxry'})
MERGE (: concept {concept_name: 'jytjry'})
MERGE (: concept {concept_name: 'kjet'})
MERGE (: concept {concept_name: 'lset'})
MERGE (: concept {concept_name: 'lszy'})
MERGE (: concept {concept_name: 'pfwrwxkz'})
MERGE (: concept {concept_name: 'qxzyzgqk'})
MERGE (: concept {concept_name: 'qyhjxzcf'})
MERGE (: concept {concept_name: 'rmtjwytwh'})
MERGE (: concept {concept_name: 'rmtjy'})
MERGE (: concept {concept_name: 'sfsgzry'})
MERGE (: concept {concept_name: 'sfszz'})
MERGE (: concept {concept_name: 'sfxzflfwzxjg'})
MERGE (: concept {concept_name: 'sfxzflfwzxjgry'})
MERGE (: concept {concept_name: 'shzz'})
MERGE (: concept {concept_name: 'sqjzry'})
MERGE (: concept {concept_name: 'sybx'})
MERGE (: concept {concept_name: 'wxfwcsl'})
MERGE (: concept {concept_name: 'ybylfw_zlxm'})
MERGE (: concept {concept_name: 'ybypml'})
MERGE (: concept {concept_name: 'yiliaobaoxian'})
MERGE (: concept {concept_name: 'ylbx'})
MERGE (: concept {concept_name: 'yyddjg'})
MERGE (: concept {concept_name: 'zdpwqyjbqk'})
MERGE (: concept {concept_name: 'zyryxxjs'})
MERGE (: concept {concept_name: 'aqsc'})
MERGE (: concept {concept_name: 'cs_hswry'})
MERGE (: concept {concept_name: 'dcdy'})
MERGE (: concept {concept_name: 'ffxyhmd'})
MERGE (: concept {concept_name: 'gkqysg'})
MERGE (: concept {concept_name: 'gmp'})
MERGE (: concept {concept_name: 'gqbg'})
MERGE (: concept {concept_name: 'gqcz'})
MERGE (: concept {concept_name: 'gsgd'})
MERGE (: concept {concept_name: 'gsp'})
MERGE (: concept {concept_name: 'gszcdj'})
MERGE (: concept {concept_name: 'hzpscxk'})
MERGE (: concept {concept_name: 'jhsyfwz'})
MERGE (: concept {concept_name: 'ldrkhyzm'})
MERGE (: concept {concept_name: 'ldrkhyzmcy'})
MERGE (: concept {concept_name: 'spjyxk'})
MERGE (: concept {concept_name: 'syfn'})
MERGE (: concept {concept_name: 'xcsxf'})
MERGE (: concept {concept_name: 'xzcf'})
MERGE (: concept {concept_name: 'ybdwxf'})
MERGE (: concept {concept_name: 'yljgzcdj'})
MERGE (: concept {concept_name: 'yljgzjxk'})
MERGE (: concept {concept_name: 'ylqxjyxk'})
MERGE (: concept {concept_name: 'ylqxscxk'})
MERGE (: concept {concept_name: 'ypjyxk'})
MERGE (: concept {concept_name: 'ypscxk'})
MERGE (: concept {concept_name: 'yy'})
MERGE (: concept {concept_name: 'zyys'})
MERGE (: concept {concept_name: 'dscf'})
MERGE (: concept {concept_name: 'dsjs'})
MERGE (: concept {concept_name: 'dyxx'})
MERGE (: concept {concept_name: 'flyzdx'})
MERGE (: concept {concept_name: 'fwjy'})
MERGE (: concept {concept_name: 'fwqs'})
MERGE (: concept {concept_name: 'gscf'})
MERGE (: concept {concept_name: 'gsjs'})
MERGE (: concept {concept_name: 'jtwfaj'})
MERGE (: concept {concept_name: 'lddy'})
MERGE (: concept {concept_name: 'lxs_lk'})
MERGE (: concept {concept_name: 'lzf_gzf'})
MERGE (: concept {concept_name: 'mbxx'})
MERGE (: concept {concept_name: 'nhcy'})
MERGE (: concept {concept_name: 'qzcq'})
MERGE (: concept {concept_name: 'rw_zb'})
MERGE (: concept {concept_name: 'rybt'})
MERGE (: concept {concept_name: 'szry'})
MERGE (: concept {concept_name: 'tyxx'})
MERGE (: concept {concept_name: 'wbdwry'})
MERGE (: concept {concept_name: 'xxjzyg'})
MERGE (: concept {concept_name: 'yhbz'})
MERGE (: concept {concept_name: 'yshyry'})
MERGE (: concept {concept_name: 'byxs'})
MERGE (: concept {concept_name: 'crbr'})
MERGE (: concept {concept_name: 'cyryjkz'})
MERGE (: concept {concept_name: 'gcet'})
MERGE (: concept {concept_name: 'ggws'})
MERGE (: concept {concept_name: 'jhsyrk'})
MERGE (: concept {concept_name: 'jscf'})
MERGE (: concept {concept_name: 'jsjf'})
MERGE (: concept {concept_name: 'jsry_zc'})
MERGE (: concept {concept_name: 'jzxx'})
MERGE (: concept {concept_name: 'ldlzy'})
MERGE (: concept {concept_name: 'lhjy_bt'})
MERGE (: concept {concept_name: 'lnydz'})
MERGE (: concept {concept_name: 'lyry'})
MERGE (: concept {concept_name: 'njbtry'})
MERGE (: concept {concept_name: 'nytlj'})
MERGE (: concept {concept_name: 'nytljjsy'})
MERGE (: concept {concept_name: 'rcscdj'})
MERGE (: concept {concept_name: 'sy_xg'})
MERGE (: concept {concept_name: 'tghlzb'})
MERGE (: concept {concept_name: 'txry'})
MERGE (: concept {concept_name: 'wbh'})
MERGE (: concept {concept_name: 'wsxkz'})
MERGE (: concept {concept_name: 'xmyry'})
MERGE (: concept {concept_name: 'xsye'})
MERGE (: concept {concept_name: 'xxry'})
MERGE (: concept {concept_name: 'ycry'})
MERGE (: concept {concept_name: 'yfdx'})
MERGE (: concept {concept_name: 'yymz'})
MERGE (: concept {concept_name: 'yyyzry'})
MERGE (: concept {concept_name: 'zy_tj'})
2 changes: 2 additions & 0 deletions cypher/delete.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MATCH (n)
DETACH DELETE n
2 changes: 2 additions & 0 deletions cypher/import.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LOAD CSV FROM 'file:///byxs.csv' AS line
MERGE (:byxs {xm:line[0], sfz:line[1], qxl:line[2], byyx:line[3], sxzy:line[4], bysj:line[5], zrrq:line[6], sj:line[7], zj:line[8], zz:line[9]})
Loading

0 comments on commit 9bf8609

Please sign in to comment.