Examples of ExecutionEngine


Examples of org.neo4j.cypher.ExecutionEngine

    @Override
    public String getEmergencyAttachedToCall(String callId) {
        Transaction tx = graphDb.beginTx();
        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start c=(calls, 'callId:" + callId + "')  match (c) -[CREATES]-> (e)    return e");
            ExecutionResult result = engine.execute(query);

            if (result.isEmpty()) {
                throw new IllegalStateException("No Emergency attached to the Call " + callId);
            }
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

        System.out.println(">>>> Attaching Vehicle " + vehicleId + " to Procedure " + procedureId);
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(procedures, 'procedureId:" + procedureId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node procedure = n_column.next();

            query = parser.parse("start n=(vehicles, 'vehicleId:" + vehicleId + "')  return n");
            result = engine.execute(query);
            n_column = result.columnAs("n");
            Node vehicle = n_column.next();

            procedure.createRelationshipTo(vehicle, EmergencyRelationshipType.USE);
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

        System.out.println(">>>> Attaching Procedure " + childProcedureId + " to Procedure " + parentProcedureId);
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(procedures, 'procedureId:" + parentProcedureId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node parentProcedure = n_column.next();

            query = parser.parse("start n=(procedures, 'procedureId:" + childProcedureId + "')  return n");
            result = engine.execute(query);
            n_column = result.columnAs("n");
            Node childProcedure = n_column.next();

            parentProcedure.createRelationshipTo(childProcedure, EmergencyRelationshipType.SUB);
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void attachServiceChannel(String emergencyId, String channelId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(emergencies, 'emergencyId:" + emergencyId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node emergency = n_column.next();

            query = parser.parse("start n=(channels, 'channelId:" + channelId + "')  return n");
            result = engine.execute(query);
            n_column = result.columnAs("n");
            Node channel = n_column.next();

            emergency.createRelationshipTo(channel, EmergencyRelationshipType.CONSUME);
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachVehicle(String vehicleId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(vehicles, 'vehicleId:" + vehicleId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node vehicle = n_column.next();
            //Removing the node from the index
            this.vehiclesIndex.remove(vehicle);
            for (Relationship rel : vehicle.getRelationships()) {
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachProcedure(String procedureId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(procedures, 'procedureId:" + procedureId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node procedure = n_column.next();
            //Removing the node from the index
            this.proceduresIndex.remove(procedure);
            for (Relationship rel : procedure.getRelationships()) {
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachEmergency(String emergencyId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(emergencies, 'emergencyId:" + emergencyId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node emergency = n_column.next();
            //Removing the node from the index
            this.emergenciesIndex.remove(emergency);
            for (Relationship rel : emergency.getRelationships()) {
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachServiceChannel(String serviceChannelId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(channels, 'channelId:" + serviceChannelId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node channel = n_column.next();
            //Removing the node from the index
            this.channelsIndex.remove(channel);
            for (Relationship rel : channel.getRelationships()) {
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachPatient(String patientId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(patients, 'patientId:" + patientId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node patient = n_column.next();
            //Removing the node from the index
            this.channelsIndex.remove(patient);
            for (Relationship rel : patient.getRelationships()) {
View Full Code Here

Examples of org.neo4j.cypher.ExecutionEngine

    public void detachEmergencyEntityBuilding(String entityBuildingId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(buildings, 'buildingId:" + entityBuildingId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node building = n_column.next();
            //Removing the node from the index
            this.buildingsIndex.remove(building);
            for (Relationship rel : building.getRelationships()) {
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.