neo4j

Getting superclasses in imported OWL ontology

一世执手 提交于 2019-12-08 11:52:21
问题 I'm trying to parse an ontology (complete including the imported ontology) to store it into a graph database. To do this, I first list all classes in the ontology and then link them to their respective super classes. The code works fine, except for imported super classes. I can link to super classes within my own ontology but not from a class whose superclass is in the imported ontology. The superclass exists, I can see it if I print it after the getClasesInSignature() method call because I

How to sum up different property weights?

守給你的承諾、 提交于 2019-12-08 11:01:59
问题 I am trying to get two properties sum (with weight) and combine them finally into a combined weight. So, first the separate queries, so you can see the correct sum weights Language = French , Proficiency over 6 (scale 1-10): MATCH (User)-[Speaks]->(Language) WHERE Language.language = 'French' AND Speaks.proficiency >=6 RETURN User.name, SUM( CASE WHEN Language.language='French' THEN Speaks.proficiency*3 END )*0.1 AS TOTAL_Language ORDER BY TOTAL_Language DESC User.name TOTAL_Language David 3

Neo4j and Php handle counter within transaction

点点圈 提交于 2019-12-08 10:00:24
问题 Well scenario is like this: I create a one node called counter node . Its initial value is 0 and incremented as user create its account on my website. So there are three operation happen to operate this: Read counter node value Do some logic in php . Here like +1 to previous value of counter node Write new value of counter node Now problem is, If two or more users are coming exactly same time and creating such a condition that Before first user write new value to counter node , it is being

Neo4J REST performance

烂漫一生 提交于 2019-12-08 09:33:45
问题 I've built a Java application that uses Spring and Neo4J in REST mode. The Neo4j is installed on Linux Red Hat machine and I changed nothing in its default configuration. Queries / inserts run VERY slow when I use my Java Services to query data, but the same queries run fast when I do the same operations through the remote web admin. for example, I have a query that runs in few milliseconds when I run it from the web admin, but it takes more than 30 seconds (!!) to return when calling it from

cypher query to get all relationship for a node doesn't return graphical representation in 3.1

[亡魂溺海] 提交于 2019-12-08 09:31:04
问题 I upgraded neo4j community edition from 3.0.3 to 3.1 and this query doesn't return graphical representation of all the relationships for this node anymore. MATCH (:User {username: 'user6'})-[r]-() RETURN r Any reasons why it wouldn't work in 3.1? 回答1: Looks like the browser requires you to return nodes in order to see the graphical view. Just add variables on your start and end nodes and return them. MATCH (a:User {username: 'user6'})-[r]-(b) RETURN r, a, b 回答2: 'r' refers to a relationship

Syntax error on running Cypher Query with dynamic node label

Deadly 提交于 2019-12-08 09:25:45
问题 Hello i'm trying to get data by a dynamic Cypher query.. However got an exception like: org.neo4j.rest.graphdb.query.CypherTransactionExecutionException: Error executing cypher statements [{code=Neo.ClientError.Statement.InvalidSyntax, message=Invalid input '{': expected whitespace or a label name (line 1, column 54) "MATCH (parentNode:ParentEntity)-[:HAS_A]->(childNode:{dynamicChildEntityType})= WHERE id(parentNode)={parentNodeId} RETURN childNode order by childNode.orderNr" ^}] while trying

unable to create more than 2 same relations between two nodes

佐手、 提交于 2019-12-08 09:04:58
问题 Spent multiple days trying to figure out why this isn't working. My model is Player-[:PLAYED_WITH_TEAM]->team-[:CONTESTED_IN]->league . Few instances of this relation is as follows bob-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->ABC League alice-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->ABC League bob-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->XYZLeague Bob played for the same team "Falcons" in two leagues ABC and XYZ. This is the fact i want to capture. Since Bob played for the same

Graph database performance

独自空忆成欢 提交于 2019-12-08 08:56:38
问题 I was reading a book recommended on Neo4j site: http://neo4j.com/books/graph-databases/ about graph database performance and it said: "In contrast to relational databases, where join-intensive query performance deteriorates as the dataset gets bigger, with a graph database performance tends to remain relatively constant, even as the dataset grows. This is because queries are localized to a portion of the graph . As a result, the execution time for each query is proportional only to the size

Extracting subgraph from neo4j database

蓝咒 提交于 2019-12-08 08:26:27
问题 I have a graph in neo4j database. I want to extract a sub graph given a particular node and a particular depth. I tried using the traversal framework, but it only returns a set of paths. It gives path up to a particular depth. How can i construct a sub graph based on the set of paths that i get? Is there any other way to get the required result? 回答1: In case that, by subgraph, you mean a list of nodes, and you've got the Path objects from the traversal already, you could just collect the end

Neo4j rename property using regex of current property value

此生再无相见时 提交于 2019-12-08 08:12:01
问题 From my research (lots of Googling), I can not see that this is possible, but it is still worth asking I think. I have a large collection of nodes like: (org:Organization {name: "Organization 1234"}) where 1234 can be any non-negative integer. In order to update the DB to work with a new API, I am wanting to rename each of these in the collection so that the result would look something like: (org:Organization {name: "Org_1234"}) So, I need to mashup Org_ with the [0-9]+ regex match on the