// Path: src/main/java/org/deri/cqels/data/Mapping.java
// public interface Mapping extends Map<Var, Long>{
// 	
// 
// 	public long get(Var var); 
// 	
// 	public void from(OpRouter router);
// 	
// 	public OpRouter from();
// 	
// 	public ExecContext getCtx();
// 	
// 	public Iterator<Var> vars();
// 	
// 	public void addParent(Mapping parent);
// 	
// 	public boolean hasParent();
// 	
// 	public boolean isCompatible(Mapping mapping);
// }


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.deri.cqels.data.Mapping;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleIterator;
import com.hp.hpl.jena.sparql.core.BasicPattern;
import com.hp.hpl.jena.sparql.syntax.Template;
package org.deri.cqels.engine;



/**
 * This class processes the mapping result for the CONSTRUCT-type query form
 * @author		Danh Le Phuoc
 * @author 		Chan Le Van
 * @organization DERI Galway, NUIG, Ireland  www.deri.ie
 * @email 	danh.lephuoc@deri.org
 * @email   chan.levan@deri.org
 * @see ContinuousListenerBase
 */
public abstract class ConstructListener implements ContinuousListener {
	String uri;
	Template template;
	ExecContext context;
	public static int count = 0;
	public ConstructListener(ExecContext context, String streamURI) { 
		this.uri = streamURI;
		this.context = context;
	}
	
	public ConstructListener(ExecContext context) {
		this.context = context;
	}
	public void setTemplate(Template t) {
		template = t;
	}

	
// Path: src/main/java/org/deri/cqels/data/Mapping.java
// public interface Mapping extends Map<Var, Long>{
// 	
// 
// 	public long get(Var var); 
// 	
// 	public void from(OpRouter router);
// 	
// 	public OpRouter from();
// 	
// 	public ExecContext getCtx();
// 	
// 	public Iterator<Var> vars();
// 	
// 	public void addParent(Mapping parent);
// 	
// 	public boolean hasParent();
// 	
// 	public boolean isCompatible(Mapping mapping);
// }


// Path: src/main/java/org/deri/cqels/engine/ConstructListener.java
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.deri.cqels.data.Mapping;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.graph.TripleIterator;
import com.hp.hpl.jena.sparql.core.BasicPattern;
import com.hp.hpl.jena.sparql.syntax.Template;

package org.deri.cqels.engine;



/**
 * This class processes the mapping result for the CONSTRUCT-type query form
 * @author		Danh Le Phuoc
 * @author 		Chan Le Van
 * @organization DERI Galway, NUIG, Ireland  www.deri.ie
 * @email 	danh.lephuoc@deri.org
 * @email   chan.levan@deri.org
 * @see ContinuousListenerBase
 */
public abstract class ConstructListener implements ContinuousListener {
	String uri;
	Template template;
	ExecContext context;
	public static int count = 0;
	public ConstructListener(ExecContext context, String streamURI) { 
		this.uri = streamURI;
		this.context = context;
	}
	
	public ConstructListener(ExecContext context) {
		this.context = context;
	}
	public void setTemplate(Template t) {
		template = t;
	}

	
	public void update(Mapping mapping) {