neo4j

Neo4j Spatial: can't run spatial

↘锁芯ラ 提交于 2019-12-24 13:22:04
问题 I have been trying to work with Neo4j Spatial for my project, but I can't make it work. With limited documentation and examples I figured out how to load OSM map to the database. But to check if it is loaded, I am trying to execute a spatial query. While trying to run my code I get this error: import.java:69: error: cannot access GremlinGroovyPipeline .startIntersectSearch(layer, bbox) ^ class file for com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline not found I understand what's wrong (it

Neo4j-spatial importing OSM missmatching vertices found

眉间皱痕 提交于 2019-12-24 12:39:04
问题 This is my method to import osmdata: private void importOSM(String osm){ OSMImporter importer = new OSMImporter(osm); importer.setCharset(Charset.forName("UTF-8")); try{ importer.importFile(graphDb,osm,false,5000,true); importer.reIndex(graphDb,10000); }catch(Exception e){ System.out.println("__________Import Error!! "+e.getMessage()); e.printStackTrace(); } } When I import an osmdata I get this: Mismatching vertices size for Polygon:Node[1799298]: 1 != 2 Mismatching vertices size for

Gremlin query like SQL IN operator?

怎甘沉沦 提交于 2019-12-24 12:20:04
问题 Im stuck with gremlin. I have emails like array and I need to make query to find all user with those emails. In SQL I have SELECT email(s) FROM user WHERE email IN (xxx, yyy...) How can I do this in Gremlin query language? 回答1: What you wanna do here is: g.V().has('anyProperty', within('possibleValue1', 'possibleValue2')) 回答2: If it is acceptable for you to do a linear scan of all vertices, then you could do something like: gremlin> g = TinkerGraphFactory.createTinkerGraph() ==>tinkergraph

Set label from a nodes property

会有一股神秘感。 提交于 2019-12-24 12:10:25
问题 How can i add a label for a node from one of the nodes properties ? I have a large CSV-file with a label in one column. With the LOAD CSV command its not possible to set a nodes label from a CSV-column value. Is there anoter way ? 回答1: The APOC procedures Neo4j plugin contains some useful procedures for helping to refactor a graph (https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_graph_refactorings) For your needs, you can use the following procedure : CALL apoc.create.addLabels( node,

Is py2neo caching burning me?

与世无争的帅哥 提交于 2019-12-24 11:45:14
问题 I am running this code: c = """ match(r:XX) optional match(r)-[]-(m) with count(m) as mc, r match(x) return count(x) as all, r, mc """ (snip!) while(True): tx = remote_graph.cypher.begin() res = remote_graph.cypher.execute(c) tx.rollback() time.sleep(15) (snip!) I know for a fact the XX node's properties are changing every second - there a daemon running. However, when I run this, I always get the same values back in res but for r only - all is changing. The query isn't changing. I wonder if

How to find a path in cypher the ungreedy way

爷,独闯天下 提交于 2019-12-24 11:37:42
问题 Actually i'm modelling TEI-encoded XML-Text in a graph (words as a chain of nodes) and i want to find shortestPaths and only the very shortest path in a graph. My query looks like MATCH (w0:XmlWord)-[:NEXT*..6]->(n:XmlTag {_name:'lb'})-[:NEXT*..6]->(w1:XmlWord) RETURN id(w0), id(w1); And I need only the shortest possible path but neo4j gives me all possibilities until to the 6th step. The result should be the nodes Vorträge , über , des , and Freiherrn Neo4j gives me back all possible

Neo4j: Native Java API(or equivalent cypher query) in Spring Data Neo4j

感情迁移 提交于 2019-12-24 11:35:19
问题 I was experimenting with Neo4j embedded-db in the past few days for a DEMO and was thoroughly impressed with the Native Java API's for indexing, lucene queries and even managed to do fuzzy search. I then decided to take this POC to production with Spring Data Neo4j 4.0 but ran into issues with Cypher queries and fuzzy search. My domain class "Team" looks like this: @NodeEntity public class Team { @GraphId Long nodeId; /** The team name. */ @Indexed(indexType = IndexType.FULLTEXT,indexName =

Is it possible to get the shortest path with traversal cost by using Cypher or Gremlin?

◇◆丶佛笑我妖孽 提交于 2019-12-24 10:53:46
问题 I know it is possible to get the shortest path of minimum number of nodes by using Cypher and Gremlin? How about getting a path with minimum traversal cost? One of the example I can think of is the bus route. Some routes may have less bus stops (nodes) but need longer time (cost) to travel from one stop to another, some are reverse. Is it possible to get the shortest path with minimum travel time by using Cypher or Gremlin? 回答1: See this other question for more on shortest paths. In answer to

Neo4j Cypher query null or IN

霸气de小男生 提交于 2019-12-24 10:46:19
问题 I have a following cypher query: MATCH (parentD)-[:CONTAINS]->(childD:Decision)-[ru:CREATED_BY]->(u:User) WHERE id(parentD) = {decisionId} RETURN ru, u, childD SKIP 0 LIMIT 100 Decision entity can belong to 0..N Tenant objects @NodeEntity public class Decision { private final static String BELONGS_TO = "BELONGS_TO"; @Relationship(type = BELONGS_TO, direction = Relationship.OUTGOING) private Set<Tenant> tenants = new HashSet<>(); .... } I need to extend the Cypher query above in order to

Rebuild of label index in neo4j

我的梦境 提交于 2019-12-24 10:35:51
问题 My Neo4J instance suddenly stopped working, I think my drive ran out of space due to some unrelated logfiles. Anyway, now I cannot start Neo4J, it start, over and over again. If i check the consistency of the database I get the following message. (It does not work neither on version 3.3.5 or 3.4.1) WARN : Label index was not properly shutdown and rebuild is required. Label index: neostore.labelscanstore.db WARN : Index was not properly shutdown and rebuild is required. Index[ IndexRule[id=1,