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

ex:ParentClass a rdfs:Class ;
		spin:constructor [
				a sp:Construct ;
				sp:text """PREFIX ex: <ex:>
							CONSTRUCT {?this ex:parentProp ?y}
							WHERE {?this ex:prop ?x . bind(?x+1 as ?y)}""" 
		] .

ex:TestClass a rdfs:Class ;
		rdfs:subClassOf ex:ParentClass ;
		spin:constructor [
				a sp:Construct ;
				sp:text """PREFIX ex: <ex:>
							CONSTRUCT {?this ex:childProp ?y}
							WHERE {?this ex:parentProp ?x . bind(?x+1 as ?y)}""" 
		] .

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