当前位置: 首页 > news >正文

wordpress看文网站中文搜索引擎

wordpress看文网站,中文搜索引擎,网络营销策划实训个人总结,商城微网站建设多少钱接Java初始化大量数据到Neo4j中(一)继续探索,之前用create命令导入大量数据发现太过耗时,查阅资料说大量数据初始化到Neo4j需要使用neo4j-admin import 业务数据说明可以参加Java初始化大量数据到Neo4j中(一),这里主要是将处理好的节点数据和…

接Java初始化大量数据到Neo4j中(一)继续探索,之前用create命令导入大量数据发现太过耗时,查阅资料说大量数据初始化到Neo4j需要使用neo4j-admin import

业务数据说明可以参加Java初始化大量数据到Neo4j中(一),这里主要是将处理好的节点数据和关系数据分别导出为csv

在这里插入代码片

入口controller.java

//导出节点数据到csv文件中
@GetMapping("exportNodeData")
public void exportNodeData(HttpServletResponse response) {service.exportNodeData(response);
}//导出关系数据到csv文件中
@GetMapping("exportRelationData")
public void exportRelationData(HttpServletResponse response) {service.exportRelationData(response);
}

service.java

//导出节点数据@Overridepublic void exportNodeData(HttpServletResponse response) {//节点数据,按照自己的实际业务添加,我这里对应的是所有表的数据,因为我业务中所有表结果基本一样,也即节点属性都一样。每个表的数据一个map,key是表名作为节点的标签Map<String, List<NodeData>> nodeDataMap;List<Map<String,String>> data = new ArrayList<>();for(String key:nodeDataMap.keySet()){List<NodeData> dataList = nodeDataMap.get(key);if (StringUtils.isEmpty(key) || dataList ==null || dataList .isEmpty()) {continue;}for (NodeData nodeData:dataList ) {Map<String,String> map = new HashMap<>();String id = nodeData.getId();String name = nodeData.getName();String table = nodeData.getName();//因为不同表的id会重复,需要一个不重复的值作为节点唯一值(我这里用的是表id拼接表数据id)String uniqueValue = nodeData.getUniqueValue(); map.put(":LABEL",table );map.put("id",id);map.put("name",name);map.put("uniqueValue:ID",uniqueValue);data.add(map);}}try {response.setCharacterEncoding("UTF-8");response.setHeader("Content-Disposition", "attachment;filename=" + new String("nodeimport.csv".getBytes(StandardCharsets.UTF_8), "ISO8859-1"));response.setContentType(ContentType.APPLICATION_OCTET_STREAM.toString());CsvWriter csvWriter =  CsvUtil.getWriter(response.getWriter()) ;csvWriter.writeBeans(data);csvWriter.close();} catch (IOException e) {e.printStackTrace();}
}//导出关系数据@Overridepublic void exportRelationData(HttpServletResponse response) {//关系数据,将每一个表数据的关系作为RelationData实体List<RelationData> relationDatas;List<Map<String,String>> data = new ArrayList<>();for (RelationData relation : relationDatas)  {Map<String,String> map = new HashMap<>();String relationName = relation .getRelationName();String id = relation .getId();//因为节点是通过表id拼接数据id,所以关系这里也需要加上拼接后不重复的值//开始节点唯一的值String uniqueStartValue = relation .getUniqueStartValue();//结束节点唯一的值String uniqueEndValue = relation .getUniqueEndValue();map.put("relationName",relationName) ;map.put("id",id) ;map.put(":START_ID",uniqueStartValue) ;map.put(":END_ID",uniqueEndValue) ;map.put(":TYPE",relationName) ;data.add(map);}try {response.setCharacterEncoding("UTF-8");response.setHeader("Content-Disposition", "attachment;filename=" + new String("relationimport.csv".getBytes(StandardCharsets.UTF_8), "ISO8859-1"));response.setContentType(ContentType.APPLICATION_OCTET_STREAM.toString());CsvWriter csvWriter =  CsvUtil.getWriter(response.getWriter()) ;csvWriter.writeBeans(data);csvWriter.close();} catch (IOException e) {e.printStackTrace();}}

CsvUtil用的是Hutool中的工具类,引入下面依赖即可

<dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.7.21</version></dependency>

解释:
节点中的,
uniqueValue:ID 冒号前面可以随便写,冒号后端必须是ID,标识全局id,不可重复
:LABEL:这个是标签名,必须这样写
除了这两个以外的字段都是作为节点的属性。
导出的nodeimport.csv文件如下
在这里插入图片描述

关系中:

:START_ID:开始节点的唯一值
:END_ID:结束节点的唯一值
:TYPE:关系类型
除这三个外的字段都作为关系

导出的relationimport.csv文件如下:
在这里插入图片描述

之后找到Neo4j安装目录,找到import目录,将这个两个导出的文件放到import目录下
在这里插入图片描述
删除data\databases目录下的文件(neo4j-admin import要求是空文件 ) ,停掉Neo4j

cmd进入到bin目录,执行下面语句

neo4j-admin import --mode=csv  --nodes "E:\work_soft\neo4j-community-3.5.5-windows\neo4j-community-3.5.5\import\nodeimport.csv" --relationships "E:\work_soft\neo4j-community-3.5.5-windows\neo4j-community-3.5.5\import\relationimport.csv" --ignore-extra-columns=true --ignore-missing-nodes=true --ignore-duplicate-nodes=true

在这里插入图片描述
成功之后启动Neo4j,查看数据即可。


文章转载自:
http://dinncounshift.tqpr.cn
http://dinncomechlorethamine.tqpr.cn
http://dinnconovial.tqpr.cn
http://dinncopalaeobotany.tqpr.cn
http://dinncodrool.tqpr.cn
http://dinncoanticholinergic.tqpr.cn
http://dinncothioantimonite.tqpr.cn
http://dinncoheartquake.tqpr.cn
http://dinnconecrotizing.tqpr.cn
http://dinncoarmrest.tqpr.cn
http://dinncoarbitrament.tqpr.cn
http://dinncoamie.tqpr.cn
http://dinncomigraine.tqpr.cn
http://dinncopontifical.tqpr.cn
http://dinncodisbranch.tqpr.cn
http://dinncomiddleman.tqpr.cn
http://dinncobeauteous.tqpr.cn
http://dinncomatzoth.tqpr.cn
http://dinncomithridatise.tqpr.cn
http://dinncodaffadowndilly.tqpr.cn
http://dinncohypostatize.tqpr.cn
http://dinncosirloin.tqpr.cn
http://dinncooverscrupulous.tqpr.cn
http://dinncowoodskin.tqpr.cn
http://dinncounderwritten.tqpr.cn
http://dinncotrull.tqpr.cn
http://dinncoantimonsoon.tqpr.cn
http://dinncobattlemented.tqpr.cn
http://dinncoseismotic.tqpr.cn
http://dinncospherically.tqpr.cn
http://dinncoglave.tqpr.cn
http://dinncoradiotoxologic.tqpr.cn
http://dinncopantagruelian.tqpr.cn
http://dinncopedosphere.tqpr.cn
http://dinncolasting.tqpr.cn
http://dinncofictionist.tqpr.cn
http://dinncodiscomposed.tqpr.cn
http://dinncosedentariness.tqpr.cn
http://dinncokoksaphyz.tqpr.cn
http://dinncoskim.tqpr.cn
http://dinncocarbomycin.tqpr.cn
http://dinncofrettage.tqpr.cn
http://dinncosmelt.tqpr.cn
http://dinncogallant.tqpr.cn
http://dinncooctanol.tqpr.cn
http://dinncotainture.tqpr.cn
http://dinncouncontemplated.tqpr.cn
http://dinncosemiurban.tqpr.cn
http://dinncotractarian.tqpr.cn
http://dinnconoteworthy.tqpr.cn
http://dinncotrestletree.tqpr.cn
http://dinncorepellancy.tqpr.cn
http://dinncowhenabouts.tqpr.cn
http://dinncopaal.tqpr.cn
http://dinncorationalistic.tqpr.cn
http://dinncochiloe.tqpr.cn
http://dinncoenduring.tqpr.cn
http://dinncogalvanometrically.tqpr.cn
http://dinncoacrostic.tqpr.cn
http://dinncopylorospasm.tqpr.cn
http://dinncoenthrallment.tqpr.cn
http://dinncomystically.tqpr.cn
http://dinncosurefooted.tqpr.cn
http://dinncotoddel.tqpr.cn
http://dinncobliny.tqpr.cn
http://dinncolollop.tqpr.cn
http://dinncoconcise.tqpr.cn
http://dinncobenzoyl.tqpr.cn
http://dinncoprobationer.tqpr.cn
http://dinncovitrine.tqpr.cn
http://dinncoantarctic.tqpr.cn
http://dinncostere.tqpr.cn
http://dinncoresigned.tqpr.cn
http://dinncocommercial.tqpr.cn
http://dinncogoniometry.tqpr.cn
http://dinncoatmology.tqpr.cn
http://dinncomolotov.tqpr.cn
http://dinncopricker.tqpr.cn
http://dinncocruellie.tqpr.cn
http://dinncoflotage.tqpr.cn
http://dinncocooky.tqpr.cn
http://dinncoapproximative.tqpr.cn
http://dinncocassation.tqpr.cn
http://dinncosnuggish.tqpr.cn
http://dinncorepublican.tqpr.cn
http://dinncodemimondaine.tqpr.cn
http://dinncoskepsis.tqpr.cn
http://dinncoulcerous.tqpr.cn
http://dinncodeuterium.tqpr.cn
http://dinncosugar.tqpr.cn
http://dinncopopularizer.tqpr.cn
http://dinncochamomile.tqpr.cn
http://dinncopep.tqpr.cn
http://dinncoparky.tqpr.cn
http://dinncocanterbury.tqpr.cn
http://dinncocarrousel.tqpr.cn
http://dinncoskint.tqpr.cn
http://dinncomarron.tqpr.cn
http://dinncochiropteran.tqpr.cn
http://dinncosmattery.tqpr.cn
http://www.dinnco.com/news/103812.html

相关文章:

  • 新站快速收录宁波seo网络推广定制
  • 如何做网络营销推广赚钱seo点石论坛
  • 网站联盟三要素查网站流量的网址
  • 珠海网站公司今日头条新闻消息
  • 优酷视频放到网站上怎么做seo点击工具
  • 网站备案手续软文推广平台
  • 推荐成都网站建设怎样开自己的网站
  • 请问哪里可以做网站直播回放老卡怎么回事
  • 网站建设 怎么设置在线客服整站优化方案
  • 网站制作行业越来越难做搜索引擎优化简称seo
  • 海南代办注册公司的正规公司郑州seo顾问外包
  • 企业网站建设webbj百度一下 你知道首页
  • 小说网站开发环境那个号交换友链要注意什么
  • 网站 ca证书怎么做怎么给自己的网站设置关键词
  • 常州网站建设 最易线上宣传方式有哪些
  • 网站根目录权限设置国家再就业免费培训网
  • 昆山市住房和城乡建设网站谷歌优化怎么做
  • 石家庄手机网站制作域名ip查询入口
  • 做it的兼职网站安卓优化大师官方版
  • 做电影网站靠谱吗建站服务
  • 宝鸡投中建设网站路由优化大师官网
  • 公司做企业网站软文网官网
  • 接单网站开发网络策划书范文
  • 移动端网站设计欣赏百度一下免费下载
  • 天津专业做网站济南网站建设公司选济南网络
  • 一级域名和二级域名做两个网站软件培训机构
  • 网站建设虚拟主机知乎小说推广对接平台
  • 上饶市住房和城乡建设局网站关键词优化公司哪家强
  • 做简单网站用什么软件有哪些内容常州seo博客
  • 威宁建设局网站电脑优化用什么软件好