A graph DB vs a Prolog (or miniKanren)

No, logic programming as embodied by those things and neo4j are quite different. On one level, you’re right that they conceptually both amount to graph storage and graph query. But for logic programming, it’s only conceptually graph query, there’s no guarantee that it’s actually stored that way (where with neo4j, it is). Second, with logic … Read more

Forgot Neo4j Server Password

Depending on environment and installation type you need to look for a file named auth under directory dbms and remove it. In MacOs, for dmg installations (adjust for custom locations): /Users/xyz/Documents/Neo4j/default.graphdb/dbms/auth or (homebrew install) /usr/local/Cellar/neo4j/x.x.x/libexec/data/dbms/auth Windows users should look for same file in the default.graphdb/dbms directory. In Ubuntu /var/lib/neo4j/data/dbms/auth In docker containers /var/lib/neo4j/data/dbms/auth Alternatively, you … Read more

Gremlin remove all Vertex

In more recent terms as of Gremlin 2.3.0, removal of all vertices would be best accomplished with: g.V.remove() UPDATE: For version Gremlin 3.x you would use drop(): gremlin> graph = TinkerFactory.createModern() ==>tinkergraph[vertices:6 edges:6] gremlin> g = graph.traversal() ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] gremlin> g.V().drop().iterate() gremlin> graph ==>tinkergraph[vertices:0 edges:0] Note that drop() does not automatically iterate the Traversal … Read more

Check whether a node exists, if not create

When using MERGE on full patterns, the behavior is that either the whole pattern matches, or the whole pattern is created. MERGE will not partially use existing patterns — it’s all or nothing. If partial matches are needed, this can be accomplished by splitting a pattern up into multiple MERGE clauses. http://docs.neo4j.org/chunked/stable/query-merge.html MERGE (n)-[:know {r:’123′}]->(test2 {name:’2′}) will … Read more

Neo4j – Match by multiple relationship types

Yes, you can do something like: match (gal:Person{name:”Yoav”})-[:liked|:watched|:other]->(movie:Movie) return movie Take a look in the docs: Match on multiple relationship types EDIT: From the comments: I need “and” between the relation types.. you gave me an “or” In this case, you can do: match (Yoav:Person{name:”Yoav”})-[:liked]->(movie:Movie), (Yoav)-[:watched]->(movie), (Yoav)-[:other]->(movie) return movie

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)