neo4j

Converting DateTime to Epoch milliseconds using Cypher in Neo4J

北城余情 提交于 2021-01-27 15:50:47
问题 I'm running a query using Cypher in Neo4J where I have to compare a createdAt property of a node against a given time unit in Epoch milliseconds. This createdAt property is a string in the DateTime format, which is defined as - DateTime date with a precision of miliseconds, encoded as a string with the following format: yyyy-mm-ddTHH:MM:ss.sss+0000, where yyyy is a four-digit integer representing the year, the year, mm is a two-digit integer representing the month and dd is a two-digit

Neo4j Client UNWIND with “DateTime?”

会有一股神秘感。 提交于 2021-01-27 07:11:43
问题 I'm currently trying to unwind a list of TravelEdges that has a "DateTime?" but I keep receiving the following error: {"CypherTypeException: Type mismatch: expected a map but was String(\"2018-05-21T08:38:00\")"} I'm currently using the latest version of neo4j (3.4.8) and was wondering if someone could assist? Also, is there a more efficient way of adding the edges without having two matches? The Id's are unique. List<TravelEdge> travelpoints = new List<TravelEdge>(); //Add stuff to list

Neo4j Client UNWIND with “DateTime?”

﹥>﹥吖頭↗ 提交于 2021-01-27 07:10:00
问题 I'm currently trying to unwind a list of TravelEdges that has a "DateTime?" but I keep receiving the following error: {"CypherTypeException: Type mismatch: expected a map but was String(\"2018-05-21T08:38:00\")"} I'm currently using the latest version of neo4j (3.4.8) and was wondering if someone could assist? Also, is there a more efficient way of adding the edges without having two matches? The Id's are unique. List<TravelEdge> travelpoints = new List<TravelEdge>(); //Add stuff to list

Neo4j Relationship Naming Conventions for Similar Actions in Cypher

别来无恙 提交于 2021-01-27 06:34:10
问题 I am aware of the absence of a constraint for naming relationships, though it is tough to get one guideline and work with it over all the relationships that we might encounter. Would you go with something like this: (u:User)-[:LIKES]->(p:Post) (u:User)-[:LIKES]->(c:Comment) and then query based on the label; Or something like this: (u:User)-[:LIKES_POST]->(p:Post) (u:User)-[:LIKES_COMMENT]->(c:Comment) Another case is a threaded chat application where a User can start a thread with multiple

知识图谱的综述、构建、存储与应用

我的未来我决定 提交于 2021-01-09 18:04:59
本文介绍知识图谱,首先会讲一段知识图谱的综述作为开场,然后就知识图谱的构建,存储,还有应用进行具体说明。 知识图谱和我们的资源页比较类似,都是需要先构建,然后存储,之后应用。 知识图谱应用广泛,我会以推荐系统为例子,说明知识图谱在推荐系统中的应用。 知识图谱综述 我们首先对知识图谱做一个简短的综述。 计算机为什么需要知识? 比如数字110,对机器来说,110就是一个字符串,与其他数字没有太大的差别。 当然可以借助关联分析,分析出110跟警察,抢劫等相关。但是关联分析比较复杂,需要借助数据挖掘等相关技术。 如果采用知识库,只需要构建一条知识,即110是报警电话。 人工智能分为三个层次,分别是运算智能,感知智能和认知智能。 运算智能是让机器能存会算;感知智能是让机器能听会说、能看会认;认知智能是解决机器能理解会思考的问题。 认知智能需要知识图谱。 知识图谱是一个大规模语义网,包含实体和关系,比如章子怡的丈夫是汪峰; 也包含实体和属性,比如章子怡的出生日期是1979年2月9日。 还包含实体和概念,比如章子怡是一个女演员; 还包含概念之间的关系,比如女演员是演员的子类。演员是人物的子类。 百科图谱一般由 标题,摘要,信息框,标签,图片 等部分组成。 可抽取信息框的内容构建知识图谱,并进行可视化展示。 其中,对于题目理解来讲,函数的提出者,提出时间这些属性不是我们所关心的。 表达式,表示法

图数据库Neo4j简介

北城以北 提交于 2021-01-07 08:27:48
<div class="htmledit_views" id="content_views"> <p>    图数据库本身属于NoSql数据库中的一种,是基于数学中图论实现的一种数据库。不同于传统的关系型数据库将数据存在库表字段中,图数据库将数据和数据之间的关系存在节点和边中,在图数据库中这被称作“节点”和“关系”。没有了库表字段的概念,相当于是把数据存在了一张大宽表中。传统数据库的一些特性如CRUD、处理事务的能力在图数据库中也都支持。</p> <p>    <span style="color:#f33b45;"><strong>这里需要澄清一个概念:图数据库并不是前端展示用的数据库,它不是用来画图的。相反,它是用来存储数据用的,以图的节点和边的方式来存储数据。而前端展现需要用一些前端展示工具,例如D3、ECharts等来实现。</strong></span></p> <p>    本文将以neo4j为例来介绍图数据库的使用。neo4j是由Java实现的开源NoSql图数据库,是图数据库中较为流行的一款。它提供了完整的数据库特性,包括ACID事务的支持、集群支持、备份与故障转移等(部分功能例如集群支持只有在neo4j企业版中才有,社区版不支持)。</p> <p>    在笔者看来,图数据库最大的优势是体现在对数据关系的检索上。如果数据之间的关系很复杂,数据存在了多张表中

Neo4j教程

旧城冷巷雨未停 提交于 2021-01-06 20:59:10
1. Neo4j是什么 Neo4j是目前世界领先的图形数据库。 它的体系结构旨在优化管理,存储和遍历节点和关系。 数据库采用属性图方法,这对于遍历性能和操作运行时都非常有利。 Neo4j提供专用的内存管理和内存高效操作。 它具有可伸缩性,可以作为独立服务器部署,也可以跨多个机器部署在生产环境的容错群集中,但是 仅限于企业版 。 生产应用程序的其他功能包括热备份和广泛的监视。 Cypher是Neo4j的官方图查询语言,也支持SQL界的Gremlin查询。如果想要通过图查询语言做一些高性能的优化,目前Gremlin语言是不支持的。 2. 社区版和企业版 社区版: 社区版是Neo4j的全功能版本,但只适用于 单实例 部署,不支持多数据库实例,而且数据库的实例名为neo4j。 它全面支持Neo4j的关键功能,例如ACID合规性,Cypher和编程API。 非常适合 学习 Neo4j,自己动手的项目以及小型工作组中的应用程序。 企业版: 企业版扩展了社区版的功能,以包括用于性能和可伸缩性的关键功能,例如群集体系结构和联机备份功能。 其他安全功能包括基于角色的访问控制和LDAP支持,例如Active Directory。 它是对规模和可用性有要求的生产系统的选择,例如商业解决方案和关键内部解决方案。 社区版与企业版主要特性差异列表 社区版 企业版 基于角色的访问控制 - √ 基于角色的访问控制

Neo4j - Custom converter for field of type List

巧了我就是萌 提交于 2021-01-06 03:35:14
问题 I am trying to write a custom converter for a nested object so that this object gets saved as string in Neo4j database. I am using @Convert annotation on my field and passing ImageConverter.class which is my AttributeConverter class. Everything works fine as expected and I am able to save string representation of Image class in Neo4j db. However, now instead of single image I want to have List<Image> as my nested field. In this case, putting @Convert(ImageConverter.class) doesn't work. I see

Neo4j - Custom converter for field of type List

≡放荡痞女 提交于 2021-01-06 03:31:32
问题 I am trying to write a custom converter for a nested object so that this object gets saved as string in Neo4j database. I am using @Convert annotation on my field and passing ImageConverter.class which is my AttributeConverter class. Everything works fine as expected and I am able to save string representation of Image class in Neo4j db. However, now instead of single image I want to have List<Image> as my nested field. In this case, putting @Convert(ImageConverter.class) doesn't work. I see

Neo4j - Custom converter for field of type List

你离开我真会死。 提交于 2021-01-06 03:31:02
问题 I am trying to write a custom converter for a nested object so that this object gets saved as string in Neo4j database. I am using @Convert annotation on my field and passing ImageConverter.class which is my AttributeConverter class. Everything works fine as expected and I am able to save string representation of Image class in Neo4j db. However, now instead of single image I want to have List<Image> as my nested field. In this case, putting @Convert(ImageConverter.class) doesn't work. I see