@prefix sp: <http://spinrdf.org/sp#>.
@prefix spin: <http://spinrdf.org/spin#>.
@prefix spl: <http://spinrdf.org/spl#>.
@prefix ex: <ex:>.

ex:TestTemplate a spin:UpdateTemplate ;
	rdfs:subClassOf spin:UpdateTemplates ;
	spin:body [
		a sp:Modify ;
		sp:text """PREFIX ex: <ex:>
					DELETE {?this ex:prop ?x}
					INSERT {?this ex:newProp ?y}
					WHERE {?this ex:prop ?x . bind(?x+?inc as ?y)}""" 
	] ;
	spin:constraint [
		a spl:Argument ;
		spl:predicate ex:inc
	] .

ex:TestClass a rdfs:Class ;
		spin:rule [
				a ex:TestTemplate ;
				ex:inc 2
		] .

ex:testSubj1 a ex:TestClass .
ex:testSubj2 a ex:TestClass ;
	ex:prop 5 .
