neo4j

Neo4j inconsistent behaviour of model classes

こ雲淡風輕ζ 提交于 2019-12-11 07:36:53
问题 I have created 5 models in my project using ActiveNode model and using neo4j gem. There is a model named Disease, defined as: class Disease include Neo4j::ActiveNode property :disease, type: String, constraint: :unique property :created_at, type: DateTime property :updated_at, type: DateTime enum factor_effect: [:relief, :worsen] # Associations has_many :in, :factors, type: :AFFECTED_BY end and Factor: class Factor include Neo4j::ActiveNode property :factor, type: String, constraint: :unique

java.lang.NoSuchMethodError: org.neo4j.ogm.session.SessionFactory.metaData()Lorg/neo4j/ogm/MetaData;

丶灬走出姿态 提交于 2019-12-11 07:24:59
问题 Here are my code in PersistenceContext.java package yuzhaoLiu.project.testNeo4j; import org.neo4j.ogm.config.ClasspathConfigurationSource; import org.neo4j.ogm.config.ConfigurationSource; import org.neo4j.ogm.config.FileConfigurationSource; import org.neo4j.ogm.session.Session; import org.neo4j.ogm.session.SessionFactory; import org.springframework.context.annotation.*; import org.springframework.data.neo4j.config.Neo4jConfiguration; import org.springframework.data.neo4j.repository.config

Spring Data Neo4j - Indexing and Inheritance

浪子不回头ぞ 提交于 2019-12-11 07:23:45
问题 Lets say i have the following data model: public class A { @Indexed(indexType = IndexType.FULLTEXT, indexName = "property1") String property1; } public class B extends A { @Indexed(indexType = IndexType.FULLTEXT, indexName = "property2") String property2; } Can i tell the Spring framework to index property1 of class B under a different index name? If not, what would you do in such case? I mean, what would you do if you have few classes that all extends the same base class, but in the same

neo4j create the opposite edge

岁酱吖の 提交于 2019-12-11 07:19:29
问题 i am new to neo4j and cypher , i need to create the opposite of all the edges of the graph but i need that the opposites edges to have the same type of the original edges for illustration the opposite of (a)-[:sometype]->(b) would be (b)-[:sometype]->(a) i know that it is very easy to create the opposite of all the edges by just tapping this command match (a)-[]->(b) create (b)-[]->(a) but as i have already said i need the created edge to have the same type of the original edge thank you 回答1:

How do i create relationships for existing nodes by importing csv file in neo4j?

﹥>﹥吖頭↗ 提交于 2019-12-11 07:09:22
问题 lets say i have created [a],[b],[c],[d] nodes in neo4j. how to create relationships among those nodes by importing csv data. csv data: id,fromNode,toNode,typeOfRelation 1,a,b,KNOWs 2,b,c,FOLLOWS 3,d,a,KNOWS .... 回答1: I would do it like this way if your Nodes are in the Graph already. CREATE INDEX ON :Label(name); LOAD CSV WITH HEADERS FROM "file:///<PathToYourCSV>" as input MATCH (from:Label {name: input.fromNode}), (to:Label {name: input.toNode}) CREATE (from)-[:RELATION { type: input

How to cypher query a neo4j DB with WHERE clause on sparse property

折月煮酒 提交于 2019-12-11 07:07:27
问题 I have Nodes in my Neo4j database that have certain properties that do not exist on all nodes, but I want to query against those properties with Cypher with a WHERE clause. Example Data: {id:"52", name:"Jim", age:"32", gender:"M"} {id:"55", name:"Lisa", age:"22", gender:"F"} {id:"97", name:"Chris", age:"38"} Now, if I want to run a Cypher query on gender, it gives me an error on the Chris record, stating that the gender property does not exist on that node. Example Cypher query: START n=NODE(

Parsing a neo4j JSON object in javascript

老子叫甜甜 提交于 2019-12-11 07:04:12
问题 I am just playing around with Neo4j and trying to retrieve data from Neo4j in JSON format and then trying to parse it to try and get the values correctly. I am calling a php code from my html,javascript client and the php is making a curl call to neo4j . The query is simple returning one node from neo4j which has one property to the node. The PHP code: <?php header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); $data=array( "query"

Index parameterization in Cypher REST query

不想你离开。 提交于 2019-12-11 07:03:51
问题 I have this query which works well but without parametrization in index. emp is an index, and NUM_OFC_CA is an emp number (key in emp index), to simplify i want to return NME_CA. curl -X POST http://xyzhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query -H "Content-Type: application/json" --data-binary '{ "query": "START ca=node:emp(\"NUM_OFC_CA: 997015\") RETURN distinct ca.NME_CA as `CA Name`", "params": { } }' How can i parametrize above REST query, i have tried something like this:

Can not explore database created by an embedded neo4j

一笑奈何 提交于 2019-12-11 06:59:36
问题 I encounter a strange problem. I created an database using embedded neo4j whose path is "/Users/bondwong/Documents/workspace/pamela/target/data/pamela.db". Here is the Spring configuration: <bean id="graphDbBuilder" factory-bean="graphDbFactory" factory-method="newEmbeddedDatabaseBuilder"> <constructor-arg value="target/data/pamela.db" /> </bean> Then I changed this line of neo4j-server.properties: org.neo4j.server.database.location=/Users/bondwong/Documents/workspace/pamela/target/data

how to speed up insertion in neo4j from mysql?

左心房为你撑大大i 提交于 2019-12-11 06:51:19
问题 I have a dataset of 60000 items in mysql and i'm trying to insert it into neo4j. The insertion is taking place but it's taking a long time( approx. 10-15 per 3 sec). Is there any way i can speed it up? also is there any way i could give something such as unique key in neo4j so duplication indexes won't get indexed? I'm new to neo4j. I'm using neo4j 1.8 with PHP Everyman driver. 回答1: There is a nice presentation from Max De Marzi, about ETL into Neo4j. See: http://www.slideshare.net/maxdemarzi