Repo:
Docker Hub:
Neo4j Flights Image in Docker Hub
Workshop:
MATCH p=(a1:Airport { code: "BKK" })-[:FLIES_TO]->(a2:Airport { code: "ARN" }) | |
RETURN p |
Repo:
Docker Hub:
Neo4j Flights Image in Docker Hub
Workshop:
MATCH (n) DETACH DELETE n; | |
MERGE (org:Organization { name: "StarWars Company", taxid: 111222333 }) | |
MERGE (d0:Department { name: "IT" }) | |
MERGE (d1:Department { name: "Frontend" }) | |
MERGE (d2:Department { name: "DevOps" }) | |
MERGE (d3:Department { name: "Website" }) | |
MERGE (luke:Person { name: "Luke Skywalker" }) | |
MERGE (r2d2:Person { name: "R2D2" }) |
const [scaleValue] = useState(new Animated.Value(1)) | |
const waterAnimation = () => { | |
Animated.sequence([ | |
Animated.timing(scaleValue, { // 1 | |
toValue: 1.2, | |
duration: 1500, | |
easing: Easing.linear | |
}), | |
Animated.timing(scaleValue, { // 2 |
CALL algo.scc( | |
'MATCH (p:Person)-[:FROM]->(:City { name: "Bangkok" }) RETURN id(p) as id', | |
'MATCH (p1:Person)-[:OUT]->(:Call)<-[:IN]-(p2:Person) RETURN id(p1) as source, id(p2) as target', | |
{ write: true, writeProperty: 'communityId', graph:'cypher' }) | |
YIELD communityCount | |
MATCH (p:Person)-[:FROM]->(:City { name: "Bangkok" }) | |
WITH p.name as name, p.communityId as communityId | |
RETURN communityId, count(name) as total | |
ORDER BY total DESC |
// algorithm | |
CALL algo.degree.stream("City", "CONNECT_WITH", { direction: "both", weightProperty: "calls" }) YIELD nodeId, score | |
RETURN algo.asNode(nodeId).name AS name, score | |
ORDER BY score DESC | |
// manual calculation | |
MATCH (c:City)-[cw:CONNECT_WITH]-(:City) | |
RETURN c.name as name, SUM(cw.calls) as score | |
ORDER BY score DESC |
// clean up | |
MATCH (:City)-[cw:CONNECT_WITH]-(:City) | |
DELETE cw | |
// external calls - total | |
MATCH (c1:City)<-[:FROM]-(:Person)-[]->(c:Call)<-[]-(:Person)-[:FROM]->(c2:City) | |
WHERE id(c1) > id(c2) | |
WITH c1.name as from, c2.name as to, count(c) as calls | |
RETURN sum(calls) as s |
MATCH (c:City)<-[:FROM]-(p:Person) | |
WITH c, count(p) as pop | |
SET c.population = pop |
MATCH (c:City { name: "Bangkok" })<-[:FROM]-(p1:Person)-[:OUT]->(cc:Call)<-[:IN]-(p2:Person) | |
RETURN p1.name, count(cc) as total | |
ORDER BY total DESC | |
LIMIT 10 |
MATCH (c:City { name: "Bangkok" })<-[:FROM]-(p1:Person)-[:OUT]->(cc:Call)<-[:IN]-(p2:Person) | |
RETURN count(cc) as total | |
ORDER BY total DESC |