Package org.neo4j.cypher.javacompat

Examples of org.neo4j.cypher.javacompat.ExecutionEngine.execute()


        assertEquals(2, hits.size());
        hits = index.query("[122 TO 125]");
        assertEquals(3, hits.size());

        ExecutionEngine engine = new ExecutionEngine(db);
        ExecutionResult result = engine.execute("start n=node:timeline1('[100 TO 200]') return n");
        System.out.println(result.toString());
        tx.success();
        tx.finish();
    }
View Full Code Here


      GraphDatabaseService graphDb      = graphDbCommand.execute();
      ExecutionEngine engine            = (ExecutionEngine) new ExecutionEngine(graphDb);
     
      try (final Tx tx = app.tx()) {
       
        ExecutionResult result            = engine.execute("start n = node(*) match (n)<-[r:ONE_TO_ONE]-() return r");
        final Iterator<Relationship> rels = result.columnAs("r");

        assertTrue(rels.hasNext());

        rels.next().delete();
View Full Code Here

    List<GraphObject> resultList = new LinkedList<>();
    ExecutionResult result       = null;

    if (parameters != null) {

      result = engine.execute(query, parameters);
     
    } else {
     
      result = engine.execute(query);
    }
View Full Code Here

      result = engine.execute(query, parameters);
     
    } else {
     
      result = engine.execute(query);
    }

    for (Map<String, Object> row : result) {

      GraphObjectMap dummyObject = null;
View Full Code Here

    // first step: execute cypher queries
    for (final String source : sources) {

      try {
        // be very tolerant here, just execute everything
        engine.execute(source);

      } catch (Throwable t) {
        // ignore
        t.printStackTrace();
      }
View Full Code Here

        Index<Node> index;
        Transaction tx = db.beginTx();
        index = indexMan.forNodes("layer1", config);
        assertNotNull(index);
        ExecutionEngine engine = new ExecutionEngine(db);
        ExecutionResult result1 = engine.execute("create (malmo{name:'Malmö',lat:56.2, lon:15.3})-[:TRAIN]->(stockholm{name:'Stockholm',lat:59.3,lon:18.0}) return malmo");
        Node malmo = (Node) result1.iterator().next().get("malmo");
        index.add(malmo, "dummy", "value");
        tx.success();
        tx.close();
        tx = db.beginTx();
View Full Code Here

        params.put(LayerNodeIndex.DISTANCE_IN_KM_PARAMETER, 100.0);
        hits = index.query(LayerNodeIndex.WITHIN_DISTANCE_QUERY,
                params);
        assertTrue(hits.hasNext());

        ExecutionResult result = engine.execute("start malmo=node:layer1('bbox:[15.0, 16.0, 56.0, 57.0]') match p=malmo--other return malmo, other");
        assertTrue(result.iterator().hasNext());
        result = engine.execute("start malmo=node:layer1('withinDistance:[56.0, 15.0,1000.0]') match p=malmo--other return malmo, other");
        assertTrue(result.iterator().hasNext());
        System.out.println(result.dumpToString());
    }
View Full Code Here

                params);
        assertTrue(hits.hasNext());

        ExecutionResult result = engine.execute("start malmo=node:layer1('bbox:[15.0, 16.0, 56.0, 57.0]') match p=malmo--other return malmo, other");
        assertTrue(result.iterator().hasNext());
        result = engine.execute("start malmo=node:layer1('withinDistance:[56.0, 15.0,1000.0]') match p=malmo--other return malmo, other");
        assertTrue(result.iterator().hasNext());
        System.out.println(result.dumpToString());
    }

    @Test
View Full Code Here

            robin.setProperty("wkt", "POINT(44.44 33.33)");
            robin.setProperty("name", "robin");
            index.add(robin, "dummy", "value");

            ExecutionEngine engine = new ExecutionEngine(db);
            assertTrue(engine.execute("start n=node:layer3('withinDistance:[33.32, 44.44, 5.0]') return n").columnAs("n").hasNext());

            NodeProxy row = (org.neo4j.kernel.impl.core.NodeProxy) engine.execute("start n=node:layer3('withinDistance:[33.32, 44.44, 5.0]') return n").columnAs("n").next();
            assertEquals("robin", row.getProperty("name"));
            assertEquals("POINT(44.44 33.33)", row.getProperty("wkt"));
View Full Code Here

            index.add(robin, "dummy", "value");

            ExecutionEngine engine = new ExecutionEngine(db);
            assertTrue(engine.execute("start n=node:layer3('withinDistance:[33.32, 44.44, 5.0]') return n").columnAs("n").hasNext());

            NodeProxy row = (org.neo4j.kernel.impl.core.NodeProxy) engine.execute("start n=node:layer3('withinDistance:[33.32, 44.44, 5.0]') return n").columnAs("n").next();
            assertEquals("robin", row.getProperty("name"));
            assertEquals("POINT(44.44 33.33)", row.getProperty("wkt"));

            //update the node
            robin.setProperty("wkt", "POINT(55.55 33.33)");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.