@@ -0,0 +1,2196 @@
+/*%0A *  Copyright (C) 2011 The Animo Project%0A *  http://animotron.org%0A *%0A *  This program is free software; you can redistribute it and/or%0A *  modify it under the terms of the GNU Lesser General Public License%0A *  as published by the Free Software Foundation; either version 3%0A *  of the License, or (at your option) any later version.%0A *%0A *  This program is distributed in the hope that it will be useful,%0A *  but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *  GNU Lesser General Public License for more details.%0A *%0A *  You should have received a copy of the GNU Lesser General Public License%0A *  along with this program; if not, write to the Free Software%0A *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.%0A */%0Apackage org.animotron.exist.interpreter.op;%0A%0Aimport java.io.IOException;%0A%0Aimport org.animotron.exist.index.RelationshipTypeTHE;%0Aimport org.animotron.exist.index.RelationshipTypes;%0Aimport org.animotron.exist.interpreter.Calculator;%0Aimport org.animotron.io.PipedInputObjectStream;%0Aimport org.animotron.io.PipedOutputObjectStream;%0Aimport org.neo4j.graphdb.Direction;%0Aimport org.neo4j.graphdb.Node;%0Aimport org.neo4j.graphdb.Relationship;%0A%0A/**%0A * Operation 'get'. Return 'have' relations on provided context.%0A * %0A * @author %3Ca href=%22mailto:shabanovd@gmail.com%22%3EDmitriy Shabanov%3C/a%3E%0A * @author %3Ca href=%22mailto:gazdovsky@gmail.com%22%3EEvgeny Gazdovsky%3C/a%3E%0A */%0Apublic class An %7B%0A%0A%09public static void eval(Relationship op, PipedOutputObjectStream out, boolean isLast) throws IOException %7B%0A%09%09PipedInputObjectStream in = new PipedInputObjectStream();%0A%0A%09%09if (!isLast)%0A%09%09%09Calculator.eval(op, new PipedOutputObjectStream(in));%0A%09%09%0A%09%09//go to 'THE' node%0A%09%09for (Relationship r : op.getEndNode().getRelationships(RelationshipTypes.REF, Direction.OUTGOING)) %7B%0A%09%09%09%0A%09%09%09//get 'THE' relation%0A%09%09%09Node node = r.getEndNode();%0A%09%09%09String name = (String) node.getProperty(%22name%22);%0A%09%09%09for (Relationship t : node.getRelationships(new RelationshipTypeTHE(name), Direction.INCOMING)) %7B%0A%09%09%09%09out.write(t);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09//XXX: what do to with that?%0A//%09%09Object n; %0A//%09%09while ((n = in.read()) != null) %7B%0A//%09%09%09out.write(n);%0A//%09%09%7D %0A%09%7D%0A%7D%0A

AN instruction