Neo4j命名行

LOAD CSV WITH HEADERS  FROM "file:///draft_file.csv" AS line
CREATE (p:存储名{存储名:line.存储名,英文名:line.英文名,中文名:line.中文名,封面其他内容:line.封面其他内容,标准类型:line.标准类型,ICS:line.ICS,CCS:line.CCS,国内编号:line.国内编号,标准编号:line.标准编号})


// 创建索引
CREATE CONSTRAINT ON (c:存储名)
ASSERT c.存储名 IS UNIQUE

LOAD CSV  WITH HEADERS FROM "file:///draftperunit.csv" AS line
CREATE (p:起草人{起草人:line.起草人员})
// 创建索引
CREATE CONSTRAINT ON (c:起草人)
ASSERT c.起草人 IS UNIQUE


LOAD CSV  WITH HEADERS FROM "file:///draftperunit.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:起草人{起草人:line.起草人员})
CREATE (entity1)-[:起草人 { type: line.起草人 }]->(entity2)


LOAD CSV  WITH HEADERS FROM "file:///unit.csv" AS line
CREATE (p:机构{机构:line.机构})


LOAD CSV  WITH HEADERS FROM "file:///prounit.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:机构{机构:line.机构})
CREATE (entity1)-[:提出单位 { type: line.提出单位 }]->(entity2)



LOAD CSV  WITH HEADERS FROM "file:///draftunit.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:机构{机构:line.机构})
CREATE (entity1)-[:起草单位 { type: line.起草单位 }]->(entity2)




LOAD CSV  WITH HEADERS FROM "file:///guiunit.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:机构{机构:line.机构})
CREATE (entity1)-[:归口单位 { type: line.归口单位 }]->(entity2)




LOAD CSV  WITH HEADERS FROM "file:///preother.csv" AS line

CREATE (p:前言内容{前言内容:line.前言内容})
// 创建索引
CREATE CONSTRAINT ON (c:前言内容)
ASSERT c.前言内容 IS UNIQUE



LOAD CSV  WITH HEADERS FROM "file:///preother.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:前言内容{前言内容:line.前言内容})
CREATE (entity1)-[:前言其他内容 { type: line.前言其他内容 }]->(entity2)



LOAD CSV  WITH HEADERS FROM "file:///pubrel.csv" AS line

CREATE (p:发布时间{发布时间:line.发布时间})







LOAD CSV  WITH HEADERS FROM "file:///dates.csv" AS line
CREATE (p:日期{日期:line.日期})
CREATE CONSTRAINT ON (c:日期)
ASSERT c.日期 IS UNIQUE



LOAD CSV  WITH HEADERS FROM "file:///pubrel.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:日期{日期:line.发布日期})
CREATE (entity1)-[:发布时间 { type: line.发布时间 }]->(entity2)


LOAD CSV  WITH HEADERS FROM "file:///shirel.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:日期{日期:line.实施日期})
CREATE (entity1)-[:实施时间 { type: line.实施时间 }]->(entity2)



LOAD CSV  WITH HEADERS FROM "file:///term.csv" AS line
CREATE (p:术语名{术语名:line.术语名,术语英文名:line.术语英文名,术语定义:line.术语定义})

CREATE CONSTRAINT ON (c:术语名)
ASSERT c.术语名 IS UNIQUE


LOAD CSV  WITH HEADERS FROM "file:///termrel.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}) , (entity2:术语名{术语名:line.术语名})
CREATE (entity1)-[:包含 { type: line.包含 }]->(entity2)

LOAD CSV WITH HEADERS  FROM "file:///draft_keys_tfidf1.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.关键词=line.关键词
return entity1


LOAD CSV WITH HEADERS  FROM "file:///draft_ent1.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.范围实体=line.实体名
return entity1



LOAD CSV WITH HEADERS  FROM "file:///draft_range.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.范围表述=line.范围表述
return entity1

LOAD CSV WITH HEADERS  FROM "file:///draft_range.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.范围适用=line.范围适用
return entity1

LOAD CSV WITH HEADERS  FROM "file:///draft_range.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.范围不适用=line.范围不适用
return entity1


LOAD CSV WITH HEADERS  FROM "file:///draft_range.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名})
SET entity1.其余内容=line.其余内容
return entity1



LOAD CSV  WITH HEADERS FROM "file:///abbrev.csv" AS line
CREATE (p:缩略语{缩略语中文名:line.缩略语中文名,缩略语英文名:line.缩略语译名})
// 创建索引
CREATE CONSTRAINT ON (c:缩略语)
ASSERT c.缩略语中文名 IS UNIQUE


\\删除重复节点
match (p:缩略语{缩略语中文名:"电磁兼容性"}) with p skip 1 delete p

// 创建索引
CREATE CONSTRAINT ON(c: 缩略语)
ASSERT c.缩略语中文名 IS UNIQUE

LOAD CSV  WITH HEADERS FROM "file:///abbrev.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}), (entity2:缩略语{缩略语中文名:line.缩略语中文名})
CREATE (entity1)-[:缩略语 { type: line.关系 }]->(entity2)

LOAD CSV  WITH HEADERS FROM "file:///ref_v0.csv" AS line
CREATE (p:引用文件{引用文件编号:line.引用文件编号,引用文件名称:line.引用文件名称})

\\删除重复节点
match (p:引用文件{引用文件编号:"CMS 10"}) with p skip 1 delete p

// 创建索引
CREATE CONSTRAINT ON (c:引用文件)
ASSERT c.引用文件编号 IS UNIQUE

LOAD CSV  WITH HEADERS FROM "file:///ref_v0.csv" AS line
MATCH (entity1:存储名{存储名:line.存储名}), (entity2:引用文件{引用文件编号:line.引用文件编号})
CREATE (entity1)-[:引用文件 { type: line.关系 }]->(entity2)

你可能感兴趣的:(neo4j,neo4j)