neo4j

Not null attribute in Neo4J constraint

杀马特。学长 韩版系。学妹 提交于 2020-01-15 08:41:26
问题 It is possible to create constraint in Neo4J database for attribute to be not null? Something like: CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS NOT NULL 回答1: It's planned and been already implemented for Neo4j 2.3, should be available with 2.3.RC1 来源: https://stackoverflow.com/questions/31439614/not-null-attribute-in-neo4j-constraint

Neo4j: Enforcing schema with XSD

核能气质少年 提交于 2020-01-15 08:19:26
问题 I was wondering if there exists a tool for Neo4j that can read an XSD file and use it to enforce a schema on Neo4j. I'm newbie on graph databases but I'm starting to appreciate the schema-less approach. There's a lot of projects out there that have been pumping in a lot of non-sequential data and making sense of it all which is really cool. I've come across some requirements that call for control on what properties a node or edge can have given a certain label and what labels an edge can have

Neo4J / py2neo — cursor-based query?

不打扰是莪最后的温柔 提交于 2020-01-15 07:41:05
问题 If I do something like this: from py2neo import Graph graph = Graph() stuff = graph.cypher.execute(""" match (a:Article)-[p]-n return a, n, p.weight """) on a database with lots of articles and links, the query takes a long time and uses all my system's memory, presumably because it's copying the entire result set into memory in one go. Is there some kind of cursor-based version where I could iterate through the results one at a time without having to have them all in memory at once? EDIT I

equivalent of template.createRelationBetween in SDN4

人走茶凉 提交于 2020-01-15 07:37:19
问题 My project is currently use Spring-Data-Neo4J 3.3.0 and I'm trying to use the new 4.0.0.Release version. In my code I have the following code : neo4jTemplate.createRelationshipBetween(eltOrRel, attribute, valueClass, GraphRelationType.HAS_ATT_VALUE, true) What is the equivalent of this code (which is use this method in api in the new version of SDK please ? More especially I don't know how to create a relation of a given type but for a specific class. How can I write such a creation in cypher

neo4j EntityNotFound prevents cypher match from working

浪子不回头ぞ 提交于 2020-01-15 07:20:27
问题 My neo4j db is in a corrupted state. A former node, also a Person node connected to a State via Address, prevents any matches from working: match (p:Person)--(:Address)--(s:State) where s.name="Cali" return p, s Node with id 101005 Neo.ClientError.Statement.EntityNotFound I suspect this is something to do with the 101005 node still existing in the label index even though it's been deleted. How do I recover without clearing all of the data? I've deleted all of the Person relationships/nodes

Cypher: Finding movies that haven't been rated yet by particular user

。_饼干妹妹 提交于 2020-01-15 03:56:07
问题 Let's say I have 3 movies in my Neo4J database: CREATE (interpreter:Movie {title: 'The Interpreter', year : 2005}) CREATE (dogville:Movie {title: 'Dogville', year : 2003}) CREATE (railwayMan:Movie {title: 'The Railway Man', year : 2013}) Also there are users: CREATE (maciej:Person {name: 'Maciej Ziarko', birthYear: 1989}) who rate movies: CREATE (maciej)-[:RATED {stars : 4, comment : "I liked that movie!" }]->(interpreter); It's easy to find movies rated by particular user using Cypher MATCH

In neo4j can I get a less verbose REST api response

梦想的初衷 提交于 2020-01-14 14:15:51
问题 Is there a way I can get a less verbose rest api response in neo4j, perhaps something with just the node data? It seems like it's a bit of a waste of bandwidth to send all that extra data on every request. Why is all that metadata included in the response anyways? For instance, the base api url is repeated throughout, and once you have the node id, one can reliably predict the urls for all the properties like self, properties, relationships, etc... They don't seem like terribly volatile urls.

Neo4j server fails to start with unmanaged extension

痞子三分冷 提交于 2020-01-14 14:01:46
问题 I'm trying to use unmanaged extensions on a neo4j server (version CE 2.3.2), so I'm trying a simple HelloWorld example given on the official Neo4j website: I've generated the jar file with the "org.neo4j.server.plugins.ServerPlugin" file in the "METADATA/services" folder. I put my jar in the "[neo4jInstallPath]/plugins" folder I put the following line in the "C:\Users[currentUser]\AppData\Roaming\Neo4j Community Edition\neo4j-server.properties" org.neo4j.server.thirdparty_jaxrs_classes=org

Initial load of Neo4j db from a xml file

痞子三分冷 提交于 2020-01-14 13:55:30
问题 Can a xml ( and the relationship it has between entities ) be used to initially populate a Neo4j db? Can Neo4j or some graph db automatically parse out the relationship between the entities, and then load up the db. I guess, I can later add more details to the relationship? P.S.: I am reading up on Neo4j, but this can be any graph db. Thanks!! 回答1: There is graphML which can be loaded into almost any graphdb using the blueprints GraphML loader 来源: https://stackoverflow.com/questions/10124216

How to compare performance on neo4j queries without cache?

自古美人都是妖i 提交于 2020-01-14 13:37:30
问题 I've been trying to compare queries performance in neo4j. In order to make the queries more efficient, I added index, analysed the result using profile, and tried doing the same while using the USING INDEX. On most queries, DB Hits were much better using the second option (with the USING INDEX), rows were the same or less, but the time performance seems not to be reliable: on several queries adding the USING INDEX was slower though the better performance parameters (db hits & rows)and times