SELECT  Q.x, Q.ci+SUM(Q.cp*Q.am)
FROM	sparqltable( SELECT ?x ?ci ?cp ?am
		  WHERE{ 	?x rdf:type 'Intervention'.
			?x :costInt ?ci.
		       	(?x :Need ?y) :amount ?am.
			?y rdf:type 'Part'.	
			?y :costPart ?cp.
		}
	   )Q
	
GROUP BY(Q.x)
