FAQ Database Discussion Community


Neo4j neverending slow node creating

performance,neo4j,spring-data-neo4j
have dataset in .csv file with format "title"|year|"word" "Into the Wild"|2007|"abandoned-bus" "Into the Wild"|2007|"adolescence" "Into the Wild"|2007|"adoption" This file has over 4M lines. I have database running on remote super-computer which I connect using ssh tunnel. I create 2 indices: CREATE INDEX ON :MOVIE(title) CREATE INDEX ON :KEYWORD(word) Then I...

How To Fetch Specific Column From Repository Using Neo4j

spring,neo4j,spring-data-neo4j
I have problem about to fetching some specific column on Java Spring. I am using Java Spring Boot and GraphDB as my database and I use Model and Repository to access the database (ex: I have userRepository, and I use userRepository.FindAll and all records are loaded within all their fields)....

Spring-Data-Neo4J: How do log into the remote server?

java,neo4j,spring-data-neo4j,spring-data-neo4j-4
I'm using Spring-Data-Neo4j 4.0.0.M1, and trying to connect to the server. I'm getting an exception: Caused by: org.apache.http.client.HttpResponseException: Unauthorized I have a password on the server interface, but I'm not sure how to tell Spring about it. @Configuration @EnableNeo4jRepositories(basePackages = "com.noxgroup.nitro.persistence") @EnableTransactionManagement public class MyConfiguration extends Neo4jConfiguration { @Bean public...

Neo4j 2.2.2 server does not start after db is generated via java code

java,neo4j,spring-data-neo4j
I am new to Neo4j. I am trying some application in Java using Neo4j 2.2.2 along with Spring Data. I am using spring-data-neo4j (2.2.2.RELEASE) to connect the Neo4j DB. I have successfully done all CRUD opertaions using repositories in Spring Data. But I am unable to open & view this...

Neo4j TimeTree in Spring Data Neo4j 4.0

neo4j,spring-data-neo4j,graphaware,spring-data-neo4j-4
I'm trying to utilize the timetree library in my spring data neo4j 4.0.0 project. As elaborated in this page, https://github.com/graphaware/neo4j-timetree, I've edited my neo4j.properties file to enable the auto event attaching, add timetree dependency to my gradle, and set a property 'creationDate' in the event node with Long data type....

How to get output from 2 different relation in neo4j

neo4j,cypher,spring-data-neo4j
My model is transoport system: nodes: BusStop, Bus, TransportOperator Relationship : BusStop-[:Stops_At]->Bus Relationship : Bus-[Operated_By]->TransportOperator If i use the below query i get an out put as : QUERY: MATCH (a:BusStop{name:'Bonhoefferstrasse'}),(d:BusStop {name:'HeidelBerg Hauptbanhof'}) MATCH p = allShortestPaths((a)-[:STOPS_AT*]-(d)) RETURN EXTRACT(x IN NODES(p) | CASE WHEN x:Bus THEN 'Bus' + x.id WHEN...

Issues accessing neo4j data with spring data

neo4j,spring-data-neo4j
Is it possible to have full access to my neo4j graph with spring framework if I haven't build the graph with using spring? I am trying some examples and it seems that it's not working properly as some metadata that spring creates don't exists. EDIT: For example I have this...

Compatibility neo4j-spatial with spring-data-neo4j-rest and neo4j CE 2.2.1 server mode?

neo4j,spatial,spring-data-neo4j
I'm trying to make neo4j-spatial version 0.14-neo4j-2.2.0, works with spring-data-neo4j-rest version 3.3.0.RELEASE with neo4j CE 2.2.1 in server mode. It looks like they are not compatible. Trying to create new instance of class EditableLayer throws NoSuchMethod exception. For instance: EditableLayer layer = (EditableLayer) spatialDb.getOrCreateLayer( "layer",SimplePointEncoder.class, EditableLayerImpl.class); I get the exception:...

Spring Data Rest does not fetch nested objects from Neo4j

java,spring-boot,spring-data-neo4j,spring-data-rest
Following "_links" from an Object the return Json object is empty. I suppose this is because of the lack of automatic lazy fetching in SDN. Is there an easy way to tell SDR to fetch objects before returning them? Example: .../questions/1131 returns the following JSON: { //... "_links" : {...

Can't use EXISTS in a cypher query

spring,maven,neo4j,cypher,spring-data-neo4j
I'm working on a java project using spring-data and neo4j. I tried to write a cypher query using the predicate EXISTS but I have an error telling me "nested exception is Unknown function 'EXISTS'". I have the following pom.xml : <properties> <aspectj.version>1.7.4</aspectj.version> <js.basedir>src/main/webapp/js</js.basedir> <jsonpath.version>0.9.1</jsonpath.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>...

SpatialRepository in Embedded Neo4j

neo4j,spring-data-neo4j,neo4j-spatial
Can someone answer this question. Is it possible to have the spatial repository in a spring boot app in embedded mode? @Bean public GraphDatabaseService graphDatabaseService() { return new GraphDatabaseFactory().newEmbeddedDatabase("neo4j.db"); } by just adding the <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-spatial</artifactId> <version>0.9</version> </dependency> to your classpath? I keep getting the error Caused by: java.lang.IllegalArgumentException:...

Neo4j automatic index doesn't work first time

lucene,neo4j,full-text-search,cypher,spring-data-neo4j
I have a following test: @Test public void testAutoIndexingAndFuzzySearch() { GraphDatabaseService graphDb = template.getGraphDatabaseService(); Index<Node> autoIndex = graphDb.index().forNodes("node_auto_index"); graphDb.index().setConfiguration(autoIndex, "type", "fulltext"); graphDb.index().setConfiguration(autoIndex, "to_lower_case", "true"); graphDb.index().setConfiguration(autoIndex, "analyzer", StandardAnalyzerV36.class.getName()); sampleDataGenerator.generateSampleDataJava(); List<Product> products = //...

Unique subnodes with spring-data-neo4j

java,spring,neo4j,spring-data-neo4j
I am currently working on an enterprise-architecture-management-system for my bachelor thesis in a insurance company. The company wants to display all self-made applications (Application-Node) in a Neo4J-Graphdatabase with Webservice-dependencies as relationships. Alongside the applications, the company also wants to persist the [Maven] versions (Version-Node) of an application (HAS_VERSION-Relationship), because new...

MappingException: Error mapping GraphModel to instance

neo4j,spring-boot,spring-data-neo4j,spring-data-neo4j-4
I'm trying to follow the new Cineasts app with SDN 4.0.0.M1 and SpringBoot to learn Spring and Neo4j but I have an error when I try to access the movie url with curl http://localhost:8080/movies MappingException: Error mapping GraphModel to instance I implemented the minimum to get something working so the...

Related nodes are not fetched in Spring Data Neo4j 4.0.0

neo4j,nodes,fetch,spring-data-neo4j,spring-data-neo4j-4
I have a weird problem with the node auto fetching in Spring Data Neo4j 4.0.0. I have a class like below : @NodeEntity public class FilterVersionChange extends UnitVersion { @GraphId private Long id; public FilterVersionChange() { super(); } public FilterVersionChange(String description, Long creationDate) { super(description, creationDate); } @Relationship(type="CONTAINS", direction =...

Neo4j 2.2.2 and wrong Cypher query

neo4j,cypher,spring-data-neo4j,graph-databases
In continue to this question Neo4j how to delete nodes recursively from some start node I have moved to Neo4j 2.2.2 and now have a problem with one Cypher query that works fine on a previous Neo4j 2.1.7 I use Spring Data Neo4J: @Query("MATCH (d:Decision) WHERE id(d) IN {decisionsIds} WITH...

Spring Data Neo4j how to aggregate

neo4j,spring-data,spring-data-neo4j,spring-hateoas
Im trying to do what I think should be a very basic task but I'm getting steam rolled. My code is as follows: @Query("match (x:Package) where x.houseAirwayBill = {self}.houseAirwayBill return count(x)") @JsonIgnore Long pieces @JsonProperty("total_pieces") Long getPieces(){ return pieces } However, it just throws a stack strace saying that it...

Spring-Data-Neo4j annotated Cypher Query, match paramter

java,neo4j,spring-data,spring-data-neo4j
I'm trying to parametrize the match part of a annotated Cypher query with Spring-Data-Neo4j-3.1.4 as follows. The first method is working. Passing the node type as parameter in the second method fails. public interface NodeRepository extends CrudRepository<Node, Long> { @Query("START n=node(*) MATCH (n:Organization) RETURN n") List<Node> findByNodeType(); @Query("START n=node(*) MATCH...

Removing simple Relationships in Spring Data Neo4j

java,spring,neo4j,spring-data-neo4j
Good Evening, I am using SDN 3, and am running into problems with removing simple relationships (RelateTo) in my underlying graph. The scenario is that I want to establish a Friend request/approval system amongst Users in my web application. I have no problem issuing the request by creating a "HAS_REQUESTED"...

Multiple match with where clause in Neo4j Cypher gives error “Cannot match on a pattern containing only already bound identifiers”

neo4j,cypher,spring-data-neo4j
We are using neo4j-community-2.1.2. Right now we have only 3 nodes Of Job label in the database And we do Schema indexing on all fields that are used in this query . Total DB hits approx 40 Query is -> PROFILE match (job1:Job) where (job1.jobType="Adhoc" or job1.jobType="Virtual") AND (job1.mode="Free" or...

How to get departure time and arrival time from 2 different relation in neo4j

neo4j,spring-data-neo4j
Model is transport system: nodes: BusStop, Bus, TransportOperator Relationship : Bus-[Operated_By]->TransportOperator Relationship : BusStop-[:Stops_At]->Bus relationship STOPS_AT has 2 properties arrival time(9:00) and departure time(9:01) connected to all the busstop. Example: Bus number 34 is connected to BusStop1(ArrTime-9:00, DeptTime-9:01), BusStop2(ArrTime-9:10, DeptTime-9:11), BusStop3(ArrTime-9:15, DeptTime-9:16) If i use the below query i get...

Trying to use my Service in 2 classes : org.springframework.beans.factory.BeanCreationException: Error creating bean with name

java,spring,spring-data-neo4j
Trying to use my AccountService (@Service) in 2 classes getting me this Error: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.mz.springContextWorld.repositories.AccountRepository com.mz.springContextWorld.services.AccountService.accountRepository; nested exception is...

Inherited properties of related entities are not visible in spring-data-neo4j-rest

spring,neo4j,spring-data,spring-data-neo4j
I have three NodeEntities A, B, and C. A is the parent of B and C. C has a property of type Set. For all three entities I have also a PagingAndSortingRepository. The Spring Boot application is set up as in the example https://spring.io/guides/gs/accessing-neo4j-data-rest/. Now there is a strange thing:...

spring-data-neo4j: Can't create two relationship properties with same label

spring-data-neo4j
Using spring-data-neo4j, I am not able to set up two relationship properties in the same class with the same label. The following code can be found in my branch https://github.com/spencerhrob/gs-accessing-data-neo4j/tree/same-name-relationships. Person.java: @NodeEntity public class Person { @GraphId Long id; public String name; public Person() {} public Person(String name) { this.name...

RelationshipEntity not persisted

java,spring,neo4j,spring-data,spring-data-neo4j
I'm having problems with relation @RelationshipEntity(type = RelTypes.Tag.TAG_ON_OBJECT_EVALUATION) public class TagOnObjectEvaluation { @StartNode private Mashup taggableObject; @EndNode private Tag tag; // Other fields, getters and setters } In both the entities involved (Mashup and Tag), I have this field (with opposite Direction) @RelatedToVia(type = RelTypes.Tag.TAG_ON_OBJECT_EVALUATION, direction = Direction.INCOMING /*Direction.OUTGOING*/) private...

How to query collection using cypher in neo4j?

java,graph,neo4j,cypher,spring-data-neo4j
I have one node in neo4j whose structure looks like: { "nodeId": 32, "id": "0290cf88-3345-4c30-8e5f-7ce0cb3f0b6b", "type": "User", "name": "Mahendra", "index": 0, "data": "This is sample user", "description": null, "contentBlocks": [], "icon": null, "createdOn": null, "modifiedOn": null, "properties": { "displayName": "Mahendra", "lastName": "Kawde" }, "tags": [ "tag1", "tag2" ], "categories": null...

Why can't i create a neo4j relationship with spring data for neo?

spring,neo4j,spring-data-neo4j
i'm fairly new to spring data for neo (though i have experience with neo4j itself). i tried following the 'official' guide on spring data for neo, specifically the chapter on creating relationships. But it seems i cannot get it to work. Spring is giving me an java.lang.IllegalStateException: This index (Index[__rel_types__,Relationship])...

Spring Data Neo4J findByName(String name) in interface returns incorrect results

java,spring-data-neo4j,spring-data-neo4j-4
I'm using 4.0.0.M1 Organisation microsoft = organisations.findByName("Microsoft"); if (microsoft == null) { microsoft = new Organisation("Microsoft"); organisations.save(microsoft); } Organisation apple = organisations.findByName("Apple"); if (apple == null) { apple = new Organisation("Apple"); organisations.save(apple); } Organisation checkMicrosoft = organisations.findByName("Microsoft"); The last line in my case crashes as 2 results are returned and...

Spring Data Neo4j neo4jTemplate.fetch() only returns one value

neo4j,spring-data-neo4j
I'm converting a working system that uses @Fetch to a lazy load strategy. However, when I retrieve the object with a container, the container only has one entry and neo4jTemplate.fetch(obj.getContainer()) does not retrieve the other entries. Here are the pertinent snippets @NodeEntity public class SourcePage { @GraphId private Long id;...

Getting error org.neo4j.rest.graphdb.entity.RestNode cannot be cast to java.lang.Iterable

neo4j,spring-data-neo4j
I am trying to filter feeds which contains user actvitity. I am using @QueryResult object to retrieve the result. I need both the feeds and the relationship information of user Liked Feeds. But while retrieving the feeds getting error: org.neo4j.rest.graphdb.entity.RestNode cannot be cast to java.lang.Iterable. (I am using SDN 3.3.0.RELEASE...

Spring Data Neo4j 4.0 Gradle Dependency

spring,data,gradle,neo4j,spring-data-neo4j
I am trying to download the Spring Data Neo4j 4.0 tests dependency with Gradle, but it doesn't seem to work. In the official tutorial documentation (http://docs.spring.io/spring-data/neo4j/docs/4.0.0.M1/reference/pdf/spring-data-neo4j-reference.pdf), only maven dependency below is provided: <dependency> <groupId>org.neo4j.ogm</groupId> <artifactId>neo4j-testutils</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency>...

Move method code to Neo4j Cypher query

neo4j,cypher,graph-databases,spring-data-neo4j
I have a Spring Neo4j repository method getAvgVotesWeightForCriterion @Query("MATCH (d:Decision)<-[:VOTED_FOR]-(v:Vote)-[:VOTED_ON]->(c:Criterion) WHERE id(d) = {0} AND id(c) = {1} RETURN avg(v.weight)") double getAvgVotesWeightForCriterion(Decision decision, Criterion criterion); and also I have another method calculateWeight completely written in Java. This method internally in loop uses getAvgVotesWeightForCriterion public double calculateWeight(Decision decision, List<Criterion> criteria) {...

Neo4J IndexProvider is deprecated

spring,neo4j,spring-boot,spring-data-neo4j
The project https://github.com/neo4j-contrib/developer-resources/tree/gh-pages/language-guides/java/spring-data-neo4j produces a warning: Class 'org.springframework.data.neo4j.support.index.IndexProvider' is marked deprecated I use Spring Boot. The managed version for spring-data-neo4j is 3.2.2.RELEASE Does anybody know how this deprecation can be resolved?

Spring Data Neo4j: How do I pull a list of nodes of which I do not know the type?

java,neo4j,spring-data,spring-data-neo4j,graph-databases
I'm using Spring Data Neo4j and I'd like to pull a list of owners. An owner can be a :Person (human) or an :Entity (company). I'm not sure what Type<T> should be. I could use in the GraphRepository<Type> interface. My Query is: MATCH ()-[r:OWNED_BY]->(o) RETURN And this is the code...

Use @NodeEntity on interface/abstract class

neo4j,spring-data,spring-data-neo4j
Is it possible to add @NodeEntity (or even @RelationshipEntity) annotation from SpringData Neo4j on an interface or abstact class or their fields? If not, how do you manage these situations?

How to convert org.neo4j.graphdb.Releationship to a SDN Relationship entity?

neo4j,spring-data-neo4j
How can i convert a neo4j org.neo4j.graphdb.Releationship object to a spring data neo4j Relationship entity without loading the object again?

Spring data neo4j tutorial for beginners

java,spring-data-neo4j
Is there any comprehensive spring data tutorial for neo4j for a complete newbie. I know cypher and Java, but I have no experience in things like JPA. I searched a lot but couldn't find anything for beginners.

Neo4j schema indexes for fuzzy search

neo4j,cypher,spring-data-neo4j,fuzzy-search
Right now I'm thinking on possibility to create fuzzy search in my application over my Neo4j database. The main criteria are: fuzzy search and performance. What is the best way to achive these goals with a last version of Neo4j community edition ?...

How to use @Labels spring data neo4j?

neo4j,spring-data-neo4j
It is very confusing for me to use @Labels annotation and its use ? I am following spring-data-neo4j 3.2.2 documentation. And I have found no examples of @Labels annotation. Though in api , there is @Labels annotation is available. Can anyone please explain it.